/* One surface palette; business themes choose accents independently. */
html:root[data-unified-appearance=true]{color-scheme:dark;--appearance-bg:#202428;--appearance-panel:#2b3036;--appearance-text:#f5f5f5;--appearance-muted:#c2c7ce;--appearance-line:#505861;--appearance-accent:#f5f5f5}
html:root[data-unified-appearance=true][data-mode=light]{color-scheme:light;--appearance-bg:#f5f8fc;--appearance-panel:#fff;--appearance-text:#132c47;--appearance-muted:#4a6078;--appearance-line:#d4dfeb;--appearance-accent:#315b89}
html:root[data-unified-appearance=true]{--bg:var(--appearance-bg)!important;--card:var(--appearance-panel)!important;--panel:var(--appearance-panel)!important;--text:var(--appearance-text)!important;--white:var(--appearance-text)!important;--muted:var(--appearance-muted)!important;--line:var(--appearance-line)!important;--company-bg:var(--appearance-bg)!important;--company-surface:var(--appearance-panel)!important;--mobile-bg:var(--appearance-bg)!important;--mobile-card:var(--appearance-panel)!important;--mobile-text:var(--appearance-text)!important;--mobile-muted:var(--appearance-muted)!important;--mobile-border:var(--appearance-line)!important}
html:root[data-unified-appearance=true] body{background:var(--appearance-bg);color:var(--appearance-text)}
html:root[data-unified-appearance=true] body #loginScreen,html:root[data-unified-appearance=true] body .app-shell,html:root[data-unified-appearance=true] body .app-shell main{background:var(--appearance-bg)!important;background-image:none!important;color:var(--appearance-text)!important}
html:root[data-unified-appearance=true] #loginScreen::before,html:root[data-unified-appearance=true] #loginScreen::after{display:none!important}
html:root[data-unified-appearance=true] body :is(.login-card,.sidebar,.topbar,.card,dialog,.workspace-theme-controls){background:var(--appearance-panel)!important;background-image:none!important;border-color:var(--appearance-line)!important;color:var(--appearance-text)!important}
html:root[data-unified-appearance=true] body #loginScreen .login-card{box-shadow:0 24px 70px #0002}
html:root[data-unified-appearance=true] body :is(.sidebar,.topbar,.login-card) :is(h1,h2,h3,label,legend,.login-product-title,.signup-heading){color:var(--appearance-text)!important}
html:root[data-unified-appearance=true] body :is(.muted,.step-description,.signup-footer,.login-subtitle,.sidebar .brand-subtitle){color:var(--appearance-muted)!important}
html:root[data-unified-appearance=true] body :is(.app-shell,#loginScreen,dialog) :is(input:not([type=checkbox]):not([type=radio]):not([type=color]),select,textarea){background:var(--appearance-bg)!important;color:var(--appearance-text)!important;border-color:var(--appearance-line)!important}
html:root[data-unified-appearance=true] body :is(.entry-home,.login-mode-toggle,#loginScreen button.secondary){background:var(--appearance-panel)!important;border-color:var(--appearance-line)!important;color:var(--appearance-text)!important}
html:root[data-unified-appearance=true] body #loginScreen :is(button.primary,.login-card button[type=submit]){background:var(--appearance-accent)!important;border-color:var(--appearance-accent)!important;color:var(--appearance-bg)!important;box-shadow:none!important}
html:root[data-unified-appearance=true][data-mode=light] body #loginScreen :is(button.primary,.login-card button[type=submit]){color:#fff!important}
html:root[data-unified-appearance=true] body #loginScreen a{color:var(--appearance-text)!important}
html:root[data-unified-appearance=true] body #loginScreen :is(button,input,select,a):focus-visible{outline:2px solid var(--appearance-accent)!important;outline-offset:3px;box-shadow:none!important}
html:root[data-unified-appearance=true] .signup-progress li{color:var(--appearance-muted)!important;border-color:var(--appearance-line)!important}
html:root[data-unified-appearance=true] .signup-progress li:is([aria-current=step],[data-complete=true]){color:var(--appearance-text)!important;border-color:var(--appearance-accent)!important}
html:root[data-unified-appearance=true] body .sidebar :is(a,button,.nav-item){color:var(--appearance-text)!important}
html:root[data-unified-appearance=true] body .sidebar :is(a,button,.nav-item):is(.active,[aria-current=page]){background:var(--company-accent,var(--appearance-accent))!important;color:var(--theme-on-accent,#202428)!important}
html:root[data-unified-appearance=true] body .app-shell :is(th,td){border-color:var(--appearance-line)!important;color:var(--appearance-text)!important}
html:root[data-unified-appearance=true] body .app-shell th{background:var(--appearance-panel)!important}
/* Retain legacy custom values for compatibility; base surfaces follow mode. */
html[data-unified-appearance=true] label:has(>#companyThemeBackground),html[data-unified-appearance=true] label:has(>#companyThemeSurface){display:none!important}
.feature-new{display:inline-block;margin-bottom:14px;padding:5px 12px;border:1px solid #167d8d;border-radius:999px;font-size:12px;font-weight:800;letter-spacing:.12em;color:var(--white);background:var(--panel)}

.onboarding-tasks{padding-left:24px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 24px}.onboarding-tasks li{padding:6px}.onboarding-tasks p{margin:8px 0;line-height:1.6}.onboarding-confirm{display:flex;gap:10px;align-items:flex-start;margin:16px 0}.onboarding-confirm input{flex:0 0 auto;margin-top:3px}@media(max-width:700px){.onboarding-tasks{grid-template-columns:1fr}.onboarding-guide .row-actions{flex-wrap:wrap}}
/* Remove the login mark's black plate; screen blends any raster black into charcoal. */
html:root[data-unified-appearance=true] #loginScreen .login-rwm-mark{background:transparent!important}
html:root[data-unified-appearance=true][data-mode=dark] #loginScreen .login-rwm-mark .login-logo-dark{mix-blend-mode:screen}
/* Legacy settings and mobile tokens must follow display mode too. */
html:root[data-unified-appearance=true]{--mobile-ink:var(--appearance-text)!important;--mobile-line:var(--appearance-line)!important;--settings-surface:var(--appearance-panel)!important;--settings-ink:var(--appearance-text)!important;--settings-muted:var(--appearance-muted)!important;--settings-border:var(--appearance-line)!important;--settings-soft:var(--appearance-panel)!important;--ui-accent-soft:var(--appearance-panel)!important;--ui-accent-ink:var(--appearance-text)!important;--dark:var(--appearance-bg)!important}
html:root[data-unified-appearance=true][data-company-theme=lime][data-mode=light]{color-scheme:light;--appearance-bg:#fff;--appearance-panel:#fff;--appearance-text:#243024;--appearance-muted:#596659;--appearance-line:#dce5d6;--company-accent:#397600!important;--ui-accent:#397600!important;--accent:#397600!important;--settings-accent:#397600!important;--theme-on-accent:#fff!important;--shadow:0 6px 24px #2430240a!important}
html:root[data-unified-appearance=true][data-company-theme=lime][data-mode=light] body,html:root[data-unified-appearance=true][data-company-theme=lime][data-mode=light] body .app-shell{background:#fff!important;color:var(--appearance-text)!important}
html:root[data-unified-appearance=true][data-company-theme=lime][data-mode=light] body .app-shell main{background-color:#fff!important;background-image:linear-gradient(115deg,transparent 27%,#99d54c26 27.05%,transparent 27.15%),linear-gradient(115deg,transparent 76%,#99d54c1c 76.05%,transparent 76.15%)!important;background-attachment:fixed}
html:root[data-unified-appearance=true][data-company-theme=lime][data-mode=light] body :is(.sidebar,.topbar,.card,.kpi,.dashboard-team-member,.toolbar-card,.dialog-card,.company-switcher-wrap,.workspace-theme-choice,.daily-team-empty-slot,.daily-team-active-1,.rwm-calendar-day.has-work){background:#fff!important;background-image:none!important;color:var(--appearance-text)!important;border-color:var(--appearance-line)!important;box-shadow:0 4px 18px #24302408}
html:root[data-unified-appearance=true][data-company-theme=lime][data-mode=light] body .sidebar :is(.nav-btn,.nav-group-toggle,.theme-toggle-btn,.workspace-identity,.brand span,.sidebar-note),html:root[data-unified-appearance=true][data-company-theme=lime][data-mode=light] body :is(.card,.kpi,.dashboard-team-member,.topbar) :is(h1,h2,h3,.label,.page-trail,.page-trail button){color:var(--appearance-text)!important}
html:root[data-unified-appearance=true][data-company-theme=lime][data-mode=light] body :is(.muted,.small,.sub,.workspace-identity .muted,.company-switcher-wrap label){color:var(--appearance-muted)!important}
html:root[data-unified-appearance=true][data-company-theme=lime][data-mode=light] body .app-shell :is(.primary,.secondary){background:#fff!important;background-image:none!important;color:#397600!important;border:1px solid #99d54c!important;box-shadow:none!important}
html:root[data-unified-appearance=true][data-company-theme=lime][data-mode=light] body .sidebar .nav-btn:is(.active,:hover){background:#fff!important;color:#397600!important;border-left-color:#99d54c!important;box-shadow:inset 3px 0 0 #99d54c!important}
html:root[data-unified-appearance=true][data-company-theme=lime][data-mode=light] body .app-shell :is(.kpi .value,.dashboard-team-member .value,.team-member-day-share,.team-member-jobs,.team-member-job-count){color:#397600!important}
html:root[data-unified-appearance=true][data-company-theme=lime][data-mode=light] body .app-shell .kpi{border-top:2px solid #99d54c!important}
html:root[data-unified-appearance=true][data-company-theme=lime][data-mode=light] body dialog[id] .section-head:first-child{background:#fff!important;border-bottom-color:#99d54c!important}
html:root[data-unified-appearance=true][data-company-theme=lime][data-mode=light] body :is(input,select,textarea,button,a):focus-visible{outline-color:#397600!important}
/* Contrast-preserving metallic master brand; uploaded company logos remain untouched. */
.group-footer-light{display:none}
html[data-mode=light] .group-footer-dark{display:none}
html[data-mode=light] .group-footer-light{display:block}
html[data-mode=light] .powered-by-rwm{color:var(--appearance-muted)!important}
html[data-mode=light] #loginScreen .login-rwm-mark .login-logo-light{filter:none!important;mix-blend-mode:normal!important}
/* Calendar accents distinguish neutral Graphite from Midnight Blue. State colours stay independent. */
html:root[data-unified-appearance=true][data-company-theme=graphite]{--calendar-idle:#2b3036;--calendar-work:#3b4248;--calendar-border:#697078;--calendar-ink:#f5f5f5}
html:root[data-unified-appearance=true][data-company-theme=graphite][data-mode=light]{--calendar-idle:#fafafa;--calendar-work:#e9ebed;--calendar-border:#a4aab0;--calendar-ink:#30363c;--company-accent:#4b5563!important;--ui-accent:#4b5563!important;--accent:#4b5563!important;--settings-accent:#4b5563!important}
html:root[data-unified-appearance=true][data-company-theme=midnight]{--calendar-idle:#2b3036;--calendar-work:#273f59;--calendar-border:#65a8ff;--calendar-ink:#f5f5f5}
html:root[data-unified-appearance=true][data-company-theme=midnight][data-mode=light]{--calendar-idle:#fafcff;--calendar-work:#e4effd;--calendar-border:#8baed5;--calendar-ink:#173d6a}
html:root[data-unified-appearance=true]:is([data-company-theme=graphite],[data-company-theme=midnight]) body #calendarView .rwm-calendar-day:is(.calendar-empty-day,.calendar-open-day):not(.calendar-paid-day):not(.calendar-unpaid-day):not(.calendar-due-day):not(.calendar-overdue-day):not(.calendar-complete-day):not(.rainy-day):not(.weather-day){background:var(--calendar-idle)!important;border-color:var(--calendar-border)!important;color:var(--calendar-ink)!important}
html:root[data-unified-appearance=true]:is([data-company-theme=graphite],[data-company-theme=midnight]) body #calendarView .rwm-calendar-day.calendar-open-day:not(.calendar-paid-day):not(.calendar-unpaid-day):not(.calendar-due-day):not(.calendar-overdue-day):not(.calendar-complete-day):not(.rainy-day):not(.weather-day){background:var(--calendar-work)!important}
html:root[data-unified-appearance=true][data-company-theme=graphite] body .sidebar .nav-btn.active{background:var(--calendar-work)!important;color:var(--calendar-ink)!important;border-left-color:var(--company-accent)!important}
/* Field job view: clearer hierarchy and comfortable, touch-friendly controls. */
#workerJobView{max-width:1040px;margin-inline:auto;padding-bottom:28px}
#workerJobView .job-eyebrow{font-size:11px;letter-spacing:.16em;font-weight:750;color:var(--company-accent);margin:12px 0}
#workerJobView>.section-head{margin-bottom:22px}
#workerJobView #workerJobCustomer{font-size:clamp(26px,4vw,38px);letter-spacing:-.025em;margin:14px 0 8px}
#workerJobView #workerJobAddress{line-height:1.6;margin:0;font-size:15px}
#workerJobView .card{padding:24px;border-radius:20px;margin-bottom:18px;border:1px solid var(--line);box-shadow:0 8px 28px #00000008}
#workerJobView .card h3{font-size:19px;margin:0 0 16px}
#workerJobView .job-overview-card{display:flex;align-items:center;gap:24px;flex-wrap:wrap}
#workerJobView .job-overview-card p{margin:0;display:flex;gap:10px;align-items:center}
#workerJobView #workerJobStatus{display:inline-block;padding:7px 12px;border:1px solid var(--line);border-radius:999px;font-size:13px;font-weight:650}
#workerJobView .job-workflow-strip{display:flex;flex-wrap:wrap;gap:10px;margin:20px 0}
#workerJobView .job-workflow-strip span{padding:10px 14px;border:1px solid var(--line);border-radius:999px;color:var(--muted);font-size:12px}
#workerJobView :is(label,textarea,input,select,button){font:inherit}
#workerJobView label{display:grid;gap:9px;margin-bottom:18px;font-size:14px;font-weight:600}
#workerJobView :is(textarea,input,select){border-radius:12px;padding:13px 14px;min-height:48px;max-width:100%;box-sizing:border-box}
#workerJobView .worker-job-instructions-display{padding:18px;border:1px solid var(--line);border-radius:14px;line-height:1.7;background:var(--bg)}
#workerJobView .worker-photo-gallery{display:grid;grid-template-columns:repeat(auto-fit,minmax(100px,1fr));gap:12px;margin:16px 0}
#workerJobView input[type=file]{width:100%;border:1px dashed var(--line);padding:18px}
#workerJobView input[type=file]::file-selector-button{border:1px solid var(--line);background:var(--card);color:var(--text);padding:10px 14px;border-radius:9px;margin-right:12px;cursor:pointer}
#workerJobView :is(.primary,.secondary,.worker-route-back-btn){border-radius:12px;min-height:48px;padding:13px 20px;font-weight:650;line-height:1.35}
#workerJobView .worker-recommended-work{padding-top:24px;margin-top:24px;border-top:1px solid var(--line)}
#workerJobView #workerCompleteNoPhotosBtn{margin:12px 0 0 10px}
#scheduleJobDialog{width:min(760px,calc(100vw - 28px));max-height:90dvh;padding:0;border-radius:22px;border:1px solid var(--line);box-shadow:0 24px 90px #0004}
#scheduleJobDialog::backdrop{background:#11182766;backdrop-filter:blur(3px)}
#scheduleJobDialog .dialog-card{padding:28px;border-radius:22px}
#scheduleJobDialog .section-head{margin-bottom:22px;padding-bottom:18px;border-bottom:1px solid var(--line)}
#scheduleJobDialog h2{font-size:27px;letter-spacing:-.02em;margin:0 0 8px}
#scheduleJobDialog .form-grid{gap:18px;margin:20px 0}
#scheduleJobDialog label{font-size:13px;font-weight:650;display:grid;gap:8px}
#scheduleJobDialog :is(input:not([type=checkbox]),select,textarea){padding:12px 14px;border:1px solid var(--line);border-radius:12px;min-height:48px;font:inherit;box-sizing:border-box;width:100%}
#scheduleJobDialog .quick-job-toggle{display:flex;align-items:center;gap:10px;padding:14px;border:1px solid var(--line);border-radius:12px;margin-bottom:20px}
#scheduleJobDialog .dialog-actions{margin-top:24px;padding-top:20px;border-top:1px solid var(--line);gap:12px}
#scheduleJobDialog .dialog-actions button{border-radius:12px;min-height:48px;padding:12px 22px}
@media(max-width:600px){#workerJobView .card,#scheduleJobDialog .dialog-card{padding:18px}#workerJobView .job-overview-card{gap:14px}#workerJobView .job-workflow-strip{gap:6px}#workerJobView .job-workflow-strip span{font-size:11px;padding:9px}#workerJobView :is(.primary,.secondary){width:100%}#workerJobView #workerCompleteNoPhotosBtn{margin:12px 0 0}#scheduleJobDialog .form-grid{grid-template-columns:1fr}#scheduleJobDialog .dialog-actions{flex-wrap:wrap}}

/* Explicit registration CTA contrast overrides general login link colours. */
html:root[data-unified-appearance=true][data-mode=dark] body #loginScreen #registerContractorLink{background:#f5f5f5!important;color:#202428!important;border:1px solid #f5f5f5!important;font-weight:700}
html:root[data-unified-appearance=true][data-mode=light] body #loginScreen #registerContractorLink{background:#315b89!important;color:#fff!important;border:1px solid #315b89!important;font-weight:700}

/* Status rows have light fills even in dark mode: use dark ink, independent of page text. */
html:root[data-unified-appearance=true][data-company-theme=graphite] body :is(#customersBody,#nextDueBody) tr td{color:#243024!important}
html:root[data-unified-appearance=true][data-company-theme=graphite] body :is(#customersBody,#nextDueBody) tr td :is(strong,.money){color:#243024!important}
html:root[data-unified-appearance=true][data-company-theme=graphite] body :is(#customersBody,#nextDueBody) tr td :is(.muted,small){color:#465246!important}
html:root[data-unified-appearance=true][data-company-theme=graphite] body :is(#customersBody,#nextDueBody) tr td button.mini{background:#fff!important;color:#374151!important;border:1px solid #aeb6bf!important}

/* Completion status rows keep pale semantic fills in every mode: pair them with dark ink. */
html:root[data-unified-appearance=true] body #historyBody tr:is(.history-paid,.history-unpaid) td,
html:root[data-unified-appearance=true] body #historyBody tr:is(.history-paid,.history-unpaid) td :is(strong,a,.small){color:#243024!important}
html:root[data-unified-appearance=true] body #historyBody tr:is(.history-paid,.history-unpaid) td :is(.muted,small){color:#465246!important}
html:root[data-unified-appearance=true] body #historyBody tr:is(.history-paid,.history-unpaid) td button{background:#fff!important;color:#26343c!important;border:1px solid #9ba6ad!important}

/* Completion actions: status above a stable two-by-two button grid. */
html:root[data-unified-appearance=true] body #historyBody td .row-actions{
 display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px!important;
 width:190px;max-width:none;margin:0 auto;align-items:stretch!important;justify-content:normal!important;
}
html:root[data-unified-appearance=true] body #historyBody td .row-actions>strong{
 grid-column:1/-1;text-align:left;font-size:12px;line-height:1.4;margin:0 0 2px;
}
html:root[data-unified-appearance=true] body #historyBody td .row-actions>button{
 width:100%;min-width:0;min-height:34px;margin:0!important;padding:6px 9px!important;
 box-sizing:border-box;font-size:12px;line-height:1.3;white-space:nowrap;border-radius:8px;
}

/* Customer status fills remain pale regardless of accent: use stable dark ink. */
html:root[data-unified-appearance=true] body :is(#customersBody,#nextDueBody) tr td,
html:root[data-unified-appearance=true] body :is(#customersBody,#nextDueBody) tr td :is(strong,a){color:#243446!important}
html:root[data-unified-appearance=true] body :is(#customersBody,#nextDueBody) tr td :is(.muted,.small,small){color:#4b5b69!important}
html:root[data-unified-appearance=true] body #historyBody tr.history-paid{background:#b8e3c4!important}
html:root[data-unified-appearance=true] body #historyBody tr.history-paid td{background:#b8e3c4!important}
.job-progress-controls{display:flex;flex-wrap:wrap;gap:10px;margin:16px 0}.job-progress-controls button{min-height:44px}

/* WCAG AA contrast fixes (Oct 2026): light-mode readability across all themes. */
html:root[data-unified-appearance=true][data-company-theme=lime][data-mode=light] body :is(#customersBody,#nextDueBody,#historyBody) tr .primary,
html:root[data-unified-appearance=true][data-company-theme=lime][data-mode=light] body .dashboard-recent-row .primary{color:#397600!important}
html[data-mode=light] .assistant-launcher{background:#1f2937;color:#fff;border-color:#1f2937}
html[data-mode=light] .sidebar-note{color:#5b6472}
html[data-mode=light] .calendar-day-meta{color:#3f4a44}
html[data-company-theme] body :is(#customersBody,#nextDueBody,#historyBody) tr .primary,html[data-company-theme] body .dashboard-recent-row .primary{color:var(--theme-on-accent,#fff)!important}
html[data-mode=dark] body span.dashboard-customer-link{color:#c9ced6!important}
html[data-mode=dark] body #customersBody tr .complete-one{background:#1f2937!important;color:#fff!important;border-color:#1f2937!important}
/* Mobile light mode: sidebar panel is light, so nav text must use the light-mode ink (was #e4edf6 on white). */
@media(max-width:768px){
html:root[data-unified-appearance=true][data-company-theme][data-mode=light] body .sidebar :is(.nav-btn,.nav-group-toggle,.theme-toggle-btn,.workspace-identity,.brand span,.sidebar-note,summary):not(.active){color:var(--appearance-text)!important}
html:root[data-unified-appearance=true][data-company-theme][data-mode=light] body .sidebar .workspace-identity .muted{color:var(--appearance-muted)!important}
}
