.nav-shell { column-gap: clamp(10px, 1.6vw, 24px); }
.site-brand-dark, .site-theme-toggle[hidden], .site-theme-sun { display: none; }

.site-theme-toggle {
    display: inline-grid;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    place-items: center;
    padding: 0;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--soft);
}
.site-theme-toggle:hover { background: var(--ice); }
.site-theme-toggle:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.site-theme-toggle svg { width: 20px; height: 20px; }

@media (min-width: 861px) and (max-width: 1080px) {
    .nav-shell .brand img { width: 144px; }
    .nav-shell .nav-account-label { max-width: 120px; }
}

html[data-therium-theme="dark"] {
    color-scheme: dark;
    --ink: #e7eff9;
    --muted: #aebfd2;
    --blue-dark: #8ab6ff;
    --ice: #172e47;
    --soft: #0f2036;
    --line: #2a415b;
    --danger: #ff9ca6;
    --shadow: 0 24px 70px rgba(0,0,0,.27);
    --portal-base: #0c1b30;
    --portal-surface: #14273f;
    --portal-link: #92bcff;
    --portal-input: #0d2036;
    --portal-accent-surface: #1c3756;
}

[data-therium-theme="dark"] body:not(.member-body) { background: var(--portal-base); }
[data-therium-theme="dark"] .site-brand-light,
[data-therium-theme="dark"] .site-theme-moon { display: none; }
[data-therium-theme="dark"] .site-brand-dark,
[data-therium-theme="dark"] .site-theme-sun { display: block; }
[data-therium-theme="dark"] .site-header { background: rgba(12,27,48,.95); }
[data-therium-theme="dark"] .site-header.is-scrolled { border-color: var(--line); }
[data-therium-theme="dark"] .nav-toggle span { background: var(--ink); }

[data-therium-theme="dark"] :is(.button-ghost, .button-soft, .nav-user, .nav-account-item, .main-nav a) { color: var(--ink); }
[data-therium-theme="dark"] .button-soft:hover { background: var(--ice); }
[data-therium-theme="dark"] :is(.text-link, .eyebrow:not(.eyebrow-light), .card-kicker, .perspective-card > a,
    .auth-switch a, .check-field a, .email-code-resend button, .email-code-back, .password-field button,
    .listing-category, .details-visual span, .security-items b) { color: var(--portal-link); }
[data-therium-theme="dark"] :is(.professional-card .card-kicker, .professional-card > a, .network-hero .eyebrow) { color: var(--mint); }

[data-therium-theme="dark"] :is(.nav-account-toggle, .nav-account-panel, .club-public-card, .club-reward-card, .auth-card,
    .visual-card, .visual-metrics div, .floating-note, .logo-ribbon, .state-card, .legal-shell,
    .listing-card, .empty-state, .details-info-grid > div, .purchase-card, .checkout-card, .checkout-summary, .exam-card, .exam-panel,
    .network-tabs, .network-search, .network-selection, .network-card, .network-empty, .marketplace-search > div) {
    background: var(--portal-surface);
    border-color: var(--line);
}
[data-therium-theme="dark"] :is(.state-page, .security-section, .cta-section, .legal-page,
    .marketplace-results, .details-page, .checkout-page, .exam-page) { background: var(--soft); }
[data-therium-theme="dark"] :is(.hero, .patient-card, .club-public-card-corporate) {
    background: linear-gradient(145deg, var(--portal-base), var(--ice));
}
[data-therium-theme="dark"] .security-seal {
    border-color: var(--line);
    background: radial-gradient(circle, var(--portal-surface) 0 48%, var(--ice) 49% 65%, var(--soft) 66%);
}
[data-therium-theme="dark"] .security-seal::before,
[data-therium-theme="dark"] .security-seal::after { border-color: var(--line); }
[data-therium-theme="dark"] :is(.club-feature-icon, .club-reward-placeholder, .club-reward-placeholder .club-feature-icon,
    .card-icon, .email-code-icon, .empty-state > span, .listing-visual, .details-visual,
    .listing-category, .details-visual span, .offer-symbol, .schedule-slots button:not(:hover):not(:disabled)) {
    background: var(--portal-accent-surface);
    color: var(--portal-link);
}
[data-therium-theme="dark"] .professional-card .card-icon { color: var(--mint); }
[data-therium-theme="dark"] :is(.hero-copy h2, .section-heading h2, .feature-copy h2, .security-copy h2,
    .club-reward-body .club-reward-value, .auth-card-heading h1, .auth-card-heading h2, .email-code-fieldset legend,
    .details-main h1, .purchase-price, .schedule-title, .reservation-timer strong, .network-price > strong,
    .network-member-note strong, .exam-heading h1, .exam-detail-grid h1, .access-code) { color: var(--ink); }
[data-therium-theme="dark"] :is(.hero-trust p, .ribbon-items, .care-greeting small, .visual-metrics small, .floating-note small,
    .patient-card .check-list li, .access-code-help, [data-access-code-contact] small,
    .auth-switch, .check-field, .email-code-auth-card .auth-card-heading strong, .legal-shell p,
    .listing-origin, .listing-footer small, .back-link, .purchase-account, .purchase-notes,
    .schedule-date-form > label, .schedule-slot-label, .appointment-request-form label, .appointment-location-review dd > span,
    .network-member-note p) { color: var(--muted); }
[data-therium-theme="dark"] :is(.field label, .access-code-channel legend, .access-code-choice) { color: var(--ink); }
[data-therium-theme="dark"] :is(.field input, .field select, .access-code-choice, .email-code-inputs input,
    .marketplace-search input, .schedule-date-form input, .appointment-request-form input, .appointment-request-form textarea) {
    color: var(--ink);
    border-color: var(--line);
    background: var(--portal-input);
}
[data-therium-theme="dark"] :is(.field input:focus, .access-code-choice:has(input:checked), .email-code-inputs input:focus) {
    border-color: var(--portal-link);
}
[data-therium-theme="dark"] .access-code-choice:has(input:checked) { background: var(--portal-accent-surface); }
[data-therium-theme="dark"] :is(.validation-summary, .expired-notice) { color: var(--danger); background: #462635; border-color: #78515e; }
[data-therium-theme="dark"] .email-code-auth-card :is(.field-error, .validation-summary) { color: var(--danger); }
[data-therium-theme="dark"] :is(.status-pill, .network-tag, .network-card-symbol, .network-member-note,
    .success-notice, .marketplace-success-message, .listing-delivery-badge, .details-info-grid > div > span) {
    color: #9be8d1;
    border-color: #295052;
    background: #143a40;
}
[data-therium-theme="dark"] :is(.neutral-notice, .reservation-timer, .access-code) {
    color: var(--ink);
    border-color: var(--line);
    background: var(--ice);
}
[data-therium-theme="dark"] .fake-result { color: #10233c; }

@media (max-width: 860px) {
    [data-therium-theme="dark"] :is(.main-nav, .nav-actions) { background: var(--portal-surface); }
}

html[data-therium-theme-transition]::view-transition-old(root),
html[data-therium-theme-transition]::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
}
html[data-therium-theme-transition]::view-transition-old(root) { z-index: 1; }
html[data-therium-theme-transition]::view-transition-new(root) {
    z-index: 2;
    animation: therium-theme-reveal .72s cubic-bezier(.22, 1, .36, 1) both;
}
html[data-therium-theme-transition="dark"]::view-transition-new(root) { --therium-reveal-start: inset(0 100% 0 0); }
html[data-therium-theme-transition="light"]::view-transition-new(root) { --therium-reveal-start: inset(0 0 0 100%); }

@keyframes therium-theme-reveal {
    from { clip-path: var(--therium-reveal-start); }
    to { clip-path: inset(0); }
}
