body.legacy-page.pool-page {
    --pool-navy: #17324a;
    --pool-rust: #9f4d31;
    --pool-gold: #b8893f;
    --pool-ink: #20201d;
    --pool-muted: #68665f;
    --pool-paper: #f5f2ea;
    --pool-card: #fffdf8;
    --pool-line: #d8d4ca;
    --pool-success: #236246;
    background:
        radial-gradient(circle at 8% 2%, rgba(159, 77, 49, 0.07), transparent 22rem),
        radial-gradient(circle at 94% 8%, rgba(23, 50, 74, 0.07), transparent 26rem),
        var(--pool-paper) !important;
}

body.legacy-page.pool-page [hidden] {
    display: none !important;
}

.pool-legacy-header,
.pool-legacy-footer {
    display: none !important;
}

.pool-skip-link {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 2000;
    padding: 0.65rem 0.85rem;
    color: #fff;
    border-radius: 8px;
    background: var(--pool-navy);
    transform: translateY(-160%);
}

.pool-skip-link:focus {
    transform: translateY(0);
}

body.legacy-page.pool-page .pool-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(216, 212, 202, 0.9);
    background: rgba(245, 242, 234, 0.94);
    box-shadow: none;
    backdrop-filter: blur(18px);
}

.pool-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(1120px, calc(100% - 2rem));
    min-height: 70px;
    margin-inline: auto;
    gap: 1.5rem;
}

.pool-brand {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 0.7rem;
    color: var(--pool-ink);
    text-decoration: none;
}

.pool-brand img {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    object-fit: contain;
    border: 1px solid var(--pool-line);
    border-radius: 11px;
    background: var(--pool-card);
}

.pool-brand__copy {
    display: grid;
    gap: 0.05rem;
    min-width: 0;
}

.pool-brand__name {
    color: var(--pool-ink);
    font-family: 'Newsreader', Georgia, serif;
    font-size: 1.08rem;
    font-weight: 600;
    line-height: 1.1;
    white-space: nowrap;
}

.pool-brand__name strong {
    color: var(--pool-rust);
    font-weight: 600;
}

.pool-brand__page {
    color: var(--pool-muted);
    font-size: 0.61rem;
    font-weight: 800;
    letter-spacing: 0.095em;
    text-transform: uppercase;
    white-space: nowrap;
}

body.legacy-page.pool-page .pool-nav {
    display: flex !important;
    align-items: center;
    justify-content: flex-end !important;
    width: auto !important;
    gap: 0.15rem !important;
    overflow-x: auto !important;
    padding: 0 !important;
    scrollbar-width: none;
}

.pool-nav::-webkit-scrollbar {
    display: none;
}

body.legacy-page.pool-page .pool-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0.5rem 0.68rem !important;
    color: var(--pool-muted) !important;
    border: 0 !important;
    border-radius: 8px !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 0.68rem !important;
    font-weight: 750 !important;
    text-decoration: none;
    white-space: nowrap;
}

body.legacy-page.pool-page .pool-nav a:hover,
body.legacy-page.pool-page .pool-nav a:focus-visible {
    color: var(--pool-ink) !important;
    background: rgba(32, 32, 29, 0.055) !important;
}

body.legacy-page.pool-page .pool-nav a[aria-current='page'] {
    color: #fff !important;
    background: var(--pool-navy) !important;
}

body.legacy-page.pool-page main.pool-shell {
    width: min(1120px, calc(100% - 2rem));
    max-width: none;
    min-height: calc(100vh - 152px);
    margin-inline: auto;
    padding: 2rem 0 4rem !important;
}

.pool-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 2rem;
    padding: 0.5rem 0 1.6rem;
}

.pool-eyebrow {
    margin: 0 0 0.35rem !important;
    color: var(--pool-rust) !important;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

body.legacy-page.pool-page .pool-hero h1 {
    margin: 0;
    color: var(--pool-ink) !important;
    font-family: 'Newsreader', Georgia, serif !important;
    font-size: clamp(2.45rem, 7vw, 4.8rem);
    font-weight: 500;
    letter-spacing: -0.055em !important;
    line-height: 0.92;
}

.pool-hero__copy > p:last-child {
    margin: 0.75rem 0 0 !important;
    color: var(--pool-muted) !important;
    font-size: 0.9rem;
}

.pool-data-state {
    min-width: 250px;
    padding: 1rem 1.15rem;
    border: 1px solid var(--pool-line);
    border-radius: 13px;
    background: rgba(255, 253, 248, 0.9);
}

.pool-data-state > div {
    display: block !important;
}

.pool-data-state__label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--pool-muted);
    font-size: 0.69rem;
    font-weight: 700;
}

.pool-status-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--pool-gold);
    box-shadow: 0 0 0 4px rgba(184, 137, 63, 0.13);
}

.pool-data-state[data-state='ready'] .pool-status-dot {
    background: var(--pool-success);
    box-shadow: 0 0 0 4px rgba(35, 98, 70, 0.12);
}

.pool-data-state[data-state='error'] .pool-status-dot {
    background: #a43d36;
    box-shadow: 0 0 0 4px rgba(164, 61, 54, 0.12);
}

.pool-data-state__count {
    display: flex !important;
    align-items: baseline;
    gap: 0.45rem;
    margin-top: 0.35rem;
}

.pool-data-state__count strong {
    color: var(--pool-navy);
    font-family: 'Newsreader', Georgia, serif;
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 1;
}

.pool-data-state__count span {
    color: var(--pool-muted);
    font-size: 0.7rem;
    font-weight: 700;
}

.pool-panel {
    margin-bottom: 1rem;
    padding: 1.35rem;
    border: 1px solid var(--pool-line);
    border-radius: 14px;
    background: rgba(255, 253, 248, 0.92);
    box-shadow: 0 8px 24px rgba(32, 32, 29, 0.045);
}

body.legacy-page.pool-page .pool-panel > h2 {
    margin: 0 0 1rem !important;
    color: var(--pool-ink) !important;
    font-family: 'Newsreader', Georgia, serif !important;
    font-size: 1.55rem;
    font-weight: 600;
    letter-spacing: -0.035em !important;
    line-height: 1;
}

.pool-panel > h2 > .gold-gradient {
    display: none;
}

.pool-filter-grid {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
    align-items: end;
    gap: 0.75rem;
}

.pool-field,
.pool-analysis-grid > div {
    display: grid !important;
    gap: 0.4rem;
    min-width: 0;
}

.pool-field > span,
.pool-analysis-grid label {
    margin: 0 !important;
    color: var(--pool-ink) !important;
    font-size: 0.72rem !important;
    font-weight: 800 !important;
}

body.legacy-page.pool-page .pool-field input,
body.legacy-page.pool-page .pool-analysis-grid input {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding: 0.72rem 0.8rem;
    color: var(--pool-ink) !important;
    border: 1px solid #bbb5a9 !important;
    border-radius: 9px !important;
    background: var(--pool-card) !important;
    font-size: 0.88rem;
}

.pool-analysis-grid p {
    margin: 0 !important;
    color: var(--pool-muted) !important;
    font-size: 0.68rem !important;
}

.pool-filter-actions,
.pool-analysis-actions {
    display: flex;
    gap: 0.55rem;
}

body.legacy-page.pool-page .pool-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0.7rem 1rem;
    border: 1px solid transparent !important;
    border-radius: 9px !important;
    box-shadow: none !important;
    font-size: 0.74rem;
    font-weight: 800 !important;
    line-height: 1;
    white-space: nowrap;
}

body.legacy-page.pool-page .pool-button--primary {
    color: #fff !important;
    background: var(--pool-navy) !important;
}

body.legacy-page.pool-page .pool-button--secondary {
    color: var(--pool-navy) !important;
    border-color: #b7c0c7 !important;
    background: #edf0f1 !important;
}

body.legacy-page.pool-page .pool-button--quiet {
    color: var(--pool-ink) !important;
    border-color: var(--pool-line) !important;
    background: #f0ede5 !important;
}

.pool-filter-grid #dateRangeStatus {
    grid-column: 1 / -1;
    margin: 0.15rem 0 0 !important;
    color: var(--pool-muted) !important;
    font-size: 0.7rem;
}

.pool-analysis-panel {
    margin-top: 1rem;
    padding: 1.6rem;
}

.pool-analysis-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.pool-analysis-actions {
    margin-top: 1.15rem;
}

body.legacy-page.pool-page #analysisResults,
body.legacy-page.pool-page #allSpreadsTable {
    margin-top: 1rem;
}

body.legacy-page.pool-page #analysisResults .analysis-card,
body.legacy-page.pool-page #allSpreadsTable .analysis-card {
    border: 1px solid var(--pool-line) !important;
    border-radius: 14px !important;
    background: var(--pool-card) !important;
    box-shadow: 0 8px 24px rgba(32, 32, 29, 0.045) !important;
}

body.legacy-page.pool-page .pool-result-title {
    margin-bottom: 1rem !important;
    font-size: 1.45rem !important;
}

.pool-result-title > .gold-gradient {
    display: none;
}

body.legacy-page.pool-page .pool-result-metrics {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 0.7rem !important;
    margin-bottom: 0.75rem !important;
}

body.legacy-page.pool-page .pool-result-card {
    padding: 1rem !important;
    border: 1px solid var(--pool-line) !important;
    border-radius: 10px !important;
    background: #f1eee6 !important;
}

body.legacy-page.pool-page .pool-result-card > div {
    color: var(--pool-navy) !important;
    font-family: 'Newsreader', Georgia, serif;
    font-size: 1.65rem !important;
}

body.legacy-page.pool-page .pool-result-card > p:nth-of-type(1) {
    color: var(--pool-ink) !important;
    font-size: 0.66rem !important;
    font-weight: 800 !important;
}

body.legacy-page.pool-page .pool-result-card > p:nth-of-type(2) {
    display: none;
}

body.legacy-page.pool-page .pool-result-summary {
    padding: 1rem !important;
    border: 1px solid var(--pool-line) !important;
    border-radius: 10px !important;
    background: #f1eee6 !important;
}

body.legacy-page.pool-page .pool-result-summary #analysisText {
    margin-bottom: 0.3rem !important;
    color: var(--pool-ink) !important;
    font-family: 'Newsreader', Georgia, serif;
    font-size: 1.25rem !important;
    font-weight: 600 !important;
}

body.legacy-page.pool-page .pool-result-summary #detailText {
    margin: 0 !important;
    color: var(--pool-muted) !important;
    font-size: 0.75rem !important;
}

.pool-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 82px;
    color: var(--pool-muted);
    border-top: 1px solid var(--pool-line);
    font-size: 0.68rem;
    font-weight: 700;
}

.pool-footer img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

@media (max-width: 820px) {
    .pool-header__inner {
        display: grid;
        width: min(100% - 1.25rem, 1120px);
        min-height: 0;
        padding: 0.55rem 0 0.35rem;
        gap: 0.35rem;
    }

    body.legacy-page.pool-page .pool-nav {
        width: 100% !important;
        justify-content: flex-start !important;
        margin-inline: -0.15rem;
        padding-bottom: 0.2rem !important;
    }

    body.legacy-page.pool-page .pool-nav a {
        min-height: 34px;
        padding: 0.42rem 0.58rem !important;
        font-size: 0.65rem !important;
    }

    body.legacy-page.pool-page main.pool-shell {
        width: min(100% - 1.25rem, 1120px);
        padding-top: 1.25rem !important;
    }

    .pool-hero {
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 1rem;
    }

    .pool-data-state {
        min-width: 0;
    }

    .pool-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pool-filter-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 520px) {
    .pool-header__inner,
    body.legacy-page.pool-page main.pool-shell {
        width: calc(100% - 1rem);
    }

    .pool-brand img {
        width: 38px;
        height: 38px;
        border-radius: 10px;
    }

    .pool-brand__name {
        font-size: 1rem;
    }

    .pool-brand__page {
        font-size: 0.56rem;
    }

    body.legacy-page.pool-page .pool-hero h1 {
        font-size: clamp(2.55rem, 14vw, 3.5rem);
    }

    .pool-hero__copy > p:last-child {
        font-size: 0.8rem;
    }

    .pool-data-state {
        padding: 0.85rem 0.9rem;
    }

    .pool-data-state > div {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 0.75rem;
    }

    .pool-data-state__count {
        display: flex !important;
        justify-content: flex-end;
        margin-top: 0;
    }

    .pool-data-state__count strong {
        font-size: 1.45rem;
    }

    .pool-data-state__count span {
        display: none;
    }

    .pool-panel,
    .pool-analysis-panel {
        padding: 1rem;
        border-radius: 12px;
    }

    .pool-filter-grid,
    .pool-analysis-grid {
        grid-template-columns: 1fr;
    }

    .pool-filter-actions {
        grid-column: auto;
    }

    .pool-filter-actions > *,
    .pool-analysis-actions > * {
        flex: 1 1 0;
        white-space: normal;
    }

    .pool-analysis-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    body.legacy-page.pool-page .pool-result-metrics {
        grid-template-columns: 1fr 1fr !important;
    }

    body.legacy-page.pool-page .pool-result-card--sample {
        grid-column: 1 / -1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pool-page * {
        scroll-behavior: auto !important;
    }
}
