/* Shared day/night theme. Identity accents stay on their existing variables. */
.site-theme-toggle {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    gap: .45rem;
    margin-inline: .2rem;
    padding: .32rem .55rem .32rem .38rem;
    color: #40506d;
    background: #f5f7fb;
    border: 1px solid #dce4ef;
    border-radius: .72rem;
    font: inherit;
    font-size: .69rem;
    font-weight: 850;
    white-space: nowrap;
    cursor: pointer;
    transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}

.site-theme-toggle__track {
    position: relative;
    display: grid;
    width: 42px;
    height: 24px;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    direction: ltr;
    color: #768198;
    background: #e6ebf3;
    border-radius: 999px;
}

.site-theme-toggle__track i {
    position: relative;
    z-index: 1;
    font-size: .58rem;
    font-style: normal;
    text-align: center;
}

.site-theme-toggle__track b {
    position: absolute;
    z-index: 0;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(25, 39, 72, .2);
    transition: transform .2s ease, background-color .2s ease;
}

.site-theme-toggle:hover { color: #273c66; background: #fff; border-color: #c5d2e5; }
.site-theme-toggle:focus-visible { outline: 3px solid rgba(74, 159, 236, .25); outline-offset: 2px; }

html[data-theme="dark"] {
    color-scheme: dark;
    --theme-canvas: #0c1320;
    --theme-surface: #151f30;
    --theme-surface-raised: #1a2639;
    --theme-surface-soft: #202d42;
    --theme-border: #334159;
    --theme-text: #e8eef9;
    --theme-muted: #a8b4c7;
    --paper: var(--theme-surface);
    --ink: var(--theme-text);
    --muted: var(--theme-muted);
    --line: var(--theme-border);
    --navy: #e7edff;
    --navy-soft: #b9caff;
    --resource-ink: var(--theme-text);
    --resource-muted: var(--theme-muted);
    --resource-border: var(--theme-border);
    --resource-canvas: var(--theme-canvas);
    --schedule-ink: var(--theme-text);
    --schedule-muted: var(--theme-muted);
    --schedule-border: var(--theme-border);
    --schedule-surface: var(--theme-surface);
    --schedule-canvas: var(--theme-canvas);
    --mg-ink: var(--theme-text);
    --mg-muted: var(--theme-muted);
    --mg-border: var(--theme-border);
    --cap-ink: var(--theme-text);
    --cap-muted: var(--theme-muted);
    --cap-border: var(--theme-border);
    --av-navy: var(--theme-text);
    --av-muted: var(--theme-muted);
    --av-border: var(--theme-border);
}

html[data-theme="dark"] body {
    color: var(--theme-text);
    background: var(--theme-canvas);
}

html[data-theme="dark"] .site-header {
    background: rgba(16, 24, 38, .96);
    border-bottom-color: var(--theme-border);
    box-shadow: 0 8px 28px rgba(0, 0, 0, .16);
}

html[data-theme="dark"] .marketing-page .site-header { background: rgba(12, 19, 32, .52); border-bottom: 1px solid rgba(126, 151, 194, .16); backdrop-filter: blur(12px); }
html[data-theme="dark"] .site-header .nav-link { color: #e8eef9 !important; }
html[data-theme="dark"] .navbar-toggler { border-color: #46536a; background-color: #e8eef9; }
html[data-theme="dark"] .site-header .navbar-collapse { background: rgba(19, 29, 45, .98) !important; box-shadow: 0 18px 40px rgba(0, 0, 0, .32) !important; }

html[data-theme="dark"] .site-theme-toggle { color: #dce5f5; background: #1b2638; border-color: #3a4961; }
html[data-theme="dark"] .site-theme-toggle:hover { color: #fff; background: #223149; border-color: #52647f; }
html[data-theme="dark"] .site-theme-toggle__track { color: #aebbd0; background: #0e1726; }
html[data-theme="dark"] .site-theme-toggle__track b { background: #687ad8; transform: translateX(18px); }

html[data-theme="dark"] .site-language-picker { color: #e7edf8; background: linear-gradient(135deg, #19263a, #211f3a); border-color: #3a4862; box-shadow: none; }
html[data-theme="dark"] .site-language-trigger { color: #e7edf8; }
html[data-theme="dark"] .site-language-trigger__chevron { color: #a6b2c5; }
html[data-theme="dark"] .site-language-menu { background: rgba(20, 30, 47, .98); border-color: #3a4860; box-shadow: 0 22px 54px rgba(0, 0, 0, .42); }
html[data-theme="dark"] .site-language-menu button { color: #dce5f4; }
html[data-theme="dark"] .site-language-menu button:hover { background: #202e44; border-color: #3a4a65; }
html[data-theme="dark"] .site-language-menu button.is-selected { color: #fff; background: linear-gradient(135deg, #243654, #2b294d); border-color: #465979; }

html[data-theme="dark"] :is(.clinic-hero, .about-hero) { background: linear-gradient(135deg, #101a2a 10%, #121b2c 55%, #1d1930 100%); }
html[data-theme="dark"] :is(.clinic-intro, .clinic-feature, .about-story, .approach-section) { background: var(--theme-surface); }
html[data-theme="dark"] :is(.services-section, .values-section, .about-cta) { background: #101a2a; }
html[data-theme="dark"] :is(.clinic-hero__lead, .about-hero__content p, .section-heading p, .clinic-intro__copy p, .clinic-feature__content > p, .about-story__content p, .approach-section__content p, .about-cta p, .value-grid p) { color: var(--theme-muted); }
html[data-theme="dark"] :is(.clinic-hero h1, .about-hero h1, .clinic-intro h2, .section-heading h2, .clinic-feature h2, .about-story h2, .approach-section h2, .about-cta h2, .value-grid h3, .inline-link, .scroll-cue) { color: var(--theme-text); }
html[data-theme="dark"] .value-grid { background: #334159; }
html[data-theme="dark"] .value-grid article { background: var(--theme-surface); }
html[data-theme="dark"] .button--primary,
html[data-theme="dark"] .button--nav { background: linear-gradient(135deg, #315594, #347ed7); }
html[data-theme="dark"] .button--light { color: #172142; background: #f4f7fd; }
html[data-theme="dark"] .booking-banner { background: radial-gradient(circle at 20% 20%, #3654a5 0, transparent 32%), radial-gradient(circle at 80% 80%, #69469b 0, transparent 30%), #111936; }
/* Marketing service identities intentionally retain their assigned cyan/blue/lilac colors. */
html[data-theme="dark"] .service-card :is(.service-card__number, h3) { color: #101b50; }
html[data-theme="dark"] .service-card p { color: #354260; }
html[data-theme="dark"] .approach-list { background: linear-gradient(145deg, #18363c, #1b2f50 55%, #322742); }
html[data-theme="dark"] .approach-list strong { color: #edf2ff; }
html[data-theme="dark"] .approach-list span { color: #bdc8d9; }

html[data-theme="dark"] .app-main :is(.card, .accordion-item) { color: var(--theme-text); background-color: var(--theme-surface); border-color: var(--theme-border); }
html[data-theme="dark"] .app-main :is(.card-header, .card-footer, .accordion-button) { color: var(--theme-text); background-color: var(--theme-surface-raised); border-color: var(--theme-border); }
html[data-theme="dark"] .accordion-button::after { filter: invert(1) grayscale(1); }
html[data-theme="dark"] body :is(input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="color"]), select, textarea) {
    color: var(--theme-text) !important;
    background-color: #111a2a !important;
    border-color: #3a4961 !important;
}
html[data-theme="dark"] body :is(input, textarea)::placeholder { color: #7f8ca2; }
html[data-theme="dark"] body select option { color: var(--theme-text); background: #111a2a; }
html[data-theme="dark"] .form-text { color: var(--theme-muted); }
html[data-theme="dark"] .table { --bs-table-color: var(--theme-text); --bs-table-bg: transparent; --bs-table-border-color: var(--theme-border); --bs-table-striped-color: var(--theme-text); --bs-table-striped-bg: rgba(255, 255, 255, .025); --bs-table-hover-color: var(--theme-text); --bs-table-hover-bg: rgba(255, 255, 255, .04); }

/* Client, therapist, test, and shared resource pages. */
html[data-theme="dark"] .resource-hero { background: linear-gradient(135deg, #17243a, #211f38 58%, #152f30); box-shadow: 0 14px 36px rgba(0, 0, 0, .18); }
html[data-theme="dark"] .resource-hero--therapists { background: linear-gradient(135deg, #211d3a, #17253b 54%, #15302d); }
html[data-theme="dark"] .resource-eyebrow { color: #acb8ca; }
html[data-theme="dark"] .resource-count-pill { color: #c5d0e0; background: rgba(21, 31, 48, .78); border-color: #3a4961; }
html[data-theme="dark"] :is(.resource-panel, .resource-form-card, .resource-page--form > form, .resource-page--form > section.card, .resource-form-header) { color: var(--theme-text); background: var(--theme-surface); border-color: var(--theme-border) !important; box-shadow: 0 12px 32px rgba(0, 0, 0, .16); }
html[data-theme="dark"] :is(.resource-search, .resource-search:focus-within, .resource-back-link) { color: #bdc8d9; background: #111a2a; border-color: #36455d; }
html[data-theme="dark"] .resource-search input { color: var(--theme-text) !important; background: transparent !important; }
html[data-theme="dark"] .resource-search button { color: #b8c3d5; background: #202c40; border-color: #3a4960; }
html[data-theme="dark"] .resource-card { color: var(--theme-text); background: var(--theme-surface); border-color: var(--theme-border); box-shadow: 0 8px 24px rgba(0, 0, 0, .15); }
html[data-theme="dark"] .resource-card--client { background: linear-gradient(155deg, var(--theme-surface) 0%, var(--theme-surface) 74%, color-mix(in srgb, var(--resource-accent) 16%, var(--theme-surface)) 145%); }
html[data-theme="dark"] .resource-card--therapist.therapist-identity-card { background: linear-gradient(145deg, var(--theme-surface), color-mix(in srgb, var(--therapist-color) 15%, var(--theme-surface))); border-color: color-mix(in srgb, var(--therapist-color) 36%, var(--theme-border)); }
html[data-theme="dark"] .therapist-id-details dl { background: #172236; border-color: #41516b; box-shadow: 0 18px 35px rgba(0,0,0,.38); }
html[data-theme="dark"] .therapist-id-details dt { color: #9eacc2; }
html[data-theme="dark"] .therapist-id-details dd { color: #e2eaf7; }
html[data-theme="dark"] .therapist-prices__heading strong { color: #e0e8f6; }
html[data-theme="dark"] .therapist-prices__heading small { color: #a5b2c5; }
html[data-theme="dark"] .therapist-prices__service { background: color-mix(in srgb,var(--therapy-color) 13%,#151f30); border-color: color-mix(in srgb,var(--therapy-color) 37%,#334159); border-inline-start-color: var(--therapy-color); }
html[data-theme="dark"] .therapist-prices__service header strong { color: color-mix(in srgb,var(--therapy-color) 65%,#fff); }
html[data-theme="dark"] .therapist-prices__service :is(header small,p) { color: #a8b5c8; }
html[data-theme="dark"] :is(.therapist-prices__service header a, .capability-service__price-link) { color: #9dbdff; }
html[data-theme="dark"] .therapist-prices__languages > div { background: #111a2a; border-color: #334159; }
html[data-theme="dark"] .therapist-prices__languages span { color: #b9c6d8; }
html[data-theme="dark"] .therapist-prices__languages strong { color: #e8eef9; }
html[data-theme="dark"] .therapist-prices__languages small { color: #9eacc0; }
html[data-theme="dark"] :is(.resource-id, .resource-meta-grid div, .resource-card__tags span, .resource-capability-summary > div, .client-card__secondary, .resource-training) { color: #b8c4d7; background: #111a2a; border-color: #2f3c52; }
html[data-theme="dark"] :is(.resource-meta-grid strong, .client-card__secondary strong, .resource-training strong, .resource-capability-summary strong) { color: #dce5f4; }
html[data-theme="dark"] .resource-capability-summary em { color: #e8c58e; background: #332819; border-color: #665136; }
html[data-theme="dark"] .resource-capability-summary em.is-ready { color: #9ed9ca; background: #17302d; border-color: #315f57; }
html[data-theme="dark"] .resource-page--form .resource-section-heading { border-bottom-color: var(--theme-border); }
html[data-theme="dark"] .resource-section-heading > span { color: #8db4f0; background: #1c2b43; }
html[data-theme="dark"] .resource-primary-action--secondary { color: #bad0ef; background: #17243a; border-color: #3c506e; }
html[data-theme="dark"] .resource-action--capability { color: #c8bcff; background: #25213e; border-color: #4c426f; }
html[data-theme="dark"] .resource-action--danger { color: #f0a8b4; background: #351f28; border-color: #67404b; }

/* Calendar: neutral canvas changes; therapist, therapy, room and status accents are preserved. */
html[data-theme="dark"] :is(.schedule-toolbar, .schedule-filters, .calendar-card) { background: var(--theme-surface); border-color: var(--theme-border); box-shadow: 0 12px 32px rgba(0, 0, 0, .16); }
html[data-theme="dark"] :is(.view-switcher, .filter-search, .filter-panel__close, .calendar-key, .calendar-system-control, .calendar-empty, .booking-price-summary, .details-hint, .reservation-workflow) { color: var(--theme-muted); background: #111a2a; border-color: #334159; }
html[data-theme="dark"] .booking-price-breakdown > div { background: #172236; border-color: #35445b; }
html[data-theme="dark"] .booking-price-breakdown__total { background: #1d3150 !important; border-color: #5878a9 !important; }
html[data-theme="dark"] .booking-price-breakdown dt { color: #b9c8de; }
html[data-theme="dark"] .booking-price-breakdown dd { color: #e1ecfb; }
html[data-theme="dark"] .booking-price-breakdown small { color: #9eacc0; }
html[data-theme="dark"] .view-switcher button { color: #b8c4d6; }
html[data-theme="dark"] .view-switcher button.is-active { color: #fff; background: #24334a; border-color: #465773; }
html[data-theme="dark"] :is(.filter-option strong, .calendar-layers strong, .details-body dd, .reservation-workflow__heading h3) { color: #dce5f4; }
html[data-theme="dark"] :is(.booking-drawer, .new-client-drawer, .details-drawer, .parallel-drawer, .waiting-drawer) { color: var(--theme-text); background: var(--theme-surface); }
html[data-theme="dark"] :is(.month-day, .day-column, .day-heading, .calendar-corner, .calendar-timeline) { background-color: var(--theme-surface); border-color: var(--theme-border); }
html[data-theme="dark"] :is(.month-day.is-outside, .month-day.has-no-template, .day-column.has-no-template, .day-heading.has-no-template) { background-color: #111a2a; }
html[data-theme="dark"] :is(.month-day.is-today, .day-heading.is-today) { background: color-mix(in srgb, #315da7 16%, var(--theme-surface)); }
html[data-theme="dark"] :is(.month-day.is-holiday, .day-heading.is-holiday) { background-color: #2a241a; }
html[data-theme="dark"] :is(.month-day.is-past-day, .day-heading.is-past-day) { background-color: #2a1d25; }
html[data-theme="dark"] .reservation-workflow__panel { background: #172236; border-color: #35465f; }
html[data-theme="dark"] .reservation-workflow button:not(.is-primary):not(.is-danger) { color: #bed0ec; background: #1c2a40; border-color: #405372; }
html[data-theme="dark"] .drawer-secondary { color: #c5d0e1; background: #1c293d; border-color: #41516b; }
html[data-theme="dark"] .toolbar-client-button { color: #9ed9ca; background: #17302d; border-color: #315f57; }
html[data-theme="dark"] .toolbar-client-button:hover { color: #b5e6da; background: #1d3a36; border-color: #417268; }
html[data-theme="dark"] .toolbar-promotion-button { color: #efcf91; background: #332819; border-color: #665136; }
html[data-theme="dark"] .toolbar-promotion-button:hover { color: #f5dba9; background: #3c2f1d; border-color: #7a6141; }
html[data-theme="dark"] .toolbar-waiting-button { color: #d1c5ff; background: #292343; border-color: #514873; }
html[data-theme="dark"] .toolbar-waiting-button:hover { color: #e0d8ff; background: #332b51; border-color: #665b88; }

/* Management and finance workspaces. */
html[data-theme="dark"] :is(.management-hero, .accounting-hero, .commission-hero, .evaluation-hero, .coefficient-hero) { background: linear-gradient(135deg, #1b2138, #17263a 55%, #2c241d); border-color: var(--theme-border); }
html[data-theme="dark"] :is(.management-panel, .accounting-period, .accounting-review, .accounting-filters, .finance-ledger, .coefficient-rules-panel) { color: var(--theme-text); background: var(--theme-surface); border-color: var(--theme-border); box-shadow: 0 10px 28px rgba(0, 0, 0, .16); }
html[data-theme="dark"] :is(.management-price-group, .management-compatibility, .management-room, .commission-rule-card, .workshop-tier-row, .evaluation-person, .accounting-session, .accounting-period__grid > div, .accounting-metrics article, .discount-definition-card, .coefficient-category-card) { color: var(--theme-text); background: #111a2a; border-color: #334159; }
html[data-theme="dark"] :is(.management-price-group > header, .management-compatibility > header, .evaluation-rate-timeline, .management-add-room, .management-add-therapy, .accounting-period__filter, .therapist-workspace-nav) { background: linear-gradient(135deg, #18263a, #211f38); border-color: #35445c; }
html[data-theme="dark"] :is(.management-price-row, .management-compatible-room, .management-panel__heading, .accounting-session, .finance-ledger-row) { border-color: #2f3d53; }
html[data-theme="dark"] :is(.management-price-row label, .management-price-card label, .management-add-therapy__money, .management-room dl div, .management-room > header > span, .management-room__tags span, .management-room-colour-key > span, .evaluation-rate-timeline article) { background: #172236; border-color: #35445b; }
html[data-theme="dark"] :is(.management-price-card, .management-price-card.is-active) { color: var(--theme-text); background: linear-gradient(145deg, var(--theme-surface), #172b2a); border-color: #35504d; }
html[data-theme="dark"] .management-price-card.therapy-type-card { background: linear-gradient(145deg, var(--theme-surface), color-mix(in srgb, var(--therapy-color) 16%, var(--theme-surface))); border-color: color-mix(in srgb, var(--therapy-color) 40%, var(--theme-border)); box-shadow: inset 5px 0 var(--therapy-color); }
html[data-theme="dark"] .management-compatibility.therapy-type-panel > header { background: linear-gradient(135deg, color-mix(in srgb, var(--therapy-color) 18%, var(--theme-surface)), var(--theme-surface) 72%); }
html[data-theme="dark"] .management-room.is-active { background: linear-gradient(145deg, var(--theme-surface), color-mix(in srgb, var(--room-accent, #278d79) 13%, var(--theme-surface))); border-color: color-mix(in srgb, var(--room-accent, #278d79) 38%, var(--theme-border)); box-shadow: inset 4px 0 var(--room-accent, #278d79); }
html[data-theme="dark"] .directory-therapist.therapist-identity-card,
html[data-theme="dark"] .evaluation-person.therapist-identity-card { background: linear-gradient(145deg, var(--theme-surface), color-mix(in srgb, var(--therapist-color) 15%, var(--theme-surface))); border-color: color-mix(in srgb, var(--therapist-color) 38%, var(--theme-border)); box-shadow: inset 5px 0 var(--therapist-color); }
html[data-theme="dark"] :is(.management-price-row > div strong, .management-room header strong, .management-room dd, .management-room-rule-name strong, .evaluation-rate-timeline strong, .accounting-period__grid strong, .accounting-metrics strong) { color: #e0e8f6; }

/* Availability, capabilities, activity and assessment surfaces. */
html[data-theme="dark"] :is(.capability-hero, .availability-hero, .activity-profile, .activity-section, .activity-report, .availability-control-deck, .availability-workspace, .capability-section, .mcmi-card, .mcmi-panel) { color: var(--theme-text); background: var(--theme-surface); border-color: var(--theme-border); box-shadow: 0 10px 28px rgba(0, 0, 0, .15); }
html[data-theme="dark"] :is(.capability-service, .capability-language, .capability-room-row, .availability-booking-card, .availability-capability-row, .availability-review, .availability-summary, .activity-metrics article, .activity-session, .activity-type, .activity-note) { color: var(--theme-text); background: #111a2a; border-color: #334159; }
html[data-theme="dark"] :is(.capability-service.therapy-type-card.is-active, .availability-capability-row.therapy-type-card.is-active, .directory-category.therapy-type-card.is-active) { background: linear-gradient(145deg, var(--theme-surface), color-mix(in srgb, var(--therapy-color) 16%, var(--theme-surface))); border-color: color-mix(in srgb, var(--therapy-color) 38%, var(--theme-border)); }

/* Confirmation dialogs. */
html[data-theme="dark"] :is(.site-confirm-dialog__card, .site-delete-dialog__card) { color: var(--theme-text); background: var(--theme-surface); border-color: #46546b; }
html[data-theme="dark"] :is(.site-confirm-dialog__card header, .site-delete-dialog__card header) { background: linear-gradient(135deg, #1a2a40, #2b233b); border-color: #3b4960; }
html[data-theme="dark"] :is(.site-confirm-dialog__card header h2, .site-delete-dialog__card header h2) { color: #f0f4fc; }
html[data-theme="dark"] :is(.site-confirm-dialog__card > p, .site-delete-dialog__card > p) { color: #bdc7d8; }
html[data-theme="dark"] :is(.site-confirm-dialog__card footer, .site-delete-dialog__card footer) { background: #111a2a; border-color: #334159; }
html[data-theme="dark"] :is(.site-confirm-dialog__card footer .is-cancel, .site-delete-dialog__card footer .is-cancel) { color: #d7e0ef; background: #1c293d; border-color: #41516b; }

/* Complete application canvas and management navigation. Page styles are loaded
   per Razor view, so these rules deliberately cover every neutral nested surface. */
html[data-theme="dark"] body.app-page,
html[data-theme="dark"] body.app-page:has(.management-page) { background: var(--theme-canvas); }
html[data-theme="dark"] .app-main { background: transparent; }
html[data-theme="dark"] .management-tabs { background: var(--theme-surface); border-color: var(--theme-border); box-shadow: 0 10px 28px rgba(0,0,0,.18); }
html[data-theme="dark"] .management-tabs a,
html[data-theme="dark"] .management-tabs > span { color: #bdc8d9; background: #111a2a; border-color: #2f3d53; }
html[data-theme="dark"] .management-tabs a span,
html[data-theme="dark"] .management-tabs > span b { color: #b9c8e0; background: #202d42; }
html[data-theme="dark"] .management-tabs a.is-active { color: #fff; background: linear-gradient(135deg,var(--mg-blue),var(--mg-purple)); border-color: transparent; }
html[data-theme="dark"] .management-tabs a.is-active span { color: #365da1; background: #eef2ff; }
html[data-theme="dark"] .management-tabs > span.is-planned { color: #8290a7; background: #151f30; }
html[data-theme="dark"] .management-tabs em { color: #f2c986; background: #382a17; }
html[data-theme="dark"] .management-hero > a { color: #c7d7f2; background: #1b2a40; border-color: #41536e; }
html[data-theme="dark"] .therapist-workspace-nav { background: var(--theme-surface); border-color: var(--theme-border); }
html[data-theme="dark"] .therapist-workspace-nav a { color: #bdc8da; background: #111a2a; border-color: #334159; }

/* Management summaries, finance, evaluation, recycle bin and pricing settings. */
html[data-theme="dark"] :is(.management-summary article, .management-add-therapy, .management-price-group, .management-compatibility, .management-room-colour-key, .management-rule-legend span, .management-empty, .finance-form, .promotion-row, .finance-ledger-row, .payment-entry-form, .payment-history, .recycle-card, .recycle-detail dl div, .commission-rule-card, .workshop-tier-row, .evaluation-profile div, .evaluation-input-grid article, .binary-choice label, .calculation-breakdown, .calculation-steps span) {
    color: var(--theme-text); background: #111a2a; border-color: #334159;
}
html[data-theme="dark"] :is(.management-summary article.is-complete, .management-alert.is-success, .price-evidence, .recycle-restored-note) { color: #9ed9ca; background: #17302d; border-color: #315f57; }
html[data-theme="dark"] :is(.management-summary article.is-warning, .management-alert.is-caution, .finance-inline-action, .recycle-detail__summary) { color: #e8c58e; background: #332819; border-color: #665136; }
html[data-theme="dark"] .management-alert.is-error { color: #f0a7b4; background: #351f28; border-color: #68404c; }
html[data-theme="dark"] :is(.management-price-row.is-missing, .management-price-card, .management-compatible-room.is-specialist) { background: #2e261b; border-color: #5a4932; }
html[data-theme="dark"] :is(.management-price-row label, .management-price-card label, .management-price-card__state, .management-room dl div, .management-room > header > span, .management-room__tags span, .management-room-colour-key > span, .management-room-rule-name > span) { background: #172236; border-color: #35455e; }
html[data-theme="dark"] :is(.management-price-deactivate button, .management-price-card .management-category-delete button, .management-room__delete button, .management-record-actions button.is-danger, .evaluation-actions button:first-child, .coefficient-management .btn-outline-danger) { color: #f0a6b3 !important; background: #351f28 !important; border-color: #67404b !important; }
html[data-theme="dark"] :is(.management-room__delete button:disabled, .management-price-card .management-category-delete button:disabled) { color: #7d889a !important; background: #1a2230 !important; border-color: #303c50 !important; }
html[data-theme="dark"] :is(.finance-ledger-row dl div, .discount-definition-card, .promotion-row, .evaluation-person dl div, .evaluation-profile div, .evaluation-input-grid article, .recycle-detail dl div) { background: #172236; border-color: #35445b; }
html[data-theme="dark"] :is(.finance-ledger-row header em, .payment-history, .coefficient-category-card > header em) { color: #b8c4d7; background: #202d42; border-color: #3a4961; }
html[data-theme="dark"] :is(.payment-entry-form, .recycle-restore, .coefficient-management .accordion-body > form.row) { background: linear-gradient(135deg,#17263a,#211f38); border-color: #35445c; }
html[data-theme="dark"] .recycle-card.is-selected { background: linear-gradient(135deg,#1a2940,#282443); }
html[data-theme="dark"] :is(.recycle-toolbar a, .coefficient-category-card.is-inactive > button) { color: #c5d0e1; background: #1c293d; border-color: #41516b; }

html[data-theme="dark"] :is(.coefficient-category-card, .coefficient-accordion .accordion-item, .coefficient-accordion .accordion-body, .coefficient-management .accordion-body .card, .coefficient-management .accordion-body > section.border) { color: var(--theme-text); background: var(--theme-surface); border-color: var(--theme-border) !important; }
html[data-theme="dark"] .coefficient-category-card.is-active { background: linear-gradient(145deg,var(--theme-surface),#17302d); border-color: #315f57; }
html[data-theme="dark"] .coefficient-category-card.is-active > header em { color: #9ed9ca; background: #1a3b35; }
html[data-theme="dark"] .coefficient-accordion .accordion-button.collapsed { color: var(--theme-text); background: linear-gradient(135deg,#18263a,#211f38); }
html[data-theme="dark"] .coefficient-management .table-responsive { border-color: var(--theme-border); }
html[data-theme="dark"] .coefficient-management .table > :not(caption) > * > * { border-color: var(--theme-border) !important; }
html[data-theme="dark"] .coefficient-management .table thead th { color: #bdc8d9; background: #202d42; }
html[data-theme="dark"] .coefficient-management .table tbody tr:hover { background: rgba(255,255,255,.04); }
html[data-theme="dark"] .coefficient-management .accordion-body > section.border > header { background: linear-gradient(135deg,#18263a,#211f38) !important; border-color: var(--theme-border) !important; }
html[data-theme="dark"] :is(.coefficient-management .accordion-body .card h4, .coefficient-management .accordion-body > section.border > header h4, .coefficient-switch .form-check-label) { color: #e0e8f6; }

/* Accounting keeps therapist identity colours while converting every neutral panel. */
html[data-theme="dark"] :is(.accounting-intro__note, .accounting-period__grid > div, .accounting-period--all-time .accounting-period__grid > div, .accounting-period__filter, .accounting-review__grid div, .accounting-discounts__grid div, .accounting-filters > a) { color: var(--theme-text); background: #172236; border-color: #35445b; box-shadow: none; }
html[data-theme="dark"] .accounting-metrics article { color: var(--theme-text); background: #151f30; border-color: #334159; box-shadow: 0 8px 23px rgba(0,0,0,.15); }
html[data-theme="dark"] :is(.accounting-metrics article.is-warning, .accounting-review__grid div, .accounting-session__notice) { color: #e8c58e; background: #332819; border-color: #665136; }
html[data-theme="dark"] .accounting-person { background: linear-gradient(145deg,var(--theme-surface),color-mix(in srgb,var(--accounting-accent) 15%,var(--theme-surface))); border-color: color-mix(in srgb,var(--accounting-accent) 40%,var(--theme-border)); border-left-color: var(--accounting-accent); box-shadow: 0 9px 24px rgba(0,0,0,.18); }
html[data-theme="dark"] :is(.accounting-person__totals div, .accounting-person__month, .accounting-person__month-grid span) { color: var(--theme-muted); background: color-mix(in srgb,var(--accounting-accent) 9%,#111a2a); border-color: color-mix(in srgb,var(--accounting-accent) 32%,var(--theme-border)); }
html[data-theme="dark"] :is(.accounting-session, .accounting-session__money div, .accounting-session__audit) { color: var(--theme-text); background: #111a2a; border-color: #334159; }
html[data-theme="dark"] .accounting-session__audit { background: #172236; }
html[data-theme="dark"] .accounting-person__details { border-color: var(--theme-border); }

/* Activity pages and monthly reports. */
html[data-theme="dark"] :is(.activity-profile, .activity-metrics > div, .activity-report__metrics > div, .activity-report__filter, .activity-empty, .activity-session, .activity-session__facts div, .activity-note, .activity-compact-list article, .activity-type__period dl > div) { color: var(--theme-text); background: #111a2a; border-color: #334159; box-shadow: none; }
html[data-theme="dark"] :is(.activity-profile__identity h2, .activity-profile__details dd, .activity-metrics strong, .activity-report h3, .activity-report__metrics strong, .activity-session h3, .activity-session__person strong, .activity-session__facts dd, .activity-compact-list__head strong) { color: #e2ebfa; }
html[data-theme="dark"] :is(.activity-profile__identity p, .activity-profile__identity > span, .activity-profile__details dt, .activity-metrics span, .activity-metrics small, .activity-report__explanation, .activity-report__metrics span, .activity-report__filter label, .activity-report__month span, .activity-report__month p, .activity-session__person, .activity-session__facts dt, .activity-compact-list p, .activity-tests p) { color: #a9b8ce; }
html[data-theme="dark"] .activity-report__filter :is(input,select) { color: #e2ebfa; background: #172236; border-color: #41516b; }
html[data-theme="dark"] .activity-session__person a { color: #a2c0ff; }
html[data-theme="dark"] .therapist-identity-page :is(.activity-profile__identity h2, .activity-metrics strong, .activity-report h3, .activity-report__metrics strong) { color: color-mix(in srgb,var(--therapist-color) 55%,#fff); }
html[data-theme="dark"] .activity-session.is-cancelled { background: #2d1c24; border-color: #68404c; border-left-color: #c45f6f; }
html[data-theme="dark"] .activity-notice { color: #e8c58e; background: #332819; border-color: #665136; }
html[data-theme="dark"] .therapist-identity-page .activity-profile,
html[data-theme="dark"] .therapist-identity-page .activity-metrics > div,
html[data-theme="dark"] .therapist-identity-page :is(.activity-report__metrics > div, .activity-report__filter) { background: linear-gradient(135deg,var(--theme-surface),color-mix(in srgb,var(--therapist-color) 13%,var(--theme-surface))); border-color: color-mix(in srgb,var(--therapist-color) 36%,var(--theme-border)); }
html[data-theme="dark"] .activity-type { background: linear-gradient(135deg,var(--theme-surface),color-mix(in srgb,var(--therapy-color) 14%,var(--theme-surface))); border-color: color-mix(in srgb,var(--therapy-color) 38%,var(--theme-border)); border-left-color: var(--therapy-color); }

/* MCMI assessment history, questionnaire, drawer and report. */
html[data-theme="dark"] .mcmi-hero { background: linear-gradient(135deg,#17243a,#211f38 58%,#15302d); }
html[data-theme="dark"] :is(.mcmi-client-banner, .mcmi-history-row, .mcmi-history-pages a, .mcmi-client-drawer, .mcmi-question, .mcmi-choice, .mcmi-secondary, .mcmi-report-summary > div) { color: var(--theme-text); background: var(--theme-surface); border-color: var(--theme-border); }
html[data-theme="dark"] :is(.mcmi-progress, .mcmi-step-rail button, .mcmi-client-drawer__header button) { color: #c5d0e1; background: #202d42; border-color: #3a4961; }
html[data-theme="dark"] :is(.mcmi-selected-client, .mcmi-client-form__note, .mcmi-inline-notice) { color: #9ed9ca; background: #17302d; border-color: #315f57; }
html[data-theme="dark"] :is(.mcmi-translation-note, .mcmi-question__source) { color: #e8c58e; background: #332819; border-color: #665136; }
html[data-theme="dark"] .mcmi-translation-note button { color: #efd09d; background: #211a11; border-color: #71593a; }
html[data-theme="dark"] .mcmi-choice:has(input:checked) { color: #dce8ff; background: #1d3150; border-color: #5878a9; }
html[data-theme="dark"] .mcmi-inline-error { color: #f0a7b4; background: #351f28; }
html[data-theme="dark"] .mcmi-result-table :is(th,td) { border-color: var(--theme-border); }
html[data-theme="dark"] .mcmi-result-table thead th { color: #c4cfe0; background: #202d42; }
html[data-theme="dark"] .mcmi-result-table tbody tr:nth-child(even) { background: rgba(255,255,255,.025); }
html[data-theme="dark"] .mcmi-final { color: #9ed9ca; background: #17302d; }

/* Therapist directory, forms, capabilities and availability. */
html[data-theme="dark"] .therapist-evaluation-summary { background: linear-gradient(135deg,#211f38,#17302d); border-color: #3c4860; }
html[data-theme="dark"] .therapist-evaluation-summary div { background: rgba(12,19,32,.72); border: 1px solid #334159; }
html[data-theme="dark"] .resource-action--evaluation { color: #d1c5ff !important; background: #292343 !important; border-color: #514873 !important; }
html[data-theme="dark"] .resource-page--form .training-course-row { color: var(--theme-text); background: #111a2a; border-color: #334159 !important; }
html[data-theme="dark"] :is(.directory-category, .directory-language, .directory-therapist, .directory-category dl div, .directory-therapist dl div) { color: var(--theme-text); background: #111a2a; border-color: #334159; }
html[data-theme="dark"] :is(.directory-category.is-active, .directory-language.is-active) { background: linear-gradient(145deg,var(--theme-surface),#17302d); border-color: #315f57; }
html[data-theme="dark"] :is(.directory-language > span, .directory-language.is-active form button) { background: #172236; border-color: #41516b; }

html[data-theme="dark"] .capability-hero__actions a,
html[data-theme="dark"] .capability-section__heading > a,
html[data-theme="dark"] .availability-hero__actions a { color: #c7d7f2; background: #1b2a40; border-color: #41536e; }
html[data-theme="dark"] .capability-readiness { color: #c7d2e3; background: #172236; border-color: #35445b; }
html[data-theme="dark"] .capability-readiness.is-ready { color: #9ed9ca; background: #17302d; border-color: #315f57; }
html[data-theme="dark"] .capability-readiness.is-incomplete { color: #e8c58e; background: #332819; border-color: #665136; }
html[data-theme="dark"] .capability-readiness :is(dl div, .capability-readiness__checklist > span, .capability-readiness__checklist > a) { background: rgba(12,19,32,.62); border-color: #3b4b63; }
html[data-theme="dark"] :is(.capability-service__facts span, .capability-money-input, .capability-language__code, .capability-room-service, .capability-room-service__heading, .capability-empty) { color: var(--theme-text); background: #172236; border-color: #35445b; }

html[data-theme="dark"] .availability-audit { color: #9ed9ca; background: #17302d; border-color: #315f57; }
html[data-theme="dark"] .availability-audit p { color: #9dbab3; }
html[data-theme="dark"] .availability-audit em { color: #a9ddcf; background: #21433d; }
html[data-theme="dark"] :is(.availability-capabilities, .availability-capabilities__body, .availability-capabilities__body > section, .availability-capabilities__room-note, .availability-capabilities__room-note a) { color: var(--theme-text); background: #111a2a; border-color: #334159; }
html[data-theme="dark"] .availability-capabilities__body { background: #172236; }
html[data-theme="dark"] :is(.availability-capabilities__metrics span, .availability-capabilities__metrics em) { color: #bdc8d9; background: #202d42; border-color: #3a4961; }
html[data-theme="dark"] .availability-capabilities__metrics em.is-ready { color: #9ed9ca; background: #17302d; border-color: #315f57; }
html[data-theme="dark"] :is(.availability-calendar__corner, .availability-calendar__day, .availability-calendar__time, .availability-slot-wrap, .availability-cell) { background-color: #111a2a; border-color: #334159; }
html[data-theme="dark"] .availability-calendar { background: #334159; }
html[data-theme="dark"] .availability-calendar__day.is-past-day { background: #2d1c24; }
html[data-theme="dark"] .availability-calendar__day.is-today { background: linear-gradient(180deg,#1d3150,#151f30); }
html[data-theme="dark"] :is(.availability-summary article, .availability-view-switcher, .availability-statusbar, .availability-calendar-system-control, .availability-size-tools, .availability-size-tools button, .availability-mode, .availability-explainer, .availability-stage) { color: var(--theme-text); background: #111a2a; border-color: #334159; }
html[data-theme="dark"] .availability-view-switcher button.is-active { color: #dce8ff; background: #1d3150; border-color: #5878a9; }
html[data-theme="dark"] .availability-mode button span { background: #202d42; }
html[data-theme="dark"] .availability-mode button.is-active { color: #fff; background: var(--av-blue); }
html[data-theme="dark"] .availability-mode button.is-active span { color: var(--av-blue); background: #eef2ff; }
html[data-theme="dark"] .availability-statusbar__summary > strong { color: #e0e8f6; }

/* Calendar controls and grid use dark neutrals; therapist, therapy, room and
   reservation status colours remain on their existing accent variables. */
html[data-theme="dark"] :is(.waiting-master-toggle, .calendar-size-tools, .calendar-size-tools button, .week-head, .day-head, .waiting-workspace, .waiting-workspace__tools label, .waiting-workspace__empty) { color: var(--theme-text); background: #111a2a; border-color: #334159; }
html[data-theme="dark"] :is(.filter-option--service, .filter-option--waiting-service) {
    color: var(--theme-text);
    background: linear-gradient(135deg,#111a2a,color-mix(in srgb,var(--therapy-color) 12%,#111a2a));
    border: 1px solid color-mix(in srgb,var(--therapy-color) 32%,#334159);
}
html[data-theme="dark"] :is(.filter-option--service, .filter-option--waiting-service):hover {
    background: linear-gradient(135deg,#172236,color-mix(in srgb,var(--therapy-color) 18%,#172236));
}
html[data-theme="dark"] .waiting-filter-group { color: var(--theme-text); background: linear-gradient(145deg,#151f30,#181d31); border-color: #3b3e59; }
html[data-theme="dark"] .waiting-master-toggle small { color: var(--theme-muted); }
html[data-theme="dark"] .waiting-workspace-card {
    color: var(--theme-text);
    background: linear-gradient(135deg,#151f30,color-mix(in srgb,var(--therapy-color) 13%,#151f30));
    border-color: color-mix(in srgb,var(--therapy-color) 38%,#334159);
    border-left-color: var(--therapy-color);
}
html[data-theme="dark"] .waiting-workspace-card strong { color: #e5ecf8; }
html[data-theme="dark"] .waiting-workspace-card :is(small,time,em) { color: #aab7cb; }
html[data-theme="dark"] .waiting-workspace-card__status { color: #efcf91; background: #3a2c18; }
html[data-theme="dark"] .waiting-workspace-card.is-offered .waiting-workspace-card__status { color: #a9c9ee; background: #1d3048; }
html[data-theme="dark"] :is(.week-head, .day-head) { background: rgba(21,31,48,.98); }
html[data-theme="dark"] :is(.calendar-date-chip, .calendar-system-control, .time-axis) { color: #bdc8d9; background: #172236; border-color: #35445b; }
html[data-theme="dark"] .calendar-date-chip.is-primary { color: #dce8ff; background: #1d3150; border-color: #5878a9; }
html[data-theme="dark"] :is(.week-days, .room-days) { background-image: linear-gradient(to bottom,#334159 1px,transparent 1px); }
html[data-theme="dark"] .availability-slot.is-available { background: rgba(57,78,112,.25); }
html[data-theme="dark"] .availability-slot.is-unavailable { background-color: rgba(29,39,56,.78); background-image: repeating-linear-gradient(135deg,rgba(130,145,168,.08) 0 2px,transparent 2px 7px); }
html[data-theme="dark"] .availability-slot.is-closed { background-color: rgba(40,34,43,.9); background-image: repeating-linear-gradient(135deg,rgba(183,121,135,.08) 0 2px,transparent 2px 7px); }
html[data-theme="dark"] .availability-slot.is-nonconfigured { background-color: rgba(25,34,49,.9); background-image: repeating-linear-gradient(135deg,rgba(130,145,168,.07) 0 2px,transparent 2px 8px); }
html[data-theme="dark"] :is(.client-preview-note, .availability-note) { color: #9ed9ca; background: #17302d; border-color: #315f57; }
html[data-theme="dark"] :is(.booking-exception, .availability-note.has-warning, .client-preview-note.promotion-preview-note) { color: #e8c58e; background: #332819; border-color: #665136; }
html[data-theme="dark"] .availability-note.has-conflict { color: #edaa8b; background: #36231c; border-color: #704636; }
html[data-theme="dark"] :is(.waiting-list-summary, .waiting-lifecycle) { color: var(--theme-text); background: #172236; border-color: #35445b; }
html[data-theme="dark"] .waiting-lifecycle span { color: #bdc8d9; background: #202d42; }
html[data-theme="dark"] .waiting-lifecycle span.is-current { color: #9ed9ca; background: #17302d; }
html[data-theme="dark"] :is(.availability-details-drawer, .availability-details-hint, .waiting-request-composer, .waiting-preview-item, .waiting-history-item) { color: var(--theme-text); background: var(--theme-surface); border-color: var(--theme-border); }
html[data-theme="dark"] .availability-details-hint { background: #172236; }
html[data-theme="dark"] .waiting-preview-item--offered { background: #17263a; border-left-color: #3c75ba; }
html[data-theme="dark"] .waiting-preview-item__actions button:not(.is-primary):not(.is-danger) { color: #c5d0e1; background: #1c293d; border-color: #41516b; }
html[data-theme="dark"] .waiting-preview-item__actions button.is-danger { color: #f0a6b3; background: #351f28; border-color: #67404b; }

@media (max-width: 1450px) {
    .nav-item--theme { margin-top: .35rem; }
    .site-theme-toggle { width: 100%; justify-content: flex-start; margin-inline: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .site-theme-toggle,
    .site-theme-toggle__track b { transition: none; }
}
