.indicators-portal-body {
    margin: 0;
    min-height: 100vh;
    background: #eef3f8;
    color: #13345f;
    font-family: "Poppins", sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.indicators-portal-body *,
.indicators-portal-body *::before,
.indicators-portal-body *::after {
    box-sizing: border-box;
}

.indicators-portal-body #djDebug,
.indicators-portal-body .djdt-panelContent {
    display: none !important;
}

.indicators-portal-body button,
.indicators-portal-body input,
.indicators-portal-body select,
.indicators-portal-body textarea {
    font: inherit;
}

[hidden] {
    display: none !important;
}

.indicators-portal {
    --portal-bg: #eef3f8;
    --portal-surface: #ffffff;
    --portal-surface-soft: #f7fafe;
    --portal-border: #d7e1ee;
    --portal-border-strong: #bccadd;
    --portal-primary: #174786;
    --portal-primary-soft: #e9f1fb;
    --portal-accent: #2494d3;
    --portal-text: #17365e;
    /* Secondary/tertiary text darkened to meet WCAG AA (>=4.5:1) on both
       --portal-surface (#fff) and --portal-surface-soft (#f7fafe). */
    --portal-text-soft: #4f637e;
    --portal-text-muted: #586d8b;

    /* Semantic status colors (text + tint background, all AA on their bg) */
    --portal-success: #1b7a4b;
    --portal-success-bg: #e6f5ec;
    --portal-warning: #8a5a00;
    --portal-warning-bg: #fdf3df;
    --portal-danger: #b42318;
    --portal-danger-bg: #fdeceb;
    --portal-info: #155e9c;
    --portal-info-bg: #e7f1fb;

    /* Map legacy shadow names onto the shared 3-level elevation scale */
    --portal-shadow: var(--shadow-2);
    --portal-shadow-soft: var(--shadow-1);

    /* Measured at runtime via ResizeObserver in portal.js so the sticky filter
       panel always sits flush below the real header height — robust across zoom
       levels and viewport widths. The value here is just a sensible fallback. */
    --portal-measured-header-space: 48px;
    --portal-measured-results-toolbar-space: 68px;
    --portal-visible-header-space: var(--portal-measured-header-space);
    --portal-filters-sticky-top: calc(var(--header-height, 0px) + var(--portal-measured-results-toolbar-space) + var(--s-2));
    min-height: 100vh;
    padding: var(--s-2) var(--s-5) var(--s-6);
    background: var(--portal-bg);
}

.portal-shell {
    width: min(1520px, 100%);
    margin: 0 auto;
    display: grid;
    gap: var(--s-2);
}

.portal-header {
    position: static;
    display: block;
    margin: 0;
    padding: 2px 0 4px;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    z-index: auto;
}

.portal-header-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--s-3);
    min-width: 0;
    padding: 0;
}

.portal-header-copy {
    max-width: 700px;
    display: grid;
    gap: var(--s-1);
    min-width: 0;
}

.portal-eyebrow {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--fs-2xs);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--portal-primary);
    flex-wrap: wrap;
}

/* "Official statistics" trust badge */
.portal-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: var(--r-pill);
    background: var(--portal-success-bg);
    color: var(--portal-success);
    font-size: var(--fs-2xs);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: none;
}

.portal-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.portal-header h1 {
    margin: 0;
    font-size: clamp(1.22rem, 1.55vw, 1.58rem);
    line-height: 1.12;
    color: var(--portal-primary);
    letter-spacing: 0;
}

.portal-description {
    margin: 0;
    max-width: 640px;
    font-size: var(--fs-sm);
    line-height: 1.38;
    color: var(--portal-text-soft);
}

.portal-header-actions {
    display: flex;
    align-items: center;
    gap: var(--s-3);
}

.filters-toggle-btn,
.filters-close-btn {
    position: relative;
    min-height: 36px;
    border-radius: var(--r-sm);
    border: 1px solid var(--portal-border-strong);
    background: var(--portal-surface);
    color: var(--portal-primary);
    padding: 0 14px;
    font-size: var(--fs-sm);
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.filters-toggle-btn:hover,
.filters-close-btn:hover {
    border-color: var(--portal-primary);
    background: var(--portal-primary-soft);
}

.filters-toggle-btn:focus-visible,
.filters-close-btn:focus-visible {
    outline: none;
    border-color: var(--portal-primary);
    box-shadow: var(--focus-ring);
}

/* Active-filter count badge on the mobile Filters toggle */
.filters-toggle-btn .filter-count {
    display: none;
    min-width: 18px;
    height: 18px;
    margin-left: 8px;
    padding: 0 5px;
    border-radius: var(--r-pill);
    background: var(--portal-primary);
    color: #fff;
    font-size: var(--fs-2xs);
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

.filters-toggle-btn.has-active-filters .filter-count {
    display: inline-block;
}

.filters-toggle-btn {
    display: none;
}

.portal-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s-2);
    min-width: 0;
}

.summary-card {
    display: grid;
    gap: 2px;
    align-content: center;
    min-height: 50px;
    padding: var(--s-2) 10px;
    border: 1px solid var(--portal-border);
    border-radius: var(--r-sm);
    background: var(--portal-surface);
    box-shadow: var(--portal-shadow-soft);
    min-width: 0;
}

.summary-label {
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.055em;
    text-transform: uppercase;
    color: var(--portal-text-muted);
    line-height: 1.2;
}

.summary-card strong {
    font-size: var(--fs-md);
    line-height: 1.05;
    font-weight: 700;
    color: var(--portal-primary);
}

.portal-layout {
    display: grid;
    grid-template-columns: 272px minmax(0, 1fr);
    gap: var(--s-5);
    align-items: start;
}

.portal-filters {
    position: sticky;
    top: var(--portal-filters-sticky-top);
    z-index: 20;
    display: grid;
    gap: var(--s-4);
    align-content: start;
    max-height: calc(100svh - var(--portal-filters-sticky-top) - var(--s-5));
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(23, 71, 134, 0.32) transparent;
    padding: var(--s-5);
    border: 1px solid var(--portal-border);
    border-radius: var(--r-lg);
    background: var(--portal-surface);
    box-shadow: var(--portal-shadow);
}

.portal-filters::-webkit-scrollbar {
    width: 8px;
}

.portal-filters::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(23, 71, 134, 0.28);
}

.portal-filters::-webkit-scrollbar-track {
    background: transparent;
}

.filters-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--portal-border);
}

.filters-eyebrow {
    margin: 0 0 var(--s-2);
    font-size: var(--fs-2xs);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--portal-text-muted);
}

.filters-panel-header h2 {
    margin: 0;
    font-size: var(--fs-md);
    color: var(--portal-primary);
}

.filters-close-btn {
    display: none;
}

.filter-block {
    display: grid;
    gap: var(--s-2);
}

.filter-label {
    margin: 0;
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--portal-primary);
}

.filter-helper {
    margin: 0;
    font-size: var(--fs-xs);
    line-height: 1.45;
    color: var(--portal-text-soft);
}

.search-input {
    width: 100%;
    min-height: 40px;
    padding: 0 12px;
    border-radius: var(--r-sm);
    border: 1px solid var(--portal-border);
    background: var(--portal-surface-soft);
    color: var(--portal-text);
    font-size: var(--fs-base);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.search-input:focus-visible {
    outline: none;
    border-color: var(--portal-accent);
    box-shadow: var(--focus-ring);
}

.sector-filter-list {
    display: grid;
    gap: var(--s-2);
    max-height: 368px;
    overflow-y: auto;
    padding-right: var(--s-1);
}

.sector-option {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    gap: var(--s-3);
    min-height: 40px;
    padding: var(--s-2) var(--s-3);
    border: 1px solid var(--portal-border);
    border-radius: var(--r-sm);
    background: var(--portal-surface-soft);
    cursor: pointer;
    transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.sector-option:hover {
    border-color: var(--portal-border-strong);
    background: var(--portal-primary-soft);
}

.sector-option:focus-within {
    border-color: var(--portal-accent);
    box-shadow: var(--focus-ring);
}

.sector-option input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--portal-primary);
}

.sector-option span {
    font-size: var(--fs-sm);
    color: var(--portal-text);
    line-height: 1.3;
}

.results-controls {
    display: grid;
    gap: var(--s-2);
}

.results-controls label {
    display: grid;
    gap: var(--s-1);
}

.results-controls label span {
    font-size: var(--fs-2xs);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--portal-text-muted);
}

.results-controls select {
    min-height: 44px;
    border-radius: var(--r-sm);
    border: 1px solid var(--portal-border);
    background: var(--portal-surface-soft);
    color: var(--portal-text);
    font-size: var(--fs-sm);
    padding: 0 10px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.results-controls select:focus-visible {
    outline: none;
    border-color: var(--portal-accent);
    box-shadow: var(--focus-ring);
}

.results-controls select:disabled {
    cursor: not-allowed;
    color: var(--portal-text-muted);
    background: #f2f6fb;
    border-color: #e0e8f2;
}

.clear-filters-btn {
    min-height: 44px;
    border-radius: var(--r-sm);
    border: 1px solid var(--portal-border-strong);
    background: var(--portal-surface-soft);
    color: var(--portal-primary);
    font-size: var(--fs-sm);
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.clear-filters-btn:hover {
    border-color: var(--portal-primary);
    background: var(--portal-primary-soft);
}

.clear-filters-btn:focus-visible {
    outline: none;
    border-color: var(--portal-primary);
    box-shadow: var(--focus-ring);
}

.portal-results {
    display: grid;
    gap: var(--s-3);
    min-width: 0;
}

.results-toolbar {
    position: sticky;
    top: var(--header-height, 0px);
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3) var(--s-4);
    min-height: 58px;
    padding: 10px var(--s-3);
    border: 1px solid var(--portal-border);
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 2px 10px rgba(23, 71, 134, 0.07), 0 1px 0 rgba(215, 225, 238, 1);
    backdrop-filter: blur(8px) saturate(1.08);
    -webkit-backdrop-filter: blur(8px) saturate(1.08);
}

.results-toolbar-copy {
    display: grid;
    gap: var(--s-1);
}

.results-section-label {
    margin: 0;
    font-size: var(--fs-2xs);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--portal-text-muted);
}

.results-meta {
    margin: 0;
    font-size: var(--fs-base);
    font-weight: 500;
    color: var(--portal-text-soft);
}

.results-table-wrap {
    border: 1px solid var(--portal-border);
    border-radius: var(--r-lg);
    background: var(--portal-surface);
    box-shadow: var(--portal-shadow);
    overflow: visible;
}

.results-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.results-table th,
.results-table td {
    padding: var(--s-3) 14px;
    border-bottom: 1px solid #e7edf5;
    text-align: left;
    vertical-align: middle;
    color: var(--portal-text);
    font-size: var(--fs-base);
}

.results-table th {
    position: sticky;
    top: calc(var(--header-height, 0px) + var(--portal-measured-results-toolbar-space) + var(--s-1));
    z-index: 12;
    background: #f4f8fc;
    font-size: var(--fs-2xs);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--portal-text-muted);
}

.results-table .indicator-row {
    transition: background-color 0.15s ease;
}

.results-table .indicator-row:hover td {
    background: var(--portal-surface-soft);
}

.results-table .indicator-row:focus-within td {
    background: transparent;
}

/* Keep add feedback on the button/dock instead of washing the full row. */
.results-table .indicator-row.just-added td {
    background: transparent;
}

/* ── Merged column widths (4-column layout) ─────────────────── */

.col-select,
.col-select-cell {
    width: 72px;
    text-align: center;
}

.col-view,
.col-view-cell {
    width: 72px;
    text-align: center;
}

.col-year,
.year-cell {
    width: 180px;
    font-size: var(--fs-sm);
    color: var(--portal-text-soft);
}

.year-cell-text {
    font-weight: 500;
}

/* ── Indicator cell (title only) ─────────────────────────────── */

.indicator-cell-title-only {
    min-width: 0;
}

.indicator-cell-name {
    font-size: var(--fs-base);
    line-height: 1.4;
    font-weight: 600;
    color: var(--portal-text);
}

.add-indicator-btn,
.details-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: var(--s-1) var(--s-3);
    border-radius: var(--r-sm);
    font-size: var(--fs-xs);
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.add-indicator-btn {
    border: 1px solid #b7c8df;
    background: var(--portal-surface);
    color: var(--portal-primary);
}

.add-indicator-btn:hover {
    border-color: var(--portal-primary);
    background: var(--portal-primary-soft);
}

.add-indicator-btn:focus-visible,
.details-toggle:focus-visible {
    outline: none;
    border-color: var(--portal-primary);
    box-shadow: var(--focus-ring);
}

.add-indicator-btn.is-selected {
    border-color: var(--portal-primary);
    background: var(--portal-primary);
    color: #ffffff;
}

.add-indicator-btn.is-selected::before {
    content: "\2713";
    margin-right: 6px;
    font-weight: 700;
}

.details-toggle {
    border: 1px solid var(--portal-border-strong);
    background: var(--portal-surface-soft);
    color: var(--portal-primary);
}

.details-toggle:hover {
    border-color: var(--portal-primary);
    background: var(--portal-primary-soft);
}

.details-row td {
    padding: 0;
    background: var(--portal-surface-soft);
}

.details-panel {
    display: grid;
    gap: var(--s-3);
    padding: var(--s-4);
}

.details-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--s-3);
}

.details-item {
    display: grid;
    gap: var(--s-1);
}

.details-item span {
    font-size: var(--fs-2xs);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--portal-text-muted);
}

.details-item p {
    margin: 0;
    font-size: var(--fs-sm);
    line-height: 1.5;
    color: var(--portal-text);
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
    min-width: 0;
    padding: var(--s-2) 0;
}

.pagination-summary {
    margin: 0;
    font-size: var(--fs-sm);
    color: var(--portal-text-soft);
}

.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--s-1);
}

.pagination-bar button {
    min-width: 40px;
    min-height: 40px;
    padding: 0 10px;
    border-radius: var(--r-sm);
    border: 1px solid var(--portal-border-strong);
    background: var(--portal-surface);
    color: var(--portal-primary);
    font-size: var(--fs-sm);
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.pagination-bar button.is-current {
    border-color: var(--portal-primary);
    background: var(--portal-primary);
    color: #fff;
}

.pagination-ellipsis {
    display: inline-grid;
    min-width: 28px;
    min-height: 40px;
    place-items: center;
    color: var(--portal-text-muted);
}

.pagination-top {
    border-bottom: 1px solid var(--portal-border);
}

.pagination-bottom {
    border-top: 1px solid var(--portal-border);
}

.search-discovery {
    position: relative;
    flex: 1 1 460px;
    max-width: 680px;
}

.search-discovery .search-input {
    min-height: 44px;
    padding-right: 40px;
    background: var(--portal-surface);
}

.search-guidance {
    margin: 4px 2px 0;
    color: var(--portal-text-soft);
    font-size: var(--fs-2xs);
    line-height: 1.35;
}

.search-suggestions {
    position: absolute;
    top: calc(100% - 14px);
    left: 0;
    right: 0;
    z-index: 80;
    max-height: min(380px, 60vh);
    overflow-y: auto;
    padding: var(--s-1);
    border: 1px solid var(--portal-border-strong);
    border-radius: var(--r-md);
    background: var(--portal-surface);
    box-shadow: var(--shadow-3);
}

.search-suggestion,
.clear-recent-searches {
    width: 100%;
    min-height: 44px;
    border: 0;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--portal-text);
    text-align: left;
    cursor: pointer;
}

.search-suggestion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
    padding: var(--s-2) var(--s-3);
}

.search-suggestion > span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.search-suggestion small {
    flex: 0 0 auto;
    color: var(--portal-text-muted);
    font-size: var(--fs-2xs);
}

.search-suggestion:hover,
.search-suggestion.is-active,
.search-suggestion[aria-selected="true"] {
    background: var(--portal-primary-soft);
}

.search-suggestion:focus-visible,
.clear-recent-searches:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.clear-recent-searches {
    padding: var(--s-2) var(--s-3);
    border-top: 1px solid var(--portal-border);
    color: var(--portal-primary);
    font-size: var(--fs-xs);
    font-weight: 600;
}

.page-size-control {
    display: grid;
    flex: 0 0 auto;
    gap: var(--s-1);
    color: var(--portal-text-muted);
    font-size: var(--fs-2xs);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.page-size-control select {
    min-width: 86px;
    min-height: 40px;
    padding: 0 var(--s-2);
    border: 1px solid var(--portal-border-strong);
    border-radius: var(--r-sm);
    background: var(--portal-surface);
    color: var(--portal-text);
}

.page-size-control select:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.active-filter-chips {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--s-2);
}

.filter-chip,
.filter-chip-reset {
    min-height: 36px;
    padding: 0 var(--s-3);
    border-radius: var(--r-pill);
    border: 1px solid var(--portal-border-strong);
    background: var(--portal-primary-soft);
    color: var(--portal-primary);
    font-size: var(--fs-xs);
    font-weight: 600;
    cursor: pointer;
}

.filter-chip-reset {
    border-color: transparent;
    background: transparent;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.filter-chip:hover,
.filter-chip:focus-visible,
.filter-chip-reset:hover,
.filter-chip-reset:focus-visible {
    outline: none;
    border-color: var(--portal-primary);
    box-shadow: var(--focus-ring);
}

.search-highlight {
    padding: 0 2px;
    border-radius: 3px;
    background: #fff0ad;
    color: inherit;
}

.did-you-mean button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--portal-primary);
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

.empty-state-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
    margin-top: var(--s-2);
}

.empty-state-actions button {
    min-height: 40px;
    padding: 0 var(--s-3);
    border: 1px solid var(--portal-border-strong);
    border-radius: var(--r-sm);
    background: var(--portal-surface-soft);
    color: var(--portal-primary);
    font-weight: 600;
    cursor: pointer;
}

.related-indicators {
    display: grid;
    gap: var(--s-3);
    padding: var(--s-4);
    border: 1px solid var(--portal-border);
    border-radius: var(--r-md);
    background: var(--portal-surface-soft);
}

.related-indicators h3 {
    margin: 0;
    color: var(--portal-primary);
    font-size: var(--fs-base);
}

.related-indicators-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s-2);
}

.related-indicator-card {
    display: grid;
    gap: var(--s-1);
    min-height: 72px;
    padding: var(--s-3);
    border: 1px solid var(--portal-border);
    border-radius: var(--r-sm);
    background: var(--portal-surface);
    color: var(--portal-text);
    text-align: left;
    cursor: pointer;
}

.related-indicator-card span {
    color: var(--portal-text-soft);
    font-size: var(--fs-xs);
}

.related-indicator-card:hover,
.related-indicator-card:focus-visible {
    outline: none;
    border-color: var(--portal-primary);
    box-shadow: var(--focus-ring);
}

.pagination-bar button:hover:not(:disabled) {
    border-color: var(--portal-primary);
    background: var(--portal-primary-soft);
}

.pagination-bar button:focus-visible:not(:disabled) {
    outline: none;
    border-color: var(--portal-primary);
    box-shadow: var(--focus-ring);
}

.pagination-bar button:disabled {
    color: var(--portal-text-muted);
    background: var(--portal-surface-soft);
    border-color: var(--portal-border);
    cursor: not-allowed;
}

.empty-state {
    display: grid;
    gap: var(--s-2);
    padding: var(--s-8) var(--s-6);
    border: 1px dashed var(--portal-border-strong);
    border-radius: var(--r-lg);
    background: var(--portal-surface);
}

.empty-state h2,
.empty-state p {
    margin: 0;
}

.empty-state h2 {
    font-size: var(--fs-md);
    color: var(--portal-primary);
}

.empty-state p {
    font-size: var(--fs-base);
    line-height: 1.55;
    color: var(--portal-text-soft);
}

.indicator-explorer-view {
    min-width: 0;
}

.indicator-explorer-panel {
    display: grid;
    gap: var(--s-5);
    padding: var(--s-6);
    border: 1px solid var(--portal-border);
    border-radius: var(--r-lg);
    background: var(--portal-surface);
    box-shadow: var(--portal-shadow);
}

/* Provenance / source line at the top of the data explorer */
.indicator-explorer-provenance {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--s-2) var(--s-3);
    margin-top: var(--s-1);
    font-size: var(--fs-sm);
    color: var(--portal-text-soft);
}

.indicator-explorer-provenance .provenance-source {
    font-weight: 600;
    color: var(--portal-text);
}

.provenance-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: var(--r-pill);
    border: 1px solid var(--portal-border);
    background: var(--portal-surface-soft);
    color: var(--portal-text-soft);
    font-size: var(--fs-xs);
    font-weight: 600;
}

.indicator-explorer-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--s-5);
    padding-bottom: var(--s-4);
    border-bottom: 1px solid var(--portal-border);
}

.indicator-explorer-title {
    display: grid;
    gap: var(--s-2);
    min-width: 0;
}

.indicator-explorer-title h2 {
    margin: 0;
    color: var(--portal-primary);
    font-size: var(--fs-xl);
    line-height: 1.18;
}

.indicator-explorer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--s-3);
    flex-wrap: wrap;
}

.explorer-action-primary {
    background: var(--portal-primary);
    color: #ffffff;
}

.explorer-action-primary:hover,
.explorer-action-primary.is-selected {
    background: #0f3569;
}

.explorer-action-secondary {
    border-color: var(--portal-border-strong);
    background: var(--portal-surface-soft);
    color: var(--portal-primary);
}

.explorer-action-secondary:hover {
    background: var(--portal-primary-soft);
    border-color: var(--portal-primary);
}

.explorer-action-ghost {
    border-color: transparent;
    background: transparent;
    color: var(--portal-primary);
}

.explorer-action-ghost:hover {
    background: var(--portal-primary-soft);
}

.indicator-explorer-metadata {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--s-3);
}

.explorer-metadata-item {
    display: grid;
    gap: var(--s-1);
    min-width: 0;
    padding: var(--s-3) 14px;
    border: 1px solid var(--portal-border);
    border-radius: var(--r-md);
    background: var(--portal-surface-soft);
}

.explorer-metadata-item span {
    color: var(--portal-text-muted);
    font-size: var(--fs-2xs);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.explorer-metadata-item strong {
    overflow: hidden;
    color: var(--portal-text);
    font-size: var(--fs-base);
    font-weight: 600;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.indicator-explorer-tabs {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: var(--s-1);
    width: max-content;
    padding: var(--s-1);
    border: 1px solid var(--portal-border);
    border-radius: var(--r-md);
    background: var(--portal-surface-soft);
}

.explorer-tab {
    min-height: 36px;
    padding: 0 14px;
    border-radius: var(--r-sm);
    border: 1px solid transparent;
    background: transparent;
    color: var(--portal-text-soft);
    font-size: var(--fs-sm);
    font-weight: 700;
    cursor: pointer;
    transition: color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.explorer-tab:hover {
    color: var(--portal-primary);
    background: #ffffff;
}

.explorer-tab:focus-visible {
    outline: none;
    color: var(--portal-primary);
    box-shadow: var(--focus-ring);
}

.explorer-tab.is-active {
    border-color: var(--portal-border-strong);
    background: #ffffff;
    color: var(--portal-primary);
    box-shadow: var(--portal-shadow-soft);
}

.explorer-raw-panel {
    display: grid;
    gap: var(--s-5);
}

.explorer-aggregated-panel {
    min-width: 0;
}

.education-report {
    display: grid;
    gap: 24px;
    padding: 4px 0 2px;
}

.education-report-section {
    display: grid;
    gap: 0;
}

.education-report-section+.education-report-section {
    padding-top: 24px;
    border-top: 1px solid var(--portal-border);
}

.education-section-title {
    margin-bottom: 4px;
    color: var(--portal-text-soft);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.education-section-label {
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--portal-border);
    color: var(--portal-text);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.45;
}

.education-sub-label {
    margin: 1.2rem 0 8px;
    color: var(--portal-text-soft);
    font-size: 13px;
    font-weight: 700;
}

.education-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--portal-border);
    border-radius: 12px;
    background: #ffffff;
}

.education-table-wrap table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.education-table-wrap thead tr {
    background: #f3f7fc;
}

.education-table-wrap thead th {
    padding: 10px 14px;
    border-bottom: 1px solid var(--portal-border);
    color: var(--portal-text-soft);
    font-size: 12px;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
}

.education-table-wrap tbody tr {
    border-bottom: 1px solid #e8eef6;
}

.education-table-wrap tbody tr:last-child {
    border-bottom: 0;
}

.education-table-wrap tbody tr:hover {
    background: #f8fbff;
}

.education-table-wrap tbody td {
    padding: 9px 14px;
    color: var(--portal-text);
    white-space: nowrap;
}

.education-table-wrap .education-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.education-table-wrap .education-label {
    font-weight: 600;
}

.education-table-wrap .education-total-row {
    background: #eaf3fb;
}

.education-table-wrap .education-total-row td {
    color: var(--portal-primary);
    font-weight: 700;
}

/* Sectioned publication tables: banner rows separate disaggregations
   (Residence, Province, Wealth …); indented cells mark nested subgroups.
   The first descriptive column stays visible during horizontal scroll. */
.education-table-wrap tbody tr.education-section-row th {
    padding: 9px 14px;
    background: #eef2f8;
    border-top: 2px solid var(--portal-border);
    color: var(--portal-text);
    font-size: 12.5px;
    font-weight: 700;
    text-align: left;
    white-space: nowrap;
    position: sticky;
    left: 0;
}

.education-table-wrap .education-indent {
    padding-left: 30px;
}

.education-table-wrap table td:first-child,
.education-table-wrap table thead th:first-child {
    position: sticky;
    left: 0;
    background: #ffffff;
    z-index: 1;
}

.education-table-wrap table thead th:first-child {
    background: #f3f7fc;
}

.education-table-wrap .education-total-row td:first-child {
    background: #eaf3fb;
}

.education-table-wrap tbody tr:hover td:first-child {
    background: #f8fbff;
}

.report {
    display: grid;
    gap: 26px;
    padding: 4px 0 2px;
}

.report table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.report thead tr {
    background: #f3f7fc;
}

.report thead th {
    border-bottom: 1px solid var(--portal-border);
    color: var(--portal-text-soft);
    font-size: 12px;
    font-weight: 700;
    text-align: left;
    white-space: nowrap;
}

.report tbody tr {
    border-bottom: 1px solid #e8eef6;
}

.report tbody tr:last-child {
    border-bottom: 0;
}

.report tbody tr:hover {
    background: #f8fbff;
}

.poverty-report {
    display: grid;
    gap: 26px;
    padding: 4px 0 2px;
}

.poverty-section {
    display: grid;
    gap: 0;
}

.poverty-section+.poverty-section {
    padding-top: 24px;
    border-top: 1px solid var(--portal-border);
}

.poverty-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    color: var(--portal-primary);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.45;
}

.poverty-badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(23, 71, 134, 0.16);
    background: #eaf3fb;
    color: var(--portal-primary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.poverty-subtitle {
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--portal-border);
    color: var(--portal-text-soft);
    font-size: 13px;
    font-weight: 600;
}

.poverty-table-label {
    margin: 1.05rem 0 8px;
    color: var(--portal-text-soft);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.poverty-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--portal-border);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.poverty-table-wrap+.poverty-table-label {
    margin-top: 18px;
}

.poverty-table-wrap table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
}

.poverty-table-wrap thead tr {
    background: #f3f7fc;
}

.poverty-table-wrap thead th {
    padding: 10px 12px;
    border-bottom: 1px solid var(--portal-border);
    color: var(--portal-text-soft);
    font-size: 12px;
    font-weight: 700;
    text-align: left;
    white-space: nowrap;
}

.poverty-table-wrap tbody tr {
    border-bottom: 1px solid #e8eef6;
}

.poverty-table-wrap tbody tr:last-child {
    border-bottom: 0;
}

.poverty-table-wrap tbody tr:hover {
    background: #f8fbff;
}

.poverty-table-wrap tbody td {
    padding: 9px 12px;
    color: var(--portal-text);
    line-height: 1.35;
    vertical-align: top;
}

.poverty-table-wrap .poverty-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.poverty-table-wrap .poverty-label {
    color: var(--portal-text);
    font-weight: 600;
}

.poverty-table-wrap .poverty-highlight {
    background: #f8fbff;
}

.poverty-table-wrap .poverty-highlight td {
    color: var(--portal-primary);
}

.poverty-table-wrap .poverty-total-row {
    background: #eaf3fb;
}

.poverty-table-wrap .poverty-total-row td {
    color: var(--portal-primary);
    font-weight: 700;
}

.population-report {
    display: grid;
    gap: 26px;
    padding: 4px 0 2px;
}

.population-section {
    display: grid;
    gap: 0;
}

.population-section+.population-section {
    padding-top: 24px;
    border-top: 1px solid var(--portal-border);
}

.population-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    color: var(--portal-primary);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.45;
}

.population-badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(23, 71, 134, 0.16);
    background: #eaf3fb;
    color: var(--portal-primary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.population-subtitle {
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--portal-border);
    color: var(--portal-text-soft);
    font-size: 13px;
    font-weight: 600;
}

.population-table-label {
    margin: 1.05rem 0 8px;
    color: var(--portal-text-soft);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.population-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--portal-border);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.population-table-wrap+.population-table-label {
    margin-top: 18px;
}

.population-table-wrap table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
}

.population-table-wrap thead tr {
    background: #f3f7fc;
}

.population-table-wrap thead th {
    padding: 10px 12px;
    border-bottom: 1px solid var(--portal-border);
    color: var(--portal-text-soft);
    font-size: 12px;
    font-weight: 700;
    text-align: left;
    white-space: nowrap;
}

.population-table-wrap tbody tr {
    border-bottom: 1px solid #e8eef6;
}

.population-table-wrap tbody tr:last-child {
    border-bottom: 0;
}

.population-table-wrap tbody tr:hover {
    background: #f8fbff;
}

.population-table-wrap tbody td {
    padding: 9px 12px;
    color: var(--portal-text);
    line-height: 1.35;
    vertical-align: top;
}

.population-table-wrap .population-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.population-table-wrap .population-label {
    color: var(--portal-text);
    font-weight: 600;
}

.population-table-wrap .population-highlight {
    background: #f8fbff;
}

.population-table-wrap .population-highlight td {
    color: var(--portal-primary);
}

.population-table-wrap .population-total-row {
    background: #eaf3fb;
}

.population-table-wrap .population-total-row td {
    color: var(--portal-primary);
    font-weight: 700;
}

.infrastructure-report {
    display: grid;
    gap: 26px;
    padding: 4px 0 2px;
}

.infrastructure-section {
    display: grid;
    gap: 0;
}

.infrastructure-section+.infrastructure-section {
    padding-top: 24px;
    border-top: 1px solid var(--portal-border);
}

.infrastructure-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    color: var(--portal-primary);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.45;
}

.infrastructure-badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(23, 71, 134, 0.16);
    background: #eaf3fb;
    color: var(--portal-primary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.infrastructure-subtitle {
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--portal-border);
    color: var(--portal-text-soft);
    font-size: 13px;
    font-weight: 600;
}

.infrastructure-table-label {
    margin: 1.05rem 0 8px;
    color: var(--portal-text-soft);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.infrastructure-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--portal-border);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.infrastructure-table-wrap+.infrastructure-table-label {
    margin-top: 18px;
}

.infrastructure-table-wrap table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
}

.infrastructure-table-wrap thead tr {
    background: #f3f7fc;
}

.infrastructure-table-wrap thead th {
    padding: 10px 12px;
    border-bottom: 1px solid var(--portal-border);
    color: var(--portal-text-soft);
    font-size: 12px;
    font-weight: 700;
    text-align: left;
    white-space: nowrap;
}

.infrastructure-table-wrap tbody tr {
    border-bottom: 1px solid #e8eef6;
}

.infrastructure-table-wrap tbody tr:last-child {
    border-bottom: 0;
}

.infrastructure-table-wrap tbody tr:hover {
    background: #f8fbff;
}

.infrastructure-table-wrap tbody td {
    padding: 9px 12px;
    color: var(--portal-text);
    line-height: 1.35;
    vertical-align: top;
}

.infrastructure-table-wrap .infrastructure-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.infrastructure-table-wrap .infrastructure-label {
    color: var(--portal-text);
    font-weight: 600;
}

.infrastructure-table-wrap .infrastructure-highlight {
    background: #f8fbff;
}

.infrastructure-table-wrap .infrastructure-highlight td {
    color: var(--portal-primary);
}

.infrastructure-table-wrap .infrastructure-total-row {
    background: #eaf3fb;
}

.infrastructure-table-wrap .infrastructure-total-row td {
    color: var(--portal-primary);
    font-weight: 700;
}

.infrastructure-status-good {
    color: #176c52;
    font-weight: 700;
}

.infrastructure-status-muted {
    color: var(--portal-text-soft);
    font-weight: 600;
}

.indicator-explorer-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: var(--s-4);
    flex-wrap: wrap;
}

.explorer-search-label {
    display: grid;
    gap: var(--s-2);
    min-width: min(100%, 320px);
}

.explorer-search-label span {
    color: var(--portal-primary);
    font-size: var(--fs-sm);
    font-weight: 700;
}

.explorer-search-input {
    min-height: 42px;
}

.explorer-status {
    padding: var(--s-5);
    border: 1px dashed var(--portal-border-strong);
    border-radius: var(--r-md);
    background: var(--portal-surface-soft);
    color: var(--portal-text-soft);
    font-size: var(--fs-base);
    font-weight: 600;
    text-align: center;
}

.explorer-table-wrap {
    max-height: min(58vh, 620px);
    overflow: auto;
    border: 1px solid var(--portal-border);
    border-radius: var(--r-md);
    background: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.explorer-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

/* Compact density for data tables */
.explorer-table th,
.explorer-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e8eef6;
    text-align: left;
    vertical-align: top;
    color: var(--portal-text);
    font-size: 13px;
    line-height: 1.4;
}

.explorer-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f2f7fc;
    color: var(--portal-primary);
    font-size: var(--fs-2xs);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.explorer-table thead th[data-column-role="value"] {
    color: #0f3569;
}

/* Zebra striping for readability */
.explorer-table tbody tr:nth-child(even) td {
    background: #f8fafd;
}

.explorer-table tbody tr:nth-child(even) th {
    background: #f8fafd;
}

.explorer-table tbody tr:hover td {
    background: var(--portal-surface-soft);
}

.explorer-table tbody tr:hover th {
    background: var(--portal-surface-soft);
}

/* Value column emphasis */
.explorer-table .numeric-column {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.explorer-table .value-column {
    color: #123f78;
    font-weight: 700;
}

.explorer-table .value-column-head {
    background: #eaf0f9;
}

.explorer-table .row-header-column {
    color: var(--portal-text);
    font-weight: 700;
}

/* Dimension column truncation */
.explorer-table td.dimension-column {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.explorer-table th.dimension-column {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.explorer-empty-state {
    margin: 0;
}

.explorer-pagination {
    margin-top: 0;
}

.selection-bar {
    --selection-dock-x: 0;
    position: fixed;
    right: var(--s-5);
    bottom: var(--s-5);
    z-index: 70;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--s-2);
    width: max-content;
    min-width: 286px;
    max-width: min(360px, calc(100vw - var(--s-8)));
    padding: 7px;
    padding-left: 12px;
    border-radius: var(--r-pill);
    border: 1px solid rgba(23, 71, 134, 0.18);
    background: rgba(255, 255, 255, 0.96);
    color: var(--portal-text);
    box-shadow: 0 18px 44px rgba(17, 49, 94, 0.22), 0 1px 0 rgba(255, 255, 255, 0.86) inset;
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    transform: translateX(var(--selection-dock-x));
}

.selection-bar:not([hidden]) {
    animation: selection-dock-in 0.18s ease-out;
}

.selection-copy {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    min-width: max-content;
}

.selection-count {
    margin: 0;
    color: var(--portal-primary);
    font-size: var(--fs-sm);
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.selection-preview {
    display: none;
}

.selection-chip {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-size: var(--fs-xs);
    font-weight: 500;
}

.selection-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.selection-bar .action-btn {
    min-height: 36px;
    padding: 0 14px;
    border-radius: var(--r-pill);
    font-size: var(--fs-sm);
    line-height: 1;
}

.action-btn {
    min-height: 38px;
    padding: 0 var(--s-4);
    border-radius: var(--r-sm);
    border: 1px solid transparent;
    font-size: var(--fs-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Visible focus ring on the dark selection bar */
.action-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.65);
}

.action-btn-secondary {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.32);
    color: #ffffff;
}

.action-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.55);
}

.action-btn-primary {
    background: #ffffff;
    color: var(--portal-primary);
}

.action-btn-primary:hover {
    background: #eaf3fb;
}

.selection-bar .action-btn-secondary {
    border-color: rgba(23, 71, 134, 0.22);
    background: var(--portal-surface-soft);
    color: var(--portal-primary);
}

.selection-bar .action-btn-secondary:hover {
    border-color: rgba(23, 71, 134, 0.36);
    background: var(--portal-primary-soft);
}

.selection-bar .action-btn-primary {
    border-color: var(--portal-primary);
    background: var(--portal-primary);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(23, 71, 134, 0.22);
}

.selection-bar .action-btn-primary:hover {
    background: #0f3569;
}

@keyframes selection-dock-in {
    from {
        opacity: 0;
        transform: translateX(var(--selection-dock-x)) translateY(8px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateX(var(--selection-dock-x)) translateY(0) scale(1);
    }
}

.action-link {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.action-link.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

/* Toast: confirmation when an indicator is added to the selection */
.portal-toast-region {
    position: fixed;
    right: var(--s-5);
    bottom: calc(var(--s-5) + 58px);
    z-index: 1100;
    display: grid;
    gap: var(--s-2);
    justify-items: end;
    pointer-events: none;
}

.portal-toast {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    max-width: min(360px, calc(100vw - var(--s-8)));
    padding: 9px 14px;
    border-radius: var(--r-pill);
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(15, 53, 105, 0.96);
    color: #ffffff;
    font-size: var(--fs-sm);
    font-weight: 600;
    line-height: 1.25;
    box-shadow: 0 14px 34px rgba(17, 49, 94, 0.24);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.portal-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.portal-toast::before {
    content: "\2713";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    color: var(--portal-success);
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 700;
}

@media (max-width: 760px) {
    .portal-toast-region {
        left: 50%;
        right: auto;
        bottom: calc(var(--s-3) + 58px + env(safe-area-inset-bottom, 0px));
        justify-items: center;
        transform: translateX(-50%);
    }

    .portal-toast {
        max-width: calc(100vw - var(--s-6));
        white-space: nowrap;
    }
}

@media (max-width: 420px) {
    .portal-toast {
        max-width: calc(100vw - var(--s-4));
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Skeleton loading rows */
.skeleton-row td {
    padding: var(--s-3) 14px;
    border-bottom: 1px solid #e7edf5;
}

.skeleton-bar {
    height: 12px;
    border-radius: var(--r-pill);
    background: linear-gradient(90deg, #e9eef5 25%, #f3f6fa 37%, #e9eef5 63%);
    background-size: 400% 100%;
    animation: skeleton-shimmer 1.4s ease infinite;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0 50%;
    }
}

/* Inline error panel with retry */
.portal-error {
    display: grid;
    gap: var(--s-3);
    justify-items: start;
    padding: var(--s-6);
    border: 1px solid var(--portal-danger-bg);
    border-left: 4px solid var(--portal-danger);
    border-radius: var(--r-lg);
    background: var(--portal-danger-bg);
    color: var(--portal-text);
}

.portal-error h2 {
    margin: 0;
    font-size: var(--fs-md);
    color: var(--portal-danger);
}

.portal-error p {
    margin: 0;
    font-size: var(--fs-base);
    color: var(--portal-text-soft);
}

.portal-error button {
    min-height: 38px;
    padding: 0 var(--s-4);
    border-radius: var(--r-sm);
    border: 1px solid var(--portal-primary);
    background: var(--portal-primary);
    color: #fff;
    font-size: var(--fs-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.18s ease, box-shadow 0.18s ease;
}

.portal-error button:hover {
    background: #0f3569;
}

.portal-error button:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

@media (prefers-reduced-motion: reduce) {
    .skeleton-bar {
        animation: none;
    }

    .portal-header {
        transition: none;
    }

    .portal-toast {
        transition: none;
    }

    .selection-bar:not([hidden]) {
        animation: none;
    }
}

@media (min-width: 1320px) {
    /* Header is now a clean non-card block; no grid split needed. */
    .portal-summary {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1180px) {
    .indicators-portal {
        --portal-measured-header-space: 72px;
    }

    .portal-description {
        max-width: 640px;
    }
}

@media (max-width: 980px) {
    .indicators-portal {
        --portal-measured-header-space: 48px;
        padding: var(--s-2) var(--s-4) var(--s-6);
    }

    .portal-header {
        display: block;
        padding: 2px 0 4px;
    }

    .portal-layout {
        grid-template-columns: 1fr;
    }

    .portal-filters {
        position: static;
        display: none;
        max-height: none;
        overflow: visible;
    }

    .portal-filters.is-open {
        display: grid;
    }

    .results-toolbar {
        flex-wrap: wrap;
    }

    .results-toolbar-copy {
        flex: 1 1 180px;
    }

    .search-discovery {
        order: 3;
        flex-basis: 100%;
        max-width: none;
    }

    .filters-toggle-btn,
    .filters-close-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 760px) {
    .portal-header {
        position: static;
        margin: 0;
        padding: 2px 0 4px;
        border: none;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        display: block;
    }

    .portal-header-main {
        flex-direction: row;
        align-items: center;
        gap: var(--s-2);
        flex-wrap: wrap;
    }

    .portal-eyebrow {
        display: inline-flex;
    }

    .portal-description {
        display: block;
        font-size: var(--fs-sm);
    }

    .portal-summary {
        display: none;
    }

    .portal-header h1 {
        font-size: clamp(1.05rem, 4.2vw, 1.22rem);
    }

    .portal-header-actions {
        width: auto;
        margin-left: auto;
    }

    .filters-toggle-btn {
        width: auto;
    }

    .results-toolbar {
        top: var(--header-height, 0px);
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        min-height: 0;
        padding: var(--s-2);
        gap: var(--s-2);
        border-radius: var(--r-md);
    }

    .search-discovery {
        grid-column: 1 / -1;
        order: initial;
    }

    .search-guidance {
        display: none;
    }

    .pagination-bar[data-pagination] {
        align-items: stretch;
        flex-direction: column;
    }

    .pagination-summary {
        text-align: center;
    }

    .pagination-controls {
        justify-content: center;
        overflow-x: auto;
        padding: 2px;
    }

    .pagination-controls button {
        min-width: 38px;
        min-height: 42px;
    }

    .active-filter-chips {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 2px 2px var(--s-1);
    }

    .filter-chip,
    .filter-chip-reset {
        flex: 0 0 auto;
    }

    .related-indicators-list {
        grid-template-columns: 1fr;
    }

    .details-grid {
        grid-template-columns: 1fr;
    }

    .indicator-explorer-panel {
        padding: var(--s-4);
    }

    .indicator-explorer-head,
    .indicator-explorer-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .indicator-explorer-actions {
        justify-content: stretch;
    }

    .indicator-explorer-tabs {
        width: 100%;
    }

    .explorer-tab {
        flex: 1 1 0;
    }

    .indicator-explorer-actions .action-btn {
        flex: 1 1 100%;
    }

    .selection-bar {
        --selection-dock-x: -50%;
        left: 50%;
        right: auto;
        bottom: calc(var(--s-3) + env(safe-area-inset-bottom, 0px));
        width: min(286px, calc(100vw - var(--s-6)));
        min-width: 0;
        max-width: calc(100vw - var(--s-6));
        flex-direction: row;
        align-items: center;
        padding: 6px;
        padding-left: 10px;
    }

    .selection-copy,
    .selection-actions {
        width: auto;
        flex-wrap: nowrap;
    }

    .selection-actions .action-btn,
    .selection-actions .action-link {
        flex: 0 0 auto;
    }
}

@media (max-width: 520px) {
    .indicators-portal {
        padding: var(--s-4) var(--s-3) 120px;
    }

    .results-toolbar-copy .results-section-label {
        display: none;
    }

    .results-meta {
        font-size: var(--fs-xs);
    }

    .page-size-control span {
        max-width: 82px;
        line-height: 1.2;
    }

    .col-year,
    .year-cell {
        width: 112px;
    }

    .results-table th,
    .results-table td {
        padding: 10px 8px;
        font-size: var(--fs-xs);
    }

    .add-indicator-btn,
    .details-toggle {
        min-height: 38px;
        padding: var(--s-1) var(--s-2);
    }

    .selection-actions .action-btn,
    .selection-actions .action-link {
        flex: 0 0 auto;
        min-height: 34px;
        padding: 0 12px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .search-input,
    .sector-option,
    .add-indicator-btn,
    .details-toggle,
    .clear-filters-btn,
    .filters-toggle-btn,
    .filters-close-btn {
        transition: none;
    }
}
