/* Shared theme surfaces for Radix portals, work orders and account tools. */
html[data-creative-theme] .theme-surface .work-submit-title{background:var(--ui-hover);color:var(--ui-text);border-color:var(--ui-line)}
html[data-creative-theme] .theme-surface .work-submit-frozen{color:var(--ui-muted)}
html[data-creative-theme] :is(.theme-surface,.planner-context-menu,.reminder-popup,[data-slot=popover-content],[data-slot=dropdown-menu-content]){background:var(--ui-panel);color:var(--ui-text);border-color:var(--ui-line);color-scheme:normal}
html[data-creative-tone=dark] :is(.theme-surface,.planner-context-menu,.reminder-popup,[data-slot=popover-content],[data-slot=dropdown-menu-content]){color-scheme:dark}
html[data-creative-theme] .theme-surface.work-type-panel{background:var(--ui-panel)!important;color:var(--ui-text)!important;border-color:var(--ui-line)!important;box-shadow:-12px 0 35px #00000026!important}
html[data-creative-theme] .theme-surface :is([data-slot=sheet-title],[data-slot=dialog-title],h2,h3,h4,legend){color:var(--ui-text)}
html[data-creative-theme] .theme-surface :is([data-slot=sheet-description],[data-slot=dialog-description],label,.form-note,.dental-note,.dental-label,.production-hint,.production-unit,.production-model-jaw,.production-part-jaw,.photo-hint,.pay-help,.pay-reason,.pay-unresolved,.storage-hint,.storage-empty,.order-photo-heading small,.type-scope,.type-tooth-group>span,.implant-options p,.implant-options>h4,.type-group-jaw,.type-save-status,.personal-due,.exocad-launch p,.design-handoff p,.handoff-card small,.work-file-size,.earnings-unpriced-note){color:var(--ui-muted)}
html[data-creative-theme] .theme-surface :is(input:not([type=checkbox]):not([type=radio]):not([type=color]),select,textarea){background:var(--ui-hover);color:var(--ui-text);border-color:var(--ui-line);box-shadow:none}
html[data-creative-theme] .theme-surface :is(input,textarea)::placeholder{color:var(--ui-muted);opacity:.85}
html[data-creative-theme] .theme-surface :is(input,select,textarea,button):focus-visible{outline-color:var(--ui-accent)}
html[data-creative-theme] .theme-surface :is(input[type=checkbox],input[type=radio]){accent-color:var(--ui-accent)}
html[data-creative-theme] .theme-surface option{background:var(--ui-panel);color:var(--ui-text)}
html[data-creative-theme] .theme-surface :is(.dental-order,.order-production,.order-photo,.exocad-launch,.design-handoff,.production-queue,.handoff-card,.handoff-upload,.painting-stage,.work-files,.work-file,.work-pay,.earnings-view,.earnings-password-card,.earnings-item,.earnings-total,.implant-options,.type-tooth-group,.type-search,.tooth-material-summary,.navigation-guides,.type-group-formula,.pay-production-config,.pay-monthly-config,.pay-binding-editor,.storage-project,.storage-totals>div,.settings-status,.calendar-checklist,.calendar-work-files){background:var(--ui-panel);color:var(--ui-text);border-color:var(--ui-line)}
html[data-creative-theme] .theme-surface :is(.sheet-owner,.production-row,.production-stage,.production-model-choice,.production-part-choice,.type-group-row,.pay-monthly-row,.pay-binding-row,.pay-personnel-grid,.team-row,.storage-project-info,.selected-teeth>button,.tooth-type-summary>span,.tooth-material-summary>div,.order-urgency,.type-apply-status,.earnings-breakdown,.earnings-period,.pay-service-row){background:var(--ui-hover);color:var(--ui-text);border-color:var(--ui-line)}
html[data-creative-theme] .theme-surface :is(.sheet-body>pre,.sheet-body>p,.order-production h4,.dental-order-heading,.order-production legend,.production-section-heading h4,.production-row label,.production-stage label,.production-stage p,.work-files>header,.work-files>header small,.work-file-name,.work-pay h4,.pay-services h4,.pay-service-row label,.team-row small,.team-row label,.storage-project small,.earnings-heading p,.earnings-item small,.earnings-lines,.earnings-breakdown){color:var(--ui-text)}
html[data-creative-theme] .theme-surface :is(.solid-button,.order-save,.sheet-take-button,.exocad-launch-button,.exocad-launch>button,.handoff-actions .solid-button,.custom-work-type button[type=submit]){background:var(--ui-accent);color:var(--ui-on-accent,var(--ui-panel));border-color:var(--ui-accent)}
html[data-creative-theme] .theme-surface :is(.quiet-button,.order-type-button,.clear-teeth,.order-production button,.custom-work-type button,.type-controls button,.type-group-row button,.selected-teeth>button,.jaw-select,.order-photos button,.work-files button,.team-rename button,.storage-filters button,.calendar-edit-actions .quiet-button,.earnings-lock-action){background:var(--ui-hover);color:var(--ui-accent-ink);border-color:var(--ui-line)}
html[data-creative-theme] .theme-surface>button{background:var(--ui-hover);color:var(--ui-muted)}
html[data-creative-theme] .theme-surface :is(.type-search,.implant-options,.type-tooth-group,.type-controls,.custom-work-type,.production-bar-details,.production-stage,.pay-services,.earnings-account,.calendar-work-files){border-color:var(--ui-line)}
html[data-creative-theme] .theme-surface :is(.type-search input,.type-group-formula,.mobile-chart-active){background:var(--ui-panel);color:var(--ui-text);border-color:var(--ui-line)}
html[data-creative-theme] .theme-surface :is(.type-group-row button[aria-pressed=true],.jaw-select[aria-pressed=true]){background:var(--ui-hover);color:var(--ui-accent-ink);border-color:var(--ui-accent)}
html[data-creative-theme] .theme-surface :is(.order-photo a,.order-photo-heading b,.work-files a,.calendar-work-files a,.handoff-files a,.team-row b,.storage-project h3,.earnings-total strong,.earnings-password-card h3,.pay-heading strong){color:var(--ui-accent-ink)}
html[data-creative-theme] .theme-surface :is(.handoff-files a,.storage-filters input,.type-save-status){background:var(--ui-hover);border-color:var(--ui-line)}
html[data-creative-theme] .theme-surface .dental-label textarea{background:var(--ui-hover);color:var(--ui-text);border-color:var(--ui-line)}
html[data-creative-theme] .theme-surface .work-type-group h3{color:var(--ui-muted)}
html[data-creative-theme] .theme-surface :is(.material-catalog button,.implant-option-grid button[data-implant-mode=none]){background:var(--ui-hover);color:var(--ui-text);border-color:var(--ui-line)}
html[data-creative-theme] .theme-surface .material-catalog button:hover{background:var(--ui-panel);border-color:var(--ui-accent)}
html[data-creative-theme] .theme-surface .implant-option-grid button[aria-pressed=true]{border-color:var(--ui-accent);box-shadow:0 0 0 2px var(--ui-panel) inset}
html[data-creative-theme] .theme-surface :is(.implant-options small,.jaw-label,.selected-teeth,.order-editor){color:var(--ui-muted)}
html[data-creative-theme] .theme-surface .tooth-row .tooth-selected:not([data-pontic=true]){background:var(--ui-hover);color:var(--ui-accent-ink)}
html[data-creative-theme] :is([data-slot=select-content],[data-slot=select-trigger]){background:var(--ui-hover);color:var(--ui-text);border-color:var(--ui-line)}
html[data-creative-theme] [data-slot=select-content] :is([data-slot=select-label],[data-slot=select-item]){color:var(--ui-text)}
html[data-creative-theme] [data-slot=select-item][data-highlighted]{background:var(--ui-panel);color:var(--ui-accent-ink)}
html[data-creative-theme] .theme-surface :is(.profile-name,.team-rename,.sheet-clinic,.clinic-picker-dropdown,.pay-rate-row,.pay-operation,.pay-legacy-managed,.order-photo-progress){background:var(--ui-hover);color:var(--ui-text);border-color:var(--ui-line)}
html[data-creative-theme] .theme-surface :is(.profile-name b,.profile-name p,.sheet-clinic b,.sheet-clinic span,.clinic-picker-trigger,.clinic-picker-options button,.clinic-picker-custom button,.pay-total strong,.pay-breakdown-line>b,.pay-service-amount,.earnings-item header>b){color:var(--ui-text)}
html[data-creative-theme] .theme-surface :is(.clinic-picker-trigger,.clinic-picker-options button){background:var(--ui-hover);border-color:var(--ui-line)}
html[data-creative-theme] .theme-surface :is(.pay-heading>small,.pay-help,.pay-teeth-hint,.pay-total>span,.pay-uncalculated,.pay-actions small,.pay-loading,.pay-snapshot-meta,.pay-operation-label small,.pay-breakdown-line small,.pay-service-row small,.earnings-total>span,.earnings-lines small,.earnings-empty,.earnings-loading,.earnings-password-card small,.earnings-lines>div){color:var(--ui-muted)}
html[data-creative-theme] .theme-surface :is(.pay-total,.pay-breakdown-line,.pay-binding-editor,.pay-production-config,.earnings-lines){border-color:var(--ui-line)}
/* Work type tiles retain their established colours and inline contrast text. */
html[data-creative-theme] .theme-surface .work-type-tile{border-color:transparent}
html[data-creative-theme] .theme-surface .work-type-tile[aria-pressed=true]{outline-color:var(--ui-accent);box-shadow:0 0 0 2px var(--ui-panel),0 0 0 4px var(--ui-accent)}
html[data-creative-theme] .planner-context-menu [role=menuitem]{color:var(--ui-text)}
html[data-creative-theme] .planner-context-menu [data-highlighted]{background:var(--ui-hover);color:var(--ui-accent-ink)}
html[data-creative-theme] .profile-version{padding:9px 12px 2px;border-top:1px solid var(--ui-line);font-size:10px;color:var(--ui-muted);line-height:1.5}
html[data-creative-theme] .profile-version p{margin:4px 0}
/* Urgent/error/delivery indicators keep their semantic colours, including in dark menus. */
html[data-creative-tone=dark] .theme-surface :is(.order-error,.pay-error,.type-save-error,.production-correction,.exocad-error,.earnings-error,.calendar-delete-confirm){background:#47282f;color:#ffd3db;border-color:#965366}
html[data-creative-tone=dark] .theme-surface .handoff-blocking-alert{background:#48292f;color:#ffd4d9;border-color:#c77885;border-left-color:#f18c98}
html[data-creative-tone=dark] .theme-surface .handoff-blocking-alert strong{color:#ffd4d9}
html[data-creative-tone=dark] .theme-surface .order-urgency[data-status=burned]{background:#111316;color:#fff}
html[data-creative-theme] .theme-surface .stl-viewer{background:var(--ui-panel);color:var(--ui-text);border-color:var(--ui-line)}
html[data-creative-theme] .theme-surface .stl-viewer button{background:var(--ui-hover);color:var(--ui-text);border-color:var(--ui-line)}
html[data-creative-theme] .theme-surface .calendar-search-results button{background:var(--ui-hover);color:var(--ui-text);border-color:var(--ui-line)}
html[data-creative-theme] .theme-surface .calendar-search-results button :is(b,small){color:var(--ui-text)}
html[data-creative-theme] .reminder-popup :is(button,b,p,small){color:var(--ui-text)}
html[data-creative-theme] .reminder-popup button{background:transparent;border-color:var(--ui-line)}
html[data-creative-tone=dark] .theme-surface :is(.form-error,.work-submit-error,.pay-blocking,.pay-unavailable,.clinic-picker-error,.storage-confirm){background:var(--ui-card-error);color:#ffd3db;border-color:var(--ui-mark-error)}

html[data-creative-tone=dark] .theme-surface .order-urgency[data-status=urgent]{background:var(--ui-card-error);color:var(--ui-text);border-color:var(--ui-mark-error)}
html[data-creative-tone=dark] .theme-surface .order-urgency[data-status=ready]{background:var(--ui-card-ready);color:var(--ui-text);border-color:var(--ui-mark-ready)}

/* Standalone password gates and small nested controls share the same palette. */
html[data-creative-theme] .theme-surface .earnings-password-card>svg{color:var(--ui-accent-ink)}
html[data-creative-theme] .theme-surface :is(.dental-order-heading span,.sheet-clinic,.sheet-clinic select,.calendar-checklist li,.order-photo-progress){background:var(--ui-hover);color:var(--ui-text);border-color:var(--ui-line)}
html[data-creative-theme] .theme-surface :is(.sheet-clinic b,.sheet-clinic span,.order-photo-progress span,.order-photo-progress small,.order-photo>span){color:var(--ui-muted)}
html[data-creative-theme] .theme-surface :is(.earnings-password-card .solid-button,.earnings-lock-action button){background:var(--ui-accent);color:var(--ui-on-accent);border-color:var(--ui-accent)}
html[data-creative-theme] .theme-surface :is(.calendar-delete-confirm button+button,.order-photo-progress button){background:var(--ui-hover);color:var(--ui-accent-ink);border-color:var(--ui-line)}
