/* Dark palette is screen-only. Do not invert images, signed text or print colors. */
.theme-settings label{max-width:360px}.theme-settings .theme-status{min-height:1.45em;margin-bottom:0;font-size:.9rem}
@media screen{
 :root[data-theme=light]{color-scheme:light}
 :root[data-theme=dark]{color-scheme:dark;--bg:#131923!important;--ink:#e7eaf0;--muted:#b1bdcf;--line:#46546a;--accent:#c393e0!important;--on-accent:#23132c!important;--panel:#1e2735;--dark-raised:#283447;color:var(--ink);background:var(--bg)}
 :root[data-theme=dark] body,:root[data-theme=dark] .workspace{background:var(--bg);color:var(--ink)}
 :root[data-theme=dark] :is(.workspace>header,.shell>aside,.panel,.table-wrap,.login,dialog,.rich-toolbar,.messenger-float-window,.messenger-float-window header,.dialog-topbar,.calendar-studio,.messenger-conversation,.fullscreen .shift-palette,.fullscreen .roster-focusbar){background:var(--panel);color:var(--ink);border-color:var(--line)}
 :root[data-theme=dark] :is(button,a.button){background:var(--dark-raised);color:var(--ink);border-color:var(--line)}
 :root[data-theme=dark] :is(button,a.button):not(.primary):not(.active):not(.calendar-span-event):not(.calendar-date):not(.messenger-bubble):not(.tile):not([style*="background"]){background-color:var(--dark-raised);color:var(--ink)}
 :root[data-theme=dark] :is(button,a.button):hover{background:#35445c;border-color:var(--accent)}
 :root[data-theme=dark] :is(button.primary,.primary,a.button.primary,.messenger-bubble){background:var(--accent);color:var(--on-accent);border-color:var(--accent)}
 :root[data-theme=dark] button.primary:hover{background:#d2a8ec}
 :root[data-theme=dark] :is(input,select,textarea,.rich-editor){background:#151e2b;color:var(--ink);border-color:#71819a}
 :root[data-theme=dark] :is(input,textarea)::placeholder{color:#a7b4c8;opacity:1}
 :root[data-theme=dark] input[type=checkbox]{accent-color:var(--accent)}
 :root[data-theme=dark] input[type=color]{padding:3px}
 :root[data-theme=dark] :is(a,.brand,.balance,.calendar-eyebrow){color:var(--accent)}
 :root[data-theme=dark] :is(.muted,.nav-section h2,.message-item small,.calendar-weekday,.calendar-count,.calendar-more,.calendar-hint,.leave-weekday,.inactive-menu summary,.inactive-settings summary){color:var(--muted)}
 :root[data-theme=dark] :is(th,.roster th:first-child,.roster td:first-child,.absence-grid th:first-child,.absence-grid td:first-child){background:#293649;color:var(--ink);border-color:var(--line)}
 :root[data-theme=dark] :is(td,.record-field,.daily-task,.help-steps section,.master-form-heading){border-color:var(--line)}
 :root[data-theme=dark] tr:nth-child(even) td{background:#222e3e}
 :root[data-theme=dark] :is(nav button,.mobile-nav button){background:transparent;color:var(--ink)}
 :root[data-theme=dark] :is(nav button.active,.mobile-nav button.active,.calendar-modes button.primary){background:#503565;color:#f3e8fa}
 :root[data-theme=dark] :is(.badge,.calendar-badges span,.today-events .event-count,.secret,.today-duty,.rich-toggle,.calendar-modes){background:#352c47;color:#e8d1f6}
 :root[data-theme=dark] :is(.form-tiles .tile,.tile){background:var(--dark-raised);color:var(--ink);border-color:var(--line)}
 :root[data-theme=dark] .tile[style*="background"]{background:var(--dark-raised)!important;color:var(--ink)!important}
 :root[data-theme=dark] :is(.team-note,.preview-banner,.demo-banner,.test-banner){background:#3c3423;color:#f6df9d;border-color:#ab8d46}
 :root[data-theme=dark] :is(.direct-settings,.messenger-sidebar,.calendar-day-detail){background:#222f3f;color:var(--ink);border-color:var(--line)}
 :root[data-theme=dark] :is(.message-item,.calendar-card){background:#253347;color:var(--ink);border-color:var(--line)}
 :root[data-theme=dark] .calendar-card{border-left-color:var(--event-color)}
 :root[data-theme=dark] .message-item.is-own{background:#3b2f4b;border-color:#80618f}
 :root[data-theme=dark] :is(.sticky-actions,dialog form>.actions,.inline-sign-question){background:#222c3b;color:var(--ink);border-color:var(--line)}
 :root[data-theme=dark] .cash-actions{background:transparent}
 :root[data-theme=dark] .calendar-date{background:#263448;color:var(--ink);border-color:#53657e}
 :root[data-theme=dark] .calendar-date:hover{background:#33465f}
 :root[data-theme=dark] .calendar-date.is-selected{background:#473354;border-color:var(--accent)}
 :root[data-theme=dark] .calendar-date.is-today .calendar-date-number{background:var(--accent);color:var(--on-accent)}
 :root[data-theme=dark] .calendar-span-event{background:color-mix(in srgb,var(--event-color) 25%,#202b3b)!important;color:#f3f5fa;border-color:var(--event-color)}
 :root[data-theme=dark] .calendar-mini-event{color:var(--ink)!important}
 :root[data-theme=dark] .calendar-mini-event[style*="background"]{background:transparent!important}
 :root[data-theme=dark] .calendar-count{background:transparent}
 :root[data-theme=dark] :is(.compact-app-menu>summary,.roster-focusbar,.mobile-clock){background:var(--dark-raised);color:var(--ink);border-color:var(--line)}
 :root[data-theme=dark] :is(.error,.mobile-error){color:#ffb2bd}
 :root[data-theme=dark] .daily-task.done .task-state{color:#9de4b8}
 :root[data-theme=dark] .daily-task.open .task-state{color:#f2d18f}
 :root[data-theme=dark] .daily-task.not_required .task-state{color:var(--muted)}
 :root[data-theme=dark] .absence-tag{background:#33445a;color:#e8eef7}
 :root[data-theme=dark] .absence-tag.approved{background:#254337;color:#aef0cb}
 :root[data-theme=dark] :is(.absence-tag.pending,.absence-tag.planned){background:#493e24;color:#ffe4a5}
 :root[data-theme=dark] .absence-tag.wish{background:#443257;color:#ead2ff}
 :root[data-theme=dark] .absence-tag.conflict{background:#50342b;color:#ffd3bd}
 :root[data-theme=dark] .paused-module{background:#343d4c!important;color:#c4cede!important;border-color:#8290a6!important}
 :root[data-theme=dark] #save-status{background:#263a32;color:#b6f2d0;border-color:#608d75}
 :root[data-theme=dark] #save-status[data-state=dirty]{background:#493b25;color:#ffe1a0;border-color:#a38a50}
 :root[data-theme=dark] #save-status[data-state=error]{background:#4b2933;color:#ffd1d9;border-color:#bb7281}
 :root[data-theme=dark] #notice{background:#e3e8f0;color:#152033;border:1px solid #b0c0d5}
 :root[data-theme=dark] :focus-visible{outline:2px solid #ddb4f4;outline-offset:3px}
 :root[data-theme=dark] dialog::backdrop{background:#050a12b8}
}
@media print{
 :root[data-theme]{color-scheme:light;--bg:#fff!important;--ink:#000;--muted:#444;--line:#bbb;--accent:#79348c!important;--on-accent:#fff!important;color:#000;background:#fff}
 .theme-settings{display:none!important}
}
@media screen{
 :root[data-theme=dark] .messenger-layout{--chat-surface:#1e2735;--chat-soft:#283745;--chat-avatar:#43344f;--chat-own:#3b304b}
 :root[data-theme=dark] .messenger-sidebar .chat-contact:not(.primary):not(.active){background:transparent;color:var(--ink)}
 :root[data-theme=dark] .messenger-sidebar .chat-contact:not(.primary):not(.active):hover{background:var(--chat-soft)}
 :root[data-theme=dark] .messenger-sidebar .chat-contact.is-selected:not(.primary):not(.active){background:var(--chat-avatar)}
}
