/* Opt-in Hub theme. Light rules in app.css and tenant branding remain untouched. */
.dh-theme-toggle {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-width: 44px;
    min-height: 44px;
    padding: .55rem .8rem;
    border: 1px solid #6a7380;
    border-radius: 999px;
    background: #fff;
    color: #15202b;
    font: inherit;
    font-size: .83rem;
    font-weight: 750;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
}

.dh-theme-toggle[hidden] { display: none !important; }
.dh-theme-toggle:hover { background: #f6f1e7; }
.dh-theme-toggle:focus-visible {
    outline: 3px solid #a36b00;
    outline-offset: 3px;
}

.dh-theme-utility {
    display: flex;
    justify-content: flex-end;
    padding: .75rem 1rem 0;
}

@media (max-width: 1499.98px) {
    .dh-topbar .dh-theme-toggle__label,
    .dh-public-navbar .dh-theme-toggle__label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
}

@media (max-width: 1199.98px) {
    .dh-public-theme-control .dh-theme-toggle { width: 100%; }
    .dh-public-navbar .dh-public-theme-control .dh-theme-toggle__label {
        position: static;
        width: auto;
        height: auto;
        margin: 0;
        overflow: visible;
        clip: auto;
    }
}

:root[data-dh-theme="dark"] {
    color-scheme: dark;
    --dh-ink: #edf3fa;
    --dh-ink-soft: #c3cfdd;
    --dh-ink-muted: #afc0d1;
    --dh-surface: #1b2a3a;
    --dh-surface-alt: #233448;
    --dh-surface-soft: #233448;
    --dh-background: #111b28;
    --dh-border: #607890;
    --dh-border-strong: #8198af;
    --dh-success: #86e3ae;
    --dh-warning: #f6d17b;
    --dh-danger: #ffad9c;
    --dh-text-main: #edf3fa;
    --dh-text-muted: #c3cfdd;
    --dh-shadow-sm: 0 16px 35px rgba(0, 0, 0, .2);
    --dh-shadow: 0 30px 70px rgba(0, 0, 0, .26);
    --bs-body-color: #edf3fa;
    --bs-body-bg: #111b28;
    --bs-secondary-color: #c3cfdd;
    --bs-border-color: #607890;
    --bs-link-color: #a7ceff;
    --bs-link-hover-color: #d0e3ff;
}

:root[data-dh-theme="dark"] body,
:root[data-dh-theme="dark"] :is(input, select, textarea, button) {
    color-scheme: dark;
}

:root[data-dh-theme="dark"] body,
:root[data-dh-theme="dark"] body.dh-app-body,
:root[data-dh-theme="dark"] body.dh-public-body {
    color: var(--dh-ink);
    background: radial-gradient(circle at top left, rgba(241, 188, 22, .08), transparent 30%),
        linear-gradient(180deg, #111b28, #152232 62%, #111b28);
}

:root[data-dh-theme="dark"] .dh-topbar,
:root[data-dh-theme="dark"] .dh-public-navbar {
    background: rgba(23, 36, 51, .97) !important;
    border-color: var(--dh-border);
    color: var(--dh-ink);
}
:root[data-dh-theme="dark"] .dh-public-navbar .nav-link:is(.active, :hover, :focus-visible) {
    background: #31485f;
    color: #fff;
}

@media (max-width: 1199.98px) {
    :root[data-dh-theme="dark"] .dh-public-navbar .navbar-collapse {
        background: var(--dh-surface);
        border-color: var(--dh-border);
    }
}
:root[data-dh-theme="dark"] .dh-language-picker select {
    background-color: #172637;
    border-color: var(--dh-border-strong);
    color: var(--dh-ink);
}
/* The mobile menu button deliberately remains light; retain its dark SVG icon. */
:root[data-dh-theme="dark"] .dh-public-toggler .navbar-toggler-icon { filter: none; }

:root[data-dh-theme="dark"] .dh-public-footer {
    background: #101927;
    border-color: #34485d;
}

:root[data-dh-theme="dark"] .dh-theme-toggle {
    background: #25384c;
    border-color: #8198af;
    color: #edf3fa;
}

:root[data-dh-theme="dark"] .dh-theme-toggle:hover { background: #31485f; }
:root[data-dh-theme="dark"] .dh-theme-toggle[aria-pressed="true"] {
    background: #f6d17b;
    border-color: #f6d17b;
    color: #17243b;
}
:root[data-dh-theme="dark"] .dh-theme-toggle:focus-visible {
    outline-color: #f6d17b;
}

/* Authentication cards have explicit white backgrounds in app.css. Keep the
   whole form surface dark so labels, muted copy and inputs remain readable. */
:root[data-dh-theme="dark"] :is(.dh-auth-card, .dh-auth-form-wrapper) {
    background: var(--dh-surface);
    color: var(--dh-ink);
}
:root[data-dh-theme="dark"] .dh-auth-form-wrapper h2 { color: var(--dh-ink); }
:root[data-dh-theme="dark"] .dh-auth-form-wrapper > div > p,
:root[data-dh-theme="dark"] .dh-auth-form-wrapper .dh-link-muted {
    color: var(--dh-ink-soft);
}
:root[data-dh-theme="dark"] .dh-auth-form-wrapper .dh-brand-pill {
    background: var(--dh-surface-alt);
    border-color: var(--dh-border);
    color: var(--dh-ink-soft);
}
:root[data-dh-theme="dark"] .dh-auth-form-wrapper .dh-link-muted:hover {
    color: #f6d17b;
}

/* Shared application and public surfaces. Feature-specific art and tenant logos are preserved. */
:root[data-dh-theme="dark"] :is(
    .dh-card, .dh-card-muted, .card, .modal-content, .offcanvas,
    .dropdown-menu, .accordion-item, .list-group-item, .dh-empty, .dh-empty-state,
    .dh-public-flow-card, .dh-public-page-head, .dh-public-checkout-card,
    .dh-calendar-view-panel, .dh-calendar-google-panel, .dh-calendar-metrics article,
    .dh-calendar-view-settings, .dh-google-status-card, .dh-retention-summary > div
) {
    background: var(--dh-surface);
    border-color: var(--dh-border);
    color: var(--dh-ink);
}

:root[data-dh-theme="dark"] .dh-public-checkout-card,
:root[data-dh-theme="dark"] .dh-calendar-google-panel {
    background: radial-gradient(circle at top right, rgba(241, 188, 22, .1), transparent 32%), var(--dh-surface);
}

:root[data-dh-theme="dark"] :is(
    .dh-notification-alert, .dh-copilot-hero, .dh-copilot-safety,
    .dh-settings-google-step, .dh-retention-ack, .dh-retention-review
) {
    background: var(--dh-surface-alt);
    border-color: var(--dh-border);
    color: var(--dh-ink);
}

:root[data-dh-theme="dark"] :is(
    .dh-card, .card, .modal-content, .dh-public-flow-card,
    .dh-public-checkout-card, .dh-calendar-metrics article
) :is(h1, h2, h3, h4, h5, h6) {
    color: var(--dh-ink);
}

:root[data-dh-theme="dark"] :is(
    .dh-retention-summary strong, .dh-retention-card__head h2,
    .dh-calendar-metrics strong, .dh-calendar-metrics small,
    .dh-public-page-head__intro, .dh-notification-alert-title
) { color: var(--dh-ink); }

:root[data-dh-theme="dark"] :is(.text-muted, .text-secondary, .dh-retention-summary span, .dh-retention-history p) {
    color: var(--dh-ink-soft) !important;
}

:root[data-dh-theme="dark"] :is(.text-dark, .text-body) { color: var(--dh-ink) !important; }
:root[data-dh-theme="dark"] .text-danger { color: var(--dh-danger) !important; }
:root[data-dh-theme="dark"] .text-success { color: var(--dh-success) !important; }
:root[data-dh-theme="dark"] .text-warning { color: var(--dh-warning) !important; }
:root[data-dh-theme="dark"] :is(.bg-white, .bg-light, .bg-light-subtle, .bg-body, .bg-body-tertiary) {
    background-color: var(--dh-surface) !important;
}
:root[data-dh-theme="dark"] :is(hr, .border, .border-top, .border-bottom) { border-color: var(--dh-border) !important; }

:root[data-dh-theme="dark"] :is(.form-control, .form-select, .input-group-text, .form-control[type="file"]),
:root[data-dh-theme="dark"] :is(.dh-public-checkout-card, .dh-public-flow-card) :is(.form-control, .form-select) {
    background: #172637;
    border-color: var(--dh-border-strong);
    color: var(--dh-ink);
}
:root[data-dh-theme="dark"] :is(.form-label, .dh-retention-form label:not(.dh-retention-ack)) { color: var(--dh-ink); }
:root[data-dh-theme="dark"] .form-text { color: var(--dh-ink-soft); }
:root[data-dh-theme="dark"] .invalid-feedback { color: var(--dh-danger); }

:root[data-dh-theme="dark"] :is(.form-control, .form-select)::placeholder { color: #b7c6d6; opacity: 1; }
:root[data-dh-theme="dark"] :is(.form-control, .form-select):disabled,
:root[data-dh-theme="dark"] :is(.form-control, .form-select)[readonly] {
    background: #26394c;
    color: var(--dh-ink-soft);
    opacity: 1;
}
:root[data-dh-theme="dark"] :is(.form-control, .form-select):focus {
    background: #172637;
    border-color: #f6d17b;
    color: var(--dh-ink);
    box-shadow: 0 0 0 .22rem rgba(246, 209, 123, .24);
}
:root[data-dh-theme="dark"] .form-control[type="file"]::file-selector-button {
    background: #31485f;
    border-color: var(--dh-border-strong);
    color: var(--dh-ink);
}
:root[data-dh-theme="dark"] .form-check-input {
    background-color: #172637;
    border-color: #9badbf;
}
:root[data-dh-theme="dark"] .form-check-input:checked {
    background-color: #f6d17b;
    border-color: #f6d17b;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%2317243b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.1' d='M3.2 8.2 6.5 11.4 12.8 4.8'/%3E%3C/svg%3E");
}
:root[data-dh-theme="dark"] .form-check-input:focus-visible,
:root[data-dh-theme="dark"] :is(.btn, .nav-link, a):focus-visible {
    outline: 3px solid #f6d17b;
    outline-offset: 2px;
}

:root[data-dh-theme="dark"] :is(.btn-outline-dark, .btn-outline-secondary, .dh-outline-btn) {
    background: transparent;
    border-color: var(--dh-border-strong);
    color: var(--dh-ink);
}
:root[data-dh-theme="dark"] :is(.btn-outline-dark, .btn-outline-secondary, .dh-outline-btn):is(:hover, :focus-visible) {
    background: #31485f;
    border-color: #a6b8ca;
    color: #fff;
}
:root[data-dh-theme="dark"] .dh-topbar-avatar,
:root[data-dh-theme="dark"] .dh-primary-btn { color: #17243b; }
:root[data-dh-theme="dark"] .dh-topbar-avatar-wrap .dropdown-menu { background: var(--dh-surface); border-color: var(--dh-border); }
:root[data-dh-theme="dark"] .dh-topbar-avatar-wrap .dropdown-item { color: var(--dh-ink); }
:root[data-dh-theme="dark"] .dh-topbar-avatar-wrap .dropdown-item:is(:hover, :focus-visible) { background: #31485f; color: #fff; }
:root[data-dh-theme="dark"] .dh-topbar-avatar-wrap .dropdown-item.text-danger { color: var(--dh-danger) !important; }

:root[data-dh-theme="dark"] .table {
    --bs-table-color: var(--dh-ink);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--dh-border);
    --bs-table-striped-color: var(--dh-ink);
    --bs-table-striped-bg: rgba(255, 255, 255, .045);
    --bs-table-hover-color: var(--dh-ink);
    --bs-table-hover-bg: rgba(246, 209, 123, .1);
}
:root[data-dh-theme="dark"] .dh-table tbody tr:nth-child(even) { background: rgba(255, 255, 255, .045); }
:root[data-dh-theme="dark"] .dh-table tbody tr:hover,
:root[data-dh-theme="dark"] .dh-table tbody tr:hover td { background: rgba(246, 209, 123, .1) !important; }

:root[data-dh-theme="dark"] .fc {
    --fc-border-color: var(--dh-border);
    --fc-page-bg-color: var(--dh-surface);
    --fc-neutral-bg-color: var(--dh-surface-alt);
    --fc-today-bg-color: rgba(246, 209, 123, .13);
    color: var(--dh-ink);
}
:root[data-dh-theme="dark"] .fc :is(.fc-button-primary, .fc-popover, .fc-list-day-cushion),
:root[data-dh-theme="dark"] .dh-calendar-google-panel .dh-google-status-card {
    background: var(--dh-surface-alt);
    border-color: var(--dh-border);
    color: var(--dh-ink);
}
:root[data-dh-theme="dark"] .fc .fc-button-primary:is(:hover, :focus-visible, .fc-button-active) {
    background: #31485f;
    border-color: #a6b8ca;
    color: #fff;
}
:root[data-dh-theme="dark"] .fc-theme-standard :is(th, td) { border-color: var(--dh-border); }
:root[data-dh-theme="dark"] .dh-calendar-view-settings { background: var(--dh-surface-alt); }

/* The first screen in each signed-in area must remain readable after opt-in. */
:root[data-dh-theme="dark"] :is(
    .dh-context-hero, .dh-highlight-card, .dh-highlight-item, .dh-ops-card,
    .dh-list-card, .dh-action-card, .dh-client-dashboard-hero,
    .dh-client-dashboard-stats article, .dh-client-dashboard-ai,
    .dh-staff-command-hero, .dh-staff-next, .dh-staff-command-metrics article
) {
    background: var(--dh-surface);
    border-color: var(--dh-border);
    color: var(--dh-ink);
}
:root[data-dh-theme="dark"] :is(.dh-context-hero, .dh-client-dashboard-hero, .dh-staff-command-hero) {
    background: radial-gradient(circle at top right, rgba(241, 188, 22, .12), transparent 34%), var(--dh-surface);
}
:root[data-dh-theme="dark"] :is(.dh-highlight-item, .dh-list-card, .dh-client-dashboard-stats article, .dh-staff-command-metrics article) {
    background: var(--dh-surface-alt);
}
:root[data-dh-theme="dark"] .dh-center-metric__icon {
    background: #31485f;
    opacity: 1;
}
:root[data-dh-theme="dark"] .dh-center-metric.is-primary .dh-center-metric__icon { color: #f6d17b; }
:root[data-dh-theme="dark"] .dh-badge.info { color: #a7ceff; }
:root[data-dh-theme="dark"] .dh-client-dashboard-hero__eyebrow,
:root[data-dh-theme="dark"] .dh-client-dashboard-stat__icon,
:root[data-dh-theme="dark"] .dh-client-dashboard-ai__icon { color: #f6d17b; }
:root[data-dh-theme="dark"] .dh-client-dashboard-hero__visual > span {
    background: var(--dh-surface-alt);
    border-color: var(--dh-border);
    color: #f6d17b;
}
:root[data-dh-theme="dark"] .dh-staff-command {
    --dh-staff-ink: #edf3fa;
    --dh-staff-muted: #c3cfdd;
    --dh-staff-line: #607890;
    --dh-staff-green: #86e3ae;
}
:root[data-dh-theme="dark"] .dh-staff-command .dh-card,
:root[data-dh-theme="dark"] :is(.dh-staff-agenda-row, .dh-staff-action-list > a, .dh-staff-profile-list > div) {
    background: var(--dh-surface-alt);
    border-color: var(--dh-border);
    color: var(--dh-ink);
}
:root[data-dh-theme="dark"] :is(.dh-staff-agenda-row, .dh-staff-action-list > a):is(:hover, :focus-visible) {
    background: #31485f;
    color: #fff;
}
:root[data-dh-theme="dark"] :is(.dh-staff-command-hero__eyebrow, .dh-staff-next__head) { color: var(--dh-ink-soft); }
:root[data-dh-theme="dark"] .dh-staff-next > time,
:root[data-dh-theme="dark"] .dh-staff-agenda-row > time { color: var(--dh-success); }
:root[data-dh-theme="dark"] .dh-staff-next__footer > a {
    background: var(--dh-surface-alt);
    border-color: var(--dh-border);
}

/* Booking and calendar controls keep selection and disabled states distinct. */
:root[data-dh-theme="dark"] :is(.dh-client-calendar, .dh-booking-calendar-shell, .dh-day-slot-panel, .dh-month-day, .dh-slot-option-label) {
    background: var(--dh-surface);
    border-color: var(--dh-border);
    color: var(--dh-ink);
}
:root[data-dh-theme="dark"] :is(.dh-month-day.is-selected, .dh-slot-option-input:checked + .dh-slot-option-label) {
    background: #374333;
    border-color: #f6d17b;
    color: #fff;
}
:root[data-dh-theme="dark"] .dh-month-day.is-unavailable {
    background: #26394c;
    color: #b7c6d6;
}
:root[data-dh-theme="dark"] .dh-slot-option-input:focus-visible + .dh-slot-option-label {
    outline: 3px solid #f6d17b;
    outline-offset: 2px;
}

:root[data-dh-theme="dark"] :is(.dh-alert.success, .alert-success) { background: #17382e; color: #a6edc5; border-color: #326c55; }
:root[data-dh-theme="dark"] :is(.dh-alert.warning, .alert-warning) { background: #3b301b; color: #f6d17b; border-color: #80643a; }
:root[data-dh-theme="dark"] :is(.dh-alert.danger, .alert-danger) { background: #40292c; color: #ffb9ab; border-color: #915259; }
:root[data-dh-theme="dark"] :is(.alert-info, .dh-notification-alert) { background: #1c344b; color: #c1dcff; border-color: #496c8f; }

/* Consent UI keeps its configured light palette; theme state never changes consent. */
:root[data-dh-theme="dark"] .dh-cookie-banner {
    color-scheme: light;
    --dh-ink: #15202b;
    --dh-ink-soft: #5d6773;
    --dh-border: #d8e0e8;
}
:root[data-dh-theme="dark"] .dh-cookie-banner .form-check-input:not(:checked) { background-color: #fff; }

/* The owner cockpit has many bespoke light panels. Keep it a bounded, readable
   light island until those panels can be migrated individually. */
:root[data-dh-theme="dark"] .dh-control-center {
    color-scheme: light;
    --dh-ink: #15202b;
    --dh-ink-soft: #475467;
    --dh-ink-muted: #5d6773;
    --dh-surface: #fff;
    --dh-surface-alt: #f6f1e7;
    --dh-surface-soft: #eef3f7;
    --dh-background: #f7f9fc;
    --dh-border: #d8e0e8;
    --dh-border-strong: #6a7380;
    --dh-text-main: #15202b;
    --dh-text-muted: #5d6773;
    --dh-success: #1f7a54;
    --dh-warning: #805600;
    --dh-danger: #bc4431;
    --bs-body-color: #15202b;
    --bs-body-bg: #fff;
    --bs-secondary-color: #475467;
    --bs-border-color: #d8e0e8;
    --bs-link-color: #165a9f;
    --bs-link-hover-color: #103e74;
    padding: clamp(1rem, 2vw, 1.5rem);
    border: 1px solid var(--dh-border);
    border-radius: var(--dh-radius);
    background: var(--dh-background);
    color: var(--dh-ink);
}
:root[data-dh-theme="dark"] .dh-control-center :is(input, select, textarea, button) { color-scheme: light; }
:root[data-dh-theme="dark"] .dh-control-center :is(.form-control, .form-select, .input-group-text) {
    background: #fff;
    border-color: var(--dh-border-strong);
    color: var(--dh-ink);
}
:root[data-dh-theme="dark"] .dh-control-center :is(.form-control, .form-select)::placeholder {
    color: var(--dh-ink-muted);
    opacity: 1;
}
:root[data-dh-theme="dark"] .dh-control-center :is(.form-control, .form-select):focus {
    background: #fff;
    border-color: #9a6700;
    color: var(--dh-ink);
}
:root[data-dh-theme="dark"] .dh-control-center :is(.form-control, .form-select):is(:disabled, [readonly]) {
    background: #eef2f6;
    color: var(--dh-ink-soft);
}
:root[data-dh-theme="dark"] .dh-control-center .form-check-input:not(:checked) {
    background-color: #fff;
    border-color: var(--dh-border-strong);
}

/* Tenant assistance: tickets, conversations and the adjacent roadmap share one page. */
:root[data-dh-theme="dark"] .dh-feedback-page :is(
    .dh-feedback-jump-nav, .dh-support-ticket, .dh-support-message,
    .dh-roadmap-card, .dh-changelog-card
) {
    background: var(--dh-surface-alt);
    border-color: var(--dh-border);
    color: var(--dh-ink);
}
:root[data-dh-theme="dark"] .dh-feedback-page .dh-support-ticket:is(:hover, :focus-visible),
:root[data-dh-theme="dark"] .dh-feedback-page .dh-support-ticket.is-selected {
    background: #31485f;
    border-color: #a6b8ca;
    color: #fff;
}
:root[data-dh-theme="dark"] .dh-feedback-page .dh-support-message.is-centre { background: #26394c; }
:root[data-dh-theme="dark"] .dh-feedback-page .dh-roadmap-card__labels span {
    background: #31485f;
    color: var(--dh-ink);
}
:root[data-dh-theme="dark"] .dh-feedback-page .dh-roadmap-card__labels .is-status {
    background: #3b301b;
    color: var(--dh-warning);
}

/* Staff compensation: the hero was already dark, but its data cards were not. */
:root[data-dh-theme="dark"] .dh-staff-compensation {
    --dh-compensation-ink: var(--dh-ink);
    --dh-compensation-muted: var(--dh-ink-soft);
    --dh-compensation-line: var(--dh-border);
    --dh-compensation-green: var(--dh-success);
    --dh-compensation-green-soft: #17382e;
    color: var(--dh-ink);
}
:root[data-dh-theme="dark"] .dh-staff-compensation :is(
    .dh-staff-compensation-unavailable, .dh-staff-compensation-metrics article,
    .dh-staff-compensation-overview, .dh-staff-compensation-register,
    .dh-staff-compensation-overview__grid > article, .dh-staff-compensation-estimate,
    .dh-staff-compensation-search, .dh-staff-compensation-entry,
    .dh-staff-compensation-entry__amounts > div, .dh-staff-compensation-entry__progress,
    .dh-staff-compensation-empty.is-search
) {
    background: var(--dh-surface-alt);
    border-color: var(--dh-border);
    color: var(--dh-ink);
}
:root[data-dh-theme="dark"] .dh-staff-compensation :is(
    .dh-staff-compensation-overview, .dh-staff-compensation-register,
    .dh-staff-compensation-unavailable
) { background: var(--dh-surface); }
:root[data-dh-theme="dark"] .dh-staff-compensation .dh-staff-compensation-entry:hover,
:root[data-dh-theme="dark"] .dh-staff-compensation .dh-staff-compensation-search:focus-within {
    background: #31485f;
}
:root[data-dh-theme="dark"] .dh-staff-compensation .dh-staff-compensation-overview__grid > article.is-net {
    background: #17382e;
}
:root[data-dh-theme="dark"] .dh-staff-compensation .dh-staff-compensation-entry__amounts > div.is-pending {
    background: #3b301b;
}
:root[data-dh-theme="dark"] .dh-staff-compensation :is(
    .dh-staff-compensation-metrics article > span,
    .dh-staff-compensation-entry__head > span,
    .dh-staff-compensation-estimate > span,
    .dh-staff-compensation-estimate > small,
    .dh-staff-compensation-register__head > span:last-child
) {
    background: #31485f;
    color: var(--dh-ink);
}
:root[data-dh-theme="dark"] .dh-staff-compensation :is(
    .dh-staff-compensation-overview__grid p,
    .dh-staff-compensation-search small,
    .dh-staff-compensation-entry__amounts dt,
    .dh-staff-compensation-entry__dates dt
) { color: var(--dh-ink-soft); }
:root[data-dh-theme="dark"] .dh-staff-compensation .dh-staff-compensation-entry__progress p {
    color: var(--dh-warning);
}

/* Client referral: every white card must switch together with its light text. */
:root[data-dh-theme="dark"] .dh-client-referral {
    background: radial-gradient(circle at 94% 4%, rgba(241, 188, 22, .1), transparent 15rem), var(--dh-surface);
    border-color: var(--dh-border);
    color: var(--dh-ink);
}
:root[data-dh-theme="dark"] .dh-client-referral :is(
    .dh-client-referral__terms, .dh-client-referral__share,
    .dh-client-referral__metrics article, .dh-client-referral__rules,
    .dh-client-referral__examples, .dh-client-referral__vouchers article
) {
    background: var(--dh-surface-alt);
    border-color: var(--dh-border);
    color: var(--dh-ink);
}
:root[data-dh-theme="dark"] .dh-client-referral :is(
    .dh-client-referral__eyebrow, .dh-client-referral__vouchers article > span
) { color: #f6d17b; }
:root[data-dh-theme="dark"] .dh-client-referral__icon { color: #17243b; }
:root[data-dh-theme="dark"] .dh-client-referral__accept input { accent-color: #f6d17b; }

/* Public shop, including the empty state and product modal. */
:root[data-dh-theme="dark"] .dh-public-shop-page { background: var(--dh-background); }
:root[data-dh-theme="dark"] .dh-public-shop-hero {
    background: radial-gradient(circle at 88% 10%, rgba(241, 188, 22, .1), transparent 25%), var(--dh-surface);
    border-color: var(--dh-border);
    color: var(--dh-ink);
}
:root[data-dh-theme="dark"] :is(
    .dh-public-shop-hero__badge, .dh-public-shop-disclosure,
    .dh-public-shop-store, .dh-public-shop-product,
    .dh-public-shop-product__category, .dh-public-shop-store__count,
    .dh-public-shop-modal .modal-header, .dh-public-shop-modal__product
) {
    background: var(--dh-surface-alt);
    border-color: var(--dh-border);
    color: var(--dh-ink);
}
:root[data-dh-theme="dark"] .dh-public-shop-product { background: var(--dh-surface); }
:root[data-dh-theme="dark"] :is(
    .dh-public-shop-product__media, .dh-public-shop-product__fallback,
    .dh-public-shop-modal__image-wrap
) { background: var(--dh-surface-alt); }
:root[data-dh-theme="dark"] :is(
    .dh-public-shop-hero__eyebrow, .dh-public-shop-product__price,
    .dh-public-shop-modal__product-price
) { color: #f6d17b; }
:root[data-dh-theme="dark"] :is(
    .dh-public-shop-hero__mark, .dh-public-shop-store__mark,
    .dh-public-shop-modal__store-mark
) {
    background: #31485f;
    color: #f6d17b;
}
:root[data-dh-theme="dark"] .dh-public-shop-disclosure__icon { color: #a7ceff; }
:root[data-dh-theme="dark"] .dh-public-shop-product__fallback { color: var(--dh-ink-muted); }
:root[data-dh-theme="dark"] .dh-public-shop-modal .btn-close { filter: invert(1) grayscale(100%); opacity: .85; }

/* Public service chips use fixed light-mode inks in app.css. */
:root[data-dh-theme="dark"] .dh-service-chip.chip-duration {
    background: #483a16;
    color: #ffdd80;
}
:root[data-dh-theme="dark"] .dh-service-chip.chip-price {
    background: #31485f;
    color: #edf3fa;
}

/* Course chips and prices have fixed light-mode ink in app.css. */
:root[data-dh-theme="dark"] :is(.dh-course-chip, .dh-course-price-tag) {
    background: #483a16;
    border-color: #a88735;
    color: #ffdd80;
}
:root[data-dh-theme="dark"] .dh-course-chip.chip-online {
    background: #173d52;
    border-color: #478baa;
    color: #afe7ff;
}
:root[data-dh-theme="dark"] .dh-course-chip.chip-hybrid {
    background: #3b294f;
    border-color: #8d68af;
    color: #dfc3ff;
}
:root[data-dh-theme="dark"] .dh-course-chip.chip-loc {
    background: #31485f;
    border-color: var(--dh-border);
    color: var(--dh-ink-soft);
}

/* Booking uses Bootstrap's light alert and a few fixed light progress surfaces. */
:root[data-dh-theme="dark"] .alert.alert-light {
    background: var(--dh-surface-alt);
    border-color: var(--dh-border);
    color: var(--dh-ink);
}
:root[data-dh-theme="dark"] .alert.alert-light a { color: #a7ceff; }
:root[data-dh-theme="dark"] .dh-public-booking-journey__step {
    background: var(--dh-surface-alt);
    border-color: var(--dh-border);
    color: var(--dh-ink-soft);
}
:root[data-dh-theme="dark"] .dh-public-booking-journey__step:is(:hover, :focus-visible, [aria-current="step"]) {
    background: #4d401c;
    border-color: #d9a638;
    color: var(--dh-ink);
}
:root[data-dh-theme="dark"] .dh-service-picker__meta {
    background: linear-gradient(90deg, rgba(23, 38, 55, 0), #172637 24%);
    border-color: var(--dh-border);
    color: var(--dh-ink-soft);
}
:root[data-dh-theme="dark"] .dh-public-booking-overview {
    background: linear-gradient(180deg, #1b2a3a, #233448);
}
:root[data-dh-theme="dark"] .dh-public-booking-overview__heading > span {
    color: #f6d17b;
}
:root[data-dh-theme="dark"] .dh-public-booking-overview__item {
    background: #233448;
    border: 1px solid var(--dh-border);
}
:root[data-dh-theme="dark"] .dh-public-booking-overview__item.is-complete {
    background: linear-gradient(145deg, #2a3c4f, #263748);
    box-shadow: inset 3px 0 0 #f6d17b;
}
:root[data-dh-theme="dark"] .dh-public-booking-consent-card {
    background: linear-gradient(145deg, #233448, #1b2a3a);
    border-color: var(--dh-border);
    color: var(--dh-ink);
}
:root[data-dh-theme="dark"] .dh-public-booking-consent-preferences {
    border-color: var(--dh-border);
}
:root[data-dh-theme="dark"] .dh-public-booking-consent-preferences > summary::after {
    background: #4d401c;
    color: #f6d17b;
}

/* Gift offers ship with inline light gradients; keep actual cover artwork intact. */
:root[data-dh-theme="dark"] .dh-public-gift-section .dh-gift-steps { color: var(--dh-ink-soft); }
:root[data-dh-theme="dark"] .dh-public-gift-section .dh-gift-offer-card:not(.has-cover-image) {
    background-image: linear-gradient(150deg, #1b2a3a, #233448) !important;
}
:root[data-dh-theme="dark"] .dh-public-gift-section .dh-gift-offer-price { color: #f6d17b; }
:root[data-dh-theme="dark"] .dh-public-gift-section .dh-gift-offer-card .dh-badge.success {
    background: #1b4f42;
    color: #c5f7da;
}

/* Public tenant home: map fallback and the light CTA are deliberate exceptions. */
:root[data-dh-theme="dark"] .dh-location-map-fallback-empty {
    background: var(--dh-surface-alt);
    color: var(--dh-ink);
}
:root[data-dh-theme="dark"] .dh-location-map-fallback-label {
    background: #25384c;
    border-color: var(--dh-border);
    color: var(--dh-ink);
}
:root[data-dh-theme="dark"] .dh-cta-card-dark .btn-light.text-dark { color: #17243b !important; }
