/* Application UI and internal dialogs. Customer documents and print views stay unthemed. */
@media screen{
 html[data-theme="dark"]{color-scheme:dark;--blue:#83b8df;--blue-dark:#d4e8f6;--blue-soft:#17232f;--ink:#e3e7eb;--muted:#a4acb5;--line:#34383e;--bg:#08090b;--red:#ff8590}
 html[data-theme="dark"] body{background:#08090b!important;color:#e3e7eb!important}
 html[data-theme="dark"] body :is(main,.app-navigation,.app-admin-links,.settings,.editor,.offer-layout>aside,.mail-layout>aside,.phase,.project,.project-list,.project-heading,.project-head,.project-offer-list,.document-inspector,.document-tools,.offer-head,.offer-card,.mail-row,.message-detail,.compose,.mail-inbox-item,.mail-comments,.comment-entry,.search-progress,.calendar-task-pool,.calendar-pool-head,.calendar-pool-task,.calendar-mini-year,.calendar-month-day,.calendar-full-preview,dialog,.modal-content,.popup-content){background-color:#111316!important;color:#e3e7eb!important;border-color:#34383e!important}
 html[data-theme="dark"] body :is(h1,h2,h3,h4,label,.inspector-title,.message-body,.project-heading small,.offer-head small,.project-head small){color:#e3e7eb!important}
 html[data-theme="dark"] body :is(small,.muted,.calendar-hour-label,.calendar-day-unscheduled>small){color:#aab4bf}
 html[data-theme="dark"] body a:not(.calendar-appointment){color:#9bcaf0}
 html[data-theme="dark"] body :is(input,textarea,select):not([type="checkbox"]):not([type="radio"]):not(:where(.document-paper *)){background:#090b0e!important;color:#edf0f3!important;border-color:#454b54!important}
 html[data-theme="dark"] body ::placeholder{color:#a6adb7;opacity:1}
 html[data-theme="dark"] body :is(button,.button,a.secondary,.print-link,.app-tabs a,.app-admin-menu summary,.app-logout,.calendar-view-toolbar a){background:#1c2026!important;color:#dce8f2!important;border-color:#3d4651!important}
 html[data-theme="dark"] body :is(button,.button,.app-tabs a,.app-logout):hover{background:#2a3440!important}
 html[data-theme="dark"] body :is([aria-current="page"],.offer-link.active,.project.selected,.mail-row.selected){background:#18334a!important;color:#e8f4ff!important;border-color:#659ec7!important}
 html[data-theme="dark"] body :is(.phase header,.phase-head,.item-edit,.calculation-head,.text-library,.offer-voice-panel,.history-provenance,.mail-preview-bar,.project-offer-pinned){background:#1b2027!important;color:#dce8f2!important;border-color:#3b4653!important}
 html[data-theme="dark"] body :is(td,th,tr,.position,.task,.phase,.offer-settings,.document-tools,.offer-head){border-color:#34383e!important}
 html[data-theme="dark"] body .document-tools{box-shadow:0 -18px 0 #111316!important}
 html[data-theme="dark"] body .app-brand{background:transparent;border-radius:0;padding:4px 8px}
 html[data-theme="dark"] body .app-brand img{filter:invert(1) hue-rotate(180deg)}
 html[data-theme="dark"] body .app-theme-toggle{width:38px;height:38px;padding:0;font-size:21px}
 html[data-theme="dark"] body :is(.calendar-hour-cell,.calendar-day-unscheduled,.calendar-date){background-color:#11151b!important;color:#dce8f2!important;border-color:#303945!important}
 html[data-theme="dark"] body :is(.calendar-hour-cell.today,.calendar-date.today){background-color:#142333!important}
 html[data-theme="dark"] body .calendar-three-days>.calendar-side-day{background-color:#0b0e12!important;box-shadow:none}
 html[data-theme="dark"] body .calendar-hour-cell:not(.calendar-unscheduled){background-image:linear-gradient(to bottom,transparent 49%,#25303b 50%,transparent 52%)}
 html[data-theme="dark"] body .calendar-three-days .calendar-quarter-cell{background-image:none}
 html[data-theme="dark"] body .calendar-quarter-cell[data-drop-minute="0"]{border-top-color:#536174!important}
 html[data-theme="dark"] body .calendar-wide .calendar-appointment{background:#23455e!important;color:#f0f5fa!important;border-color:#668ba7!important}
 html[data-theme="dark"] body .calendar-wide .calendar-appointment.calendar-project-auto{background:#163b66!important;color:white!important;border-color:#4c7cab!important}
 html[data-theme="dark"] body .calendar-wide .calendar-appointment.calendar-google-grey{background:#454a52!important;color:white!important;border-color:#858b95!important}
 html[data-theme="dark"] body .calendar-wide .calendar-appointment.calendar-google-purple{background:#653e86!important;color:white!important;border-color:#ab80cc!important}
 html[data-theme="dark"] body :is(.calendar-task-pool.calendar-pool-over,.calendar-pool-over .calendar-pool-head,.calendar-drop-target){background:#173d58!important;outline-color:#80c8ff}
 html[data-theme="dark"] body :is(.error,.danger,[class*="delete"] button,button[class*="delete"],button.mail-unlink,.offer-decision.abgelehnt){background:#391a21!important;color:#ff9ca7!important;border-color:#a84f5b!important}
 html[data-theme="dark"] body :is(.success,.offer-decision.angenommen){background:#143528!important;color:#8fe0b6!important;border-color:#3b946a!important}
 html[data-theme="dark"] body :focus-visible{outline:2px solid #90ceff!important;outline-offset:2px}
 html[data-theme="dark"] body dialog::backdrop{background:#000b}
 /* Surfaces previously supplied by page-specific styles, including embedded dialogs. */
 html[data-theme="dark"]{background:#08090b;color:#e3e7eb;scrollbar-color:#59616c #111316}
 html[data-theme="dark"] body :is(aside,.auth-card,.user-row,.documents-panel,.project-mails,.position,.add-position,.add-phase,.content,.mobile-project-bar,.table-scroll,.article-detail,.ab-workflow section,.app-offer-row,.offer-settings,.add-item,.add-component,.component-edit form,.bom-promote form,.bom-branch,.bom-references,.catalog-results,.history-suggestions,.history-row,.history-document h4,.position-alternative,.ai-offer-composer,.ai-summary,.ai-position,.ai-rewrite-card,.customer-contact-editor,.customer-suggestions,.address-options,.position-type-menu,.calendar-create-menu,.mail-message-editor,.mail-attachment-card,.mail-preview-content,.offer-processing-card){background-color:#11161c!important;color:#e3e7eb!important;border-color:#38424d!important}
 html[data-theme="dark"] body :is(th,.phase-title,.documents-title,.project-mails-head,.history-heading,.position-dialog-head,.position-steps,.position-steps li,.facts div,.notice,.agent-status,.calculation-note,.import-bom-control,.history-selected,.category,.badge,.admin-badge,.bom-heading span,.calendar-month-weekday,.mail-layout .search,.mail-attachment-thumb,.clock-face){background:#1b2530!important;color:#dbe7f1!important;border-color:#414f5e!important}
 html[data-theme="dark"] body :is(.item-edit form,.document-inspector .position-option small,.bom-popup .component-edit form,.bom-popup .add-component form,.bom-popup .bom-promote form,.bom-popup .bom-references,.bom-popup .bom-branch.bom-fixed){background:#192028!important;color:#c8d2dc!important;border-color:#414b57!important}
 html[data-theme="dark"] body :is(nav a,.phase-order-chip){background:#1b2027!important;color:#c5d4e0!important;border-color:#3b4653!important}
 html[data-theme="dark"] body :is(nav a.active,.phase-order-chip.active,.position-steps [aria-current],button[aria-pressed="true"],.clock-digital .selected,.calendar-mini-days [aria-current="date"]){background:#244964!important;color:#fff!important;border-color:#82b9df!important}
 html[data-theme="dark"] body :is(.project:hover,.project-mail:hover,.mail-row:hover,.catalog-result:hover){background:#233241!important}
 html[data-theme="dark"] body :is(.position.next-position,.project-mail.unread){background:#17374d!important;color:#e5f2fc!important;border-color:#689bbc!important}
 html[data-theme="dark"] body .position.done{background:#111419!important}
 html[data-theme="dark"] body .position.done .position-name{color:#99a6b3!important}
 html[data-theme="dark"] body :is(.inspector-help,.catalog-help,.catalog-fixed,.history-heading p,.history-row p,.history-provenance span,.history-provenance strong,.history-price,.offer-link span,.project-mail span,.project-mail small,.project-mail-kind,.mail-row-sender,.mail-row-subject,.mail-row-preview,.mail-row-date,.comment-hint,.comment-status,.mail-comments summary,.search-hit summary,.facts dt,.bom-table code,.bom-references code,.bom-popup summary,.bom-popup-hint,.calendar-create-menu strong,.clock-help,.ai-status,.ai-rewrite-status,.ai-rewrite-card p,.ai-offer-composer>p,.position-dialog-head p,.offer-processing-card p,.document-tools>span,.document-save-state,.calculation-head span,.net-total span,td p){color:#b6c6d5!important}
 html[data-theme="dark"] body :is(.offer-discount,.finalize-offer,.ai-warning,.locked,.confidence.niedrig,.category-arbeitszeit){background:#352b17!important;color:#f0d394!important;border-color:#8c723c!important}
 html[data-theme="dark"] body :is(.finalize-offer p,.address-hint,.review,.search-limits,.history-row em,.calendar-carry-list summary,.calendar-month-overdue summary,.document-save-state.unsaved){color:#edc77e!important}
 html[data-theme="dark"] body :is(.offer-price-warning,.delete-item,.delete-component,.error-inline,.offer-prices-incomplete .offer-head-totals,.offer-prices-incomplete [data-panel="finish"]){background:#391a21!important;color:#ffabb4!important;border-color:#b55565!important}
 html[data-theme="dark"] body :is(.confidence.hoch,.category-fremdleistung){background:#23362e!important;color:#b5e2cc!important}
 html[data-theme="dark"] body :is(.offer-processing,#mail-busy){background:#080b10ed!important;color:#e3e7eb!important}
 html[data-theme="dark"] body :is(input[type="checkbox"],input[type="radio"],progress){accent-color:#79b4df}
 html[data-theme="dark"] body :is(input,textarea,select)[readonly]{background:#1b222b!important;color:#b8c4cf!important}
 html[data-theme="dark"] body :is(input,textarea,select,button):disabled{opacity:.55;cursor:not-allowed}
 html[data-theme="dark"] body :is(input,textarea,select)[aria-invalid="true"]{border-color:#ff8e9b!important}
 html[data-theme="dark"] body input::file-selector-button{background:#273543;color:#e1edf6;border:1px solid #526779;border-radius:4px;padding:5px 8px}
 html[data-theme="dark"] body .calendar-month-grid{background:#36414d!important}
 html[data-theme="dark"] body .calendar-month-day.outside-month{background:#0b0e12!important}
 html[data-theme="dark"] body button.clock-number{background:transparent!important}
 html[data-theme="dark"] body .clock-number:hover{background:#284e69!important}
 html[data-theme="dark"] body :is(.clock-hand,.clock-face:after){background:#83c9fb}
 html[data-theme="dark"] body .auth-card>img{filter:invert(1) hue-rotate(180deg)}
 html[data-theme="dark"] body :is(.break-text-editor,.gz-pricelist-panel,.project-mail-dialog-head,.break-text-marker){background:#1b2530!important;color:#c5d4e0!important;border-color:#414f5e!important}
 html[data-theme="dark"] body :is(.position.next-position .position-name,.project-mail.unread strong){color:#d2eaff!important}
 html[data-theme="dark"] body :is(button[class*="remove"],[class*="remove"] button,.break-text-marker button){background:#391a21!important;color:#ff9ca7!important;border-color:#a84f5b!important}
 html[data-theme="dark"] body .offer-accept-button{background:#143528!important;color:#8fe0b6!important;border-color:#3b946a!important}
 html[data-theme="dark"] body .bom-popup{background:#11161c!important;color:#e3e7eb!important;border-color:#38424d!important}
 html[data-theme="dark"] body :is(dialog>header,.offer-mail-dialog>div,.offer-voice,.document-inspector .item-edit span:has(>img)){background:#1b2530!important;color:#c5d4e0!important;border-color:#414f5e!important}
 html[data-theme="dark"] body .offer-voice>p{color:#b6c6d5!important}
 html[data-theme="dark"] body .offer-mail-success{background:#143528!important;color:#8fe0b6!important}
 html[data-theme="dark"] body :is(input,textarea,select)[readonly][readonly]:not(:where(.document-paper *)){background:#1b222b!important;color:#b8c4cf!important}
 /* Printed offer preview and authored mail signature are document islands, not app chrome. */
 html[data-theme="dark"] body .document-paper{color-scheme:light;background:#fff!important;color:#111!important}
 html[data-theme="dark"] body .document-paper :is(h1,h2,h3,h4,label,small,a){color:inherit!important}
 html[data-theme="dark"] body .document-paper :is(input,textarea,select){background:transparent!important;color:inherit!important;border-color:transparent!important}
 html[data-theme="dark"] body .document-paper :is(input,textarea,select):focus{background:white!important;border-color:#1681c5!important}
 html[data-theme="dark"] body .document-paper ::placeholder{color:#6a7f8f!important}
 html[data-theme="dark"] body .mail-inline-signature{color-scheme:dark;background:#101418!important;color:#e3e7eb!important;padding:12px;border-radius:4px}
 html[data-theme="dark"] body .mail-inline-signature :is(div,p,strong,span){color:#e3e7eb!important;background:transparent!important}
 html[data-theme="dark"] body .mail-inline-signature a{color:#8cc8ff!important}
 html[data-theme="dark"] body .mail-inline-signature img{background:#fff;border-radius:3px}
}
