﻿:root {
    --splash-bg: #ffffff;
    --splash-text: #1f2937;
    --splash-muted: #6b7280;
    --splash-border: #e5e7eb;
    --shadow: 0 20px 45px rgba(0,0,0,0.25);
    --radius: 12px;
}

/* Overlay */
.splash-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(2px);
    z-index: 9998;
}

/* Dialog */
.splash-dialog {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%); /* true center without stretching */
    width: min(850px, calc(100vw - 2rem));
    height: auto; /* size to content */
    max-height: 90vh; /* cap at viewport */
    background: var(--splash-bg);
    color: var(--splash-text);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* keep rounded corners */
    /* belt-and-suspenders in case a global rule sets min-height:100% */
    min-height: auto !important;
}

/* Header / Body / Footer (compact) */
.splash-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--splash-border);
}

    .splash-header h2 {
        margin: 0;
        font-size: 1.05rem;
        line-height: 1.2;
        font-weight: 600;
    }

.splash-body {
    padding: 12px 16px;
    overflow: auto; /* only body scrolls when tall */
}

.splash-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--splash-border);
    /* Force layout so checkbox + button render correctly */
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

/* Stats list */
.stats-list {
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr auto;
    row-gap: 8px;
    column-gap: 12px;
    font-size: 0.95rem;
}

    .stats-list .stat-row {
        display: contents;
    }

    .stats-list dt {
        margin: 0;
        font-weight: 500;
    }

    .stats-list dd {
        margin: 0;
        font-variant-numeric: tabular-nums;
        font-weight: 600;
        text-align: right;
    }

/* Checkbox label */
.noshow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--splash-muted);
    user-select: none;
    line-height: 1.2;
}

    .noshow input[type="checkbox"] {
        /* Neutralize frameworks that hide/resize checkboxes */
        appearance: checkbox;
        width: 16px;
        height: 16px;
        margin: 0;
    }

/* Button */
.btn-primary {
    display: inline-flex; /* prevent width:100% from globals */
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    background: #2563eb;
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
}

    .btn-primary:focus {
        outline: 2px solid #1d4ed8;
        outline-offset: 2px;
    }

/* Mobile */
@media (max-width: 540px) {
    .stats-list {
        grid-template-columns: 1fr;
    }

        .stats-list dd {
            text-align: left;
        }
}

/* Make sure hidden actually hides, even vs. !important globals */
#splash-dialog[hidden], #splash-overlay[hidden] {
    display: none !important;
}



.cards-row.cards-elevated {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-top: 12px;
}

.cards-elevated .stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    transition: transform .12s ease, box-shadow .12s ease;
    border: 1px solid rgba(0,0,0,0.04);
}

    .cards-elevated .stat-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 24px rgba(0,0,0,0.12);
    }

.cards-elevated .card-caption {
    margin: 0 0 8px;
    font-size: 0.86rem;
    color: var(--splash-muted);
    font-weight: 600;
}

.cards-elevated .card-value {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.1px;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 900px) {
    .cards-row.cards-elevated {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 520px) {
    .cards-row.cards-elevated {
        grid-template-columns: 1fr;
    }
}



/* Tabs */
.tabs {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tablist {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--splash-border);
    padding: 0 0 8px 0;
}

.tab-btn {
    appearance: none;
    border: 1px solid var(--splash-border);
    background: #fff;
    color: var(--splash-text);
    padding: 6px 10px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
}

    .tab-btn.is-active {
        background: #2563eb;
        color: #fff;
        border-color: #215bd7;
    }

    .tab-btn:focus {
        outline: 2px solid #1d4ed8;
        outline-offset: 2px;
    }

/* Panels */
.tabpanel {
    margin-top: 2px;
}

    .tabpanel[hidden] {
        display: none !important;
    }

/* Governance panel quick styles */
.gov-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gov-card {
    border: 1px solid var(--splash-border);
    border-radius: 10px;
    padding: 12px 14px;
    background: #fff;
}

    .gov-card h3 {
        margin: 0 0 6px;
        font-size: 0.95rem;
    }

    .gov-card .muted {
        color: var(--splash-muted);
        font-size: 0.85rem;
    }

    .gov-card .tight {
        margin: 0;
        padding-left: 16px;
    }
.gov-card--full {
    grid-column: 1 / -1;
}

@media (max-width: 720px) {
    .gov-grid {
        grid-template-columns: 1fr;
    }
}

.cards-row .stat-card {
    display: flex;
    flex-direction: column;
}

.cards-row .card-value {
    margin-top: auto;
}
/* Let “full” rows break out of the 2-column grid */
.stats-list .stat-row.stat-row--full {
    display: block; /* override display: contents */
    grid-column: 1 / -1; /* span both columns */
}

/* Note styling */
.stat-note {
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--splash-border);
    border-radius: 8px;
    background: #f9fafb;
    color: var(--splash-muted);
    font-size: 0.95rem;
    line-height: 1.35;
}

/* Optional: subtle “info” left stripe */
.stat-note {
    position: relative;
    padding-left: 14px;
}

    .stat-note::before {
        content: "";
        position: absolute;
        left: 0;
        top: 8px;
        bottom: 8px;
        width: 3px;
        background: #2563eb;
        border-radius: 2px;
    }

/* Visually hidden label for accessibility */
.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* Secondary (outline) button */
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    background: #fff;
    color: var(--splash-text);
    border: 1px solid var(--splash-border);
}

    .btn-secondary:hover {
        background: #f9fafb; /* subtle hover */
        border-color: #d1d5db; /* slightly darker border */
    }

    .btn-secondary:active {
        background: #f3f4f6;
        border-color: #cbd5e1;
    }

    .btn-secondary:focus {
        outline: 2px solid #1d4ed8; /* same focus as primary */
        outline-offset: 2px;
    }

    .btn-secondary:disabled,
    .btn-secondary[aria-disabled="true"] {
        opacity: 0.6;
        cursor: not-allowed;
    }
.btn-secondary--ghost {
    border: 0;
    background: transparent;
}

    .btn-secondary--ghost:hover {
        background: #f9fafb;
    }

    .btn-secondary--ghost:active {
        background: #f3f4f6;
    }


/* Optional: compact definition list layout inside glossary cards */
.gov-card .glossary {
    margin: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 10px;
    row-gap: 6px;
}

    .gov-card .glossary .stat-row {
        display: contents;
    }

    .gov-card .glossary dt {
        font-weight: 700;
    }

    .gov-card .glossary dd {
        margin: 0;
        color: var(--splash-text);
    }

    /* For very long lists (PFAS analytes), use three columns on wide screens */
    .gov-card .glossary.three-col {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

        .gov-card .glossary.three-col dt,
        .gov-card .glossary.three-col dd {
            grid-column: auto;
        }

@media (max-width: 900px) {
    .gov-card .glossary.three-col {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .gov-card .glossary.three-col {
        grid-template-columns: 1fr;
    }
}

/* One card per row for this panel */
.glossary-grid {
    grid-template-columns: 1fr;
}

/* Single-column list style inside each card */
.glossary-list {
    margin: 0;
    padding-left: 1rem; /* normal list indent */
    display: block;
    list-style: disc outside; /* simple bullets */
}

    .glossary-list li {
        margin: 6px 0;
        line-height: 1.35;
        word-break: normal;
        overflow-wrap: anywhere; /* avoid overflow on long chemical names */
    }

    .glossary-list .term {
        font-weight: 700;
        color: #0f172a;
        white-space: nowrap; /* keep short acronyms tight */
    }
