[data-theme="dark"] {
    --primary-color: #0972d8;
    --secondary-color: #E0A854;
    --accent-color: #7B93F7;
    --light-color: #1A1A1A;
    --dark-color: #E8E8E8;
    --text-color: #D0D0D0;
    --background-color: #121212;
    --header-gradient: linear-gradient(180deg, #121212 0%, #121212 100%);
    --link-color: var(--primary-color);
}

.theme-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 200;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--text-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.theme-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border-color: rgba(0, 0, 0, 0.2);
}

.theme-toggle__icon {
    width: 18px;
    height: 18px;
}

.theme-toggle__icon--sun {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: none;
}

.theme-toggle__icon--moon {
    fill: currentColor;
    display: block;
}

[data-theme="dark"] .theme-toggle {
    border-color: rgba(255, 255, 255, 0.18);
    background-color: rgba(18, 18, 18, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] .theme-toggle:hover {
    border-color: rgba(255, 255, 255, 0.28);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.34);
}

[data-theme="dark"] .theme-toggle__icon--sun { display: block;
}

[data-theme="dark"] .theme-toggle__icon--moon { display: none;
}

[data-theme="dark"] .author-link sup,
[data-theme="dark"] .author-mark,
[data-theme="dark"] .equal-contribution {
    color: #9CA3AF;
}

[data-theme="dark"] .paper-btn {
    color: #FFFFFF !important;
}

[data-theme="dark"] .paper-btn:hover {
    background-color: #2A8A74;
}

[data-theme="dark"] .section-label,
[data-theme="dark"] .section-caption,
[data-theme="dark"] .paper-invite,
[data-theme="dark"] .site-footer,
[data-theme="dark"] .back-to-top,
[data-theme="dark"] .section-nav-link,
[data-theme="dark"] .copy-citation-btn,
[data-theme="dark"] .arch-card__toggle {
    color: #9CA3AF;
}

[data-theme="dark"] .section-caption strong {
    color: #CBD5E1;
}

[data-theme="dark"] .tldr-keyword .keyword-tooltip {
    color: #D0D0D0;
    background: #1F1F1F;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .tldr-keyword .keyword-tooltip::after {
    border-top-color: #1F1F1F;
}

[data-theme="dark"] .section-divider::before {
    background-color: rgba(255, 255, 255, 0.14);
}

[data-theme="dark"] .section-divider::after {
    border-color: rgba(255, 255, 255, 0.14);
}

[data-theme="dark"] .section-nav {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .section-nav-sep {
    color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .citation-block {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .copy-citation-btn {
    border-color: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .copy-citation-btn:hover {
    background-color: rgba(61, 191, 160, 0.08);
}

[data-theme="dark"] .copy-citation-btn.copied {
    background-color: rgba(61, 191, 160, 0.12);
}

[data-theme="dark"] .callout--blue { background: rgba(96, 165, 250, 0.10); border-left-color: #60a5fa;
}

[data-theme="dark"] .callout--blue strong { color: #60a5fa;
}

[data-theme="dark"] .callout--green { background: rgba(52, 211, 153, 0.10); border-left-color: #34d399;
}

[data-theme="dark"] .callout--green strong { color: #34d399;
}

[data-theme="dark"] .callout--orange { background: rgba(251, 191, 36, 0.10); border-left-color: #fbbf24;
}

[data-theme="dark"] .callout--orange strong { color: #fbbf24;
}

[data-theme="dark"] .callout--violet { background: rgba(167, 139, 250, 0.10); border-left-color: #a78bfa;
}

[data-theme="dark"] .callout--violet strong { color: #a78bfa;
}

[data-theme="dark"] .arch-card {
    border-color: rgba(123, 147, 247, 0.22);
    background: rgba(123, 147, 247, 0.05);
}

[data-theme="dark"] .arch-card:hover {
    border-color: rgba(123, 147, 247, 0.35);
}

[data-theme="dark"] .arch-card[open] {
    border-color: rgba(123, 147, 247, 0.35);
    box-shadow: 0 2px 12px rgba(123, 147, 247, 0.16);
}

[data-theme="dark"] .arch-card__header:hover {
    background-color: rgba(123, 147, 247, 0.1);
}

[data-theme="dark"] .arch-card__step {
    background: rgba(123, 147, 247, 0.2);
}

[data-theme="dark"] .tldr-box {
    background-color: rgba(61, 191, 160, 0.08);
    border-color: rgba(61, 191, 160, 0.18);
}

[data-theme="dark"] .institution-logo {
    filter: brightness(1.8) saturate(0.9);
    opacity: 0.9;
}

[data-theme="dark"] .section-figure--framed img {
    border-color: rgba(255, 255, 255, 0.2);
}

@media (max-width: 768px) {
    body { font-size: 1rem; }

    .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .header-section {
        padding: 60px 0 40px 0;
    }


    .paper-title {
        font-size: 2.4rem;
    }

    .paper-subtitle {
        font-size: 2.4rem;
        margin-bottom: 20px;
    }

    .author-line {
        font-size: 0.92rem;
        gap: 4px 8px;
    }

    .institution-logo {
        width: auto;
    }

    .institution-logo img {
        height: 1.75rem;
    }

    .institution-logo img.logo-oxford {
        height: 2.85rem;
    }

    .paper-btn {
        padding: 12px 24px;
        font-size: 0.95rem;
    }

    .section-title {
        font-size: 2.2rem;
        margin: 36px 0 24px 0;
    }

    .subsection-title {
        font-size: 2rem;
        margin: 28px 0 20px 0;
    }

    .body-text {
        font-size: 1rem;
    }

    .section-figure {
        min-height: 120px;
    }

    .section-figure img {
        max-height: 280px;
    }

    .section-figure--tall img {
        max-height: 440px;
    }

    .callout {
        padding: 14px 18px;
    }

    .arch-card__header {
        padding: 14px 18px;
        gap: 10px;
    }

    .arch-card__title {
        font-size: 1.02rem;
    }

    .arch-card__body {
        padding: 4px 18px 22px 18px;
    }

    .tldr-headline {
        font-size: 1.25rem;
    }

    .tldr-abstract {
        font-size: 1.05rem;
    }

    .tldr-nav {
        font-size: 1rem;
    }

    .tldr-keyword .keyword-tooltip {
        width: 260px;
        font-size: 0.85rem;
        padding: 12px 14px;
    }

    .nav-mobile-header {
        display: flex;
    }

    .section-nav-inner {
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0 0 8px 0;
        border-top: 1px solid rgba(0, 0, 0, 0.06);
    }

    .section-nav.menu-open .section-nav-inner {
        display: flex;
    }

    .section-nav-link {
        font-size: 0.92rem;
        padding: 10px 16px 10px 20px;
        margin-bottom: 0;
        text-align: left;
    }

    .section-nav-link::after {
        display: none;
    }

    .section-nav-link.active {
        background-color: rgba(0, 0, 0, 0.03);
        border-left: 2.5px solid;
    }

    .nav-color-gold.active { border-left-color: #377be4; }
    .nav-color-teal.active { border-left-color: #059669; }
    .nav-color-blue.active { border-left-color: #d97706; }
    .nav-color-violet.active { border-left-color: #7c3aed; }

    .section-nav-sep {
        display: none;
    }

    .citation-block {
        padding: 18px 16px;
    }

    .citation-block pre {
        font-size: 0.78rem;
    }

    .copy-citation-btn {
        position: relative;
        top: auto;
        right: auto;
        margin-bottom: 12px;
    }

    .theme-toggle {
        top: 10px;
        right: 10px;
        width: 34px;
        height: 34px;
    }

    .theme-toggle__icon {
        width: 16px;
        height: 16px;
    }

    [data-theme="dark"] .section-nav-link.active {
        background-color: rgba(255, 255, 255, 0.05);
    }
}

[data-theme="dark"] .contents-card small {
    border-top-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .contents-card--gold { border-top-color: #60a5fa;
}

[data-theme="dark"] .contents-card--teal { border-top-color: #34d399;
}

[data-theme="dark"] .contents-card--blue { border-top-color: #fbbf24;
}

[data-theme="dark"] .contents-card--violet { border-top-color: #a78bfa;
}

[data-theme="dark"] .contents-card--neutral { border-top-color: var(--dark-color);
}

[data-theme="dark"] .contents-card {
    background: rgba(255, 255, 255, 0.035);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .contents-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.16);
}

[data-theme="dark"] .contents-card strong,
[data-theme="dark"] .contents-card:hover,
[data-theme="dark"] .contents-card {
    color: var(--text-color);
}

[data-theme="dark"] .section-figure--framed {
    background: rgba(255, 255, 255, 0.035);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .study-card--blue .study-card__step { color: #60a5fa; background: rgba(96, 165, 250, 0.12);
}

[data-theme="dark"] .study-card--green .study-card__step { color: #34d399; background: rgba(52, 211, 153, 0.12);
}

[data-theme="dark"] .study-card--orange .study-card__step { color: #fbbf24; background: rgba(251, 191, 36, 0.12);
}

[data-theme="dark"] .study-card--violet .study-card__step { color: #a78bfa; background: rgba(167, 139, 250, 0.12);
}

[data-theme="dark"] .study-card--blue { border-top-color: #60a5fa;
}

[data-theme="dark"] .study-card--green { border-top-color: #34d399;
}

[data-theme="dark"] .study-card--orange { border-top-color: #fbbf24;
}

[data-theme="dark"] .study-card--violet { border-top-color: #a78bfa;
}

[data-theme="dark"] .study-card {
    background: rgba(255, 255, 255, 0.035);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .study-card[open] {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .study-card__title {
    color: var(--text-color);
}

[data-theme="dark"] .faq-item {
    background: rgba(255, 255, 255, 0.035);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .recipe-card {
    border-color: rgba(167, 139, 250, 0.22);
    border-top-color: #a78bfa;
    background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .recipe-card h3,
[data-theme="dark"] .recipe-card p {
    color: var(--text-color);
}

[data-theme="dark"] .results-table tr.is-tinted {
    background: rgba(167, 139, 250, 0.16);
}

[data-theme="dark"] .results-table-wrap {
    --cover: #121212;
    border-color: rgba(148, 163, 184, 0.15);
    background:
        linear-gradient(to right, var(--cover), rgba(18, 18, 18, 0)) 0 0 / 28px 100% no-repeat local,
        linear-gradient(to left, var(--cover), rgba(18, 18, 18, 0)) 100% 0 / 28px 100% no-repeat local,
        radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, 0.4), transparent) 0 0 / 14px 100% no-repeat scroll,
        radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, 0.4), transparent) 100% 0 / 14px 100% no-repeat scroll;
}

[data-theme="dark"] .results-table th,
[data-theme="dark"] .results-table td {
    border-bottom-color: rgba(148, 163, 184, 0.12);
}

[data-theme="dark"] .results-table thead th {
    color: #c4b5fd;
    background: #211e29;
}

[data-theme="dark"] .results-table tbody tr:hover {
    background: rgba(167, 139, 250, 0.06);
}

[data-theme="dark"] .results-table tr.results-table__section td {
    background: rgba(167, 139, 250, 0.08);
    color: #a78bfa;
}

[data-theme="dark"] .results-table tr.is-optimal {
    background: rgba(167, 139, 250, 0.16);
}

