/* STEP 227 — shared popup theme bridge & high-contrast Day Mode.
   The UI's real switch is ld166Theme; legacy data-ld97-theme stays night.
   This file is loaded LAST and only targets dialogs; never the print pages,
   main navigation, accounting math, backend, or Night Mode. */
@media screen {
html[data-ld227-theme="day"] {
  --ld202-bg:#edf4fa;--ld202-panel:#fff;--ld202-panel2:#f5f9fd;
  --ld202-soft:#e8f3fb;--ld202-input:#fff;--ld202-text:#112f49;
  --ld202-secondary:#46637b;--ld202-border:#b9d0e1;
  --ld202-table:#e7f1f9;--ld202-focus:#087dbb;
  --ld202-shadow:0 24px 65px rgba(17,46,77,.24);
}
html[data-ld227-theme="day"] body:not(.parts-green-theme) #modal-root .modal:not(.ld187-deal-modal):not(.ld186-vehicle-modal):not(.ld208-expense-editor) {
  background:#fff!important;color:#112f49!important;color-scheme:light!important;
  border-color:#9dbfd5!important;
}
html[data-ld227-theme="day"] body:not(.parts-green-theme) #modal-root .modal:not(.ld187-deal-modal):not(.ld186-vehicle-modal):not(.ld208-expense-editor) > :is(.modal-head,.modal-content,.modal-foot) {
  background:#fff!important;color:#112f49!important;border-color:#b9d0e1!important;
}
html[data-ld227-theme="day"] body:not(.parts-green-theme) #modal-root .modal:not(.ld187-deal-modal):not(.ld186-vehicle-modal):not(.ld208-expense-editor) > .modal-head,
html[data-ld227-theme="day"] body:not(.parts-green-theme) #modal-root .modal:not(.ld187-deal-modal):not(.ld186-vehicle-modal):not(.ld208-expense-editor) > .modal-foot{
  background:#f3f8fc!important;
}
html[data-ld227-theme="day"] body:not(.parts-green-theme) #modal-root .modal:not(.ld187-deal-modal):not(.ld186-vehicle-modal):not(.ld208-expense-editor) :is(.modal-head h3,.modal-content h3,.modal-content h4,.modal-content strong,.modal-content b) {
  color:#15334c!important;text-shadow:none!important;
}
html[data-ld227-theme="day"] body:not(.parts-green-theme) #modal-root .modal:not(.ld187-deal-modal):not(.ld186-vehicle-modal):not(.ld208-expense-editor) :is(.field label,.muted,p,small,.footnote){
  color:#46637b!important;opacity:1!important;
}
html[data-ld227-theme="day"] body:not(.parts-green-theme) #modal-root .modal:not(.ld187-deal-modal):not(.ld186-vehicle-modal):not(.ld208-expense-editor) :is(input:not([type=radio]):not([type=checkbox]):not([type=file]),select,textarea){
  background:#fff!important;color:#163650!important;border-color:#a7c4d8!important;color-scheme:light!important;
}
html[data-ld227-theme="day"] body:not(.parts-green-theme) #modal-root .modal :is(input,textarea)::placeholder{color:#58758a!important;opacity:1!important}
html[data-ld227-theme="day"] body:not(.parts-green-theme) #modal-root .modal :is(select option){background:#fff!important;color:#14374f!important}
html[data-ld227-theme="day"] body:not(.parts-green-theme) #modal-root .modal :is(.vehicle-tabs,.lotdesk-deal-tabs){border-color:#b9d0e1!important}
html[data-ld227-theme="day"] body:not(.parts-green-theme) #modal-root .modal :is(.vehicle-tab:not(.active),.lotdesk-deal-tabs button:not(.active)){color:#46627a!important}
html[data-ld227-theme="day"] body:not(.parts-green-theme) #modal-root .modal :is(.vehicle-tab.active,.lotdesk-deal-tabs button.active){color:#065f97!important;border-bottom-color:#0788c2!important}
html[data-ld227-theme="day"] body:not(.parts-green-theme) #modal-root .modal :is(table td){color:#183850!important}
html[data-ld227-theme="day"] body:not(.parts-green-theme) #modal-root .modal :is(table th){color:#315874!important;background:#eaf3fa!important}
html[data-ld227-theme="day"] body:not(.parts-green-theme) #modal-root .modal-backdrop{background:rgba(31,54,77,.42)!important}
/* Existing logo assets already have separate artwork for light backgrounds. */
html[data-ld227-theme="day"] body:not(.parts-green-theme) #modal-root .modal:not(.ld187-deal-modal):not(.ld186-vehicle-modal):not(.ld73-create-modal):not(.clean-invoice-dialog) > .modal-head::before{background-image:url('/ld133-mylotdesk-logo-day-v183.png')!important}
html[data-ld227-theme="day"] body:not(.parts-green-theme) #modal-root .modal:not(.ld187-deal-modal):not(.ld186-vehicle-modal):not(.ld73-create-modal):not(.clean-invoice-dialog) > .modal-head::after{background-image:url('/ld133-rpm-autoworks-day-v183.png')!important}
/* Title Update has a hardcoded navy vehicle banner; normalize that separately. */
html[data-ld227-theme="day"] body:not(.parts-green-theme) #modal-root .ld227-title-modal .modal-content > div:first-child {
  background:#edf6fc!important;color:#153650!important;border:1px solid #a7cadf!important;box-shadow:none!important;
}
html[data-ld227-theme="day"] body:not(.parts-green-theme) #modal-root .ld227-title-modal .modal-content > div:first-child > div:first-child{
  background:#fff!important;border-color:#9dbbd1!important;box-shadow:none!important;
}
html[data-ld227-theme="day"] body:not(.parts-green-theme) #modal-root .ld227-title-modal .modal-content > div:first-child > div:nth-child(2) > div:first-child{color:#153650!important}
html[data-ld227-theme="day"] body:not(.parts-green-theme) #modal-root .ld227-title-modal .modal-content > div:first-child > div:nth-child(2) span{
  background:#fff!important;color:#234a66!important;border-color:#a7c5d8!important;
}
html[data-ld227-theme="day"] body:not(.parts-green-theme) #modal-root .ld227-title-modal [data-title-panel="copies"] > div:first-child{
  background:#edf6fc!important;color:#1a405e!important;border-color:#a9c8df!important;
}
html[data-ld227-theme="day"] body:not(.parts-green-theme) #modal-root .ld227-title-modal :is(#title-scan-status,#title-extra-scan-status){color:#315d78!important}
/* Standalone alert, scanner, invoice registration, quick checks, and overlays. */
html[data-ld227-theme="day"] body:not(.parts-green-theme) :is(.ld-dialog,.ld168-dialog,.ld174-modal,.ld110-mixed-dialog,.ld108-dialog,.ssc-dialog,.lotdesk-quick-check-dialog,.qc109-ready,.mmr-inapp-dialog){
  background:#fff!important;color:#12334e!important;color-scheme:light!important;border-color:#b9d0e1!important;
}
html[data-ld227-theme="day"] body:not(.parts-green-theme) :is(.ld-dialog,.ld168-dialog,.ld174-modal,.ld110-mixed-dialog,.ld108-dialog,.ssc-dialog,.lotdesk-quick-check-dialog,.qc109-ready) :is(.ld-dialog-header,.ld-dialog-content,.ld-dialog-footer,.ssc-head,.ssc-body,.ssc-footer,.qc-head,.qc-foot,.ld108-head,.ld108-body,.ld108-foot){
  background:#fff!important;color:#12334e!important;border-color:#b9d0e1!important;
}
html[data-ld227-theme="day"] body:not(.parts-green-theme) :is(.ld-dialog,.ld168-dialog,.ld174-modal,.ld110-mixed-dialog,.ld108-dialog,.ssc-dialog,.lotdesk-quick-check-dialog,.qc109-ready) :is(input:not([type=checkbox]):not([type=radio]),select,textarea){
  background:#fff!important;color:#12334e!important;border-color:#a8c5d8!important;color-scheme:light!important;
}
html[data-ld227-theme="day"] body:not(.parts-green-theme) :is(.ld-dialog,.ld168-dialog,.ld174-modal,.ld110-mixed-dialog,.ld108-dialog,.ssc-dialog,.lotdesk-quick-check-dialog,.qc109-ready) :is(.muted,small,.field label,.ld-dialog-message){color:#46637b!important}
html[data-ld227-theme="day"] body:not(.parts-green-theme) :is(.ld-dialog,.ld168-dialog,.ld174-modal,.ld110-mixed-dialog,.ld108-dialog,.ssc-dialog,.lotdesk-quick-check-dialog,.qc109-ready) button.secondary{
  background:#e8f3fb!important;color:#163e59!important;border-color:#b2cde1!important;
}
/* Explicitly preserve danger and success color meaning. */
html[data-ld227-theme="day"] body:not(.parts-green-theme) #modal-root button.danger{background:#fff1f1!important;color:#9f2735!important;border-color:#d69ca3!important}
}
/* Older standalone popup families live outside #modal-root; they must use the
   same ACTIVE ld227 flag. Preserve layouts, sizing, and interaction handlers. */
@media screen {
html[data-ld227-theme="day"] body :is(.ld131-preview-dialog,.ld145-modal,.ld147-modal,.ld195-dialog,.ld197-dialog,.ld219-history-dialog){
  background:#fff!important;color:#15334c!important;border-color:#acc9dd!important;
  color-scheme:light!important;box-shadow:0 22px 65px rgba(17,46,77,.25)!important;
}
html[data-ld227-theme="day"] body :is(.ld131-preview-head,.ld145-head,.ld147-modal header,.ld147-modal footer,.ld195-dialog header,.ld195-dialog footer,.ld197-dialog header,.ld197-dialog footer,.ld219-history-dialog header){
  background:#f1f7fc!important;color:#15334c!important;border-color:#b9d0e1!important;
}
html[data-ld227-theme="day"] body :is(.ld131-preview-dialog,.ld145-modal,.ld147-modal,.ld195-dialog,.ld197-dialog,.ld219-history-dialog) :is(h2,h3,h4,.ld145-head h2,.ld145-detail-head h3,.ld147-row b,strong){
  color:#15334c!important;text-shadow:none!important;
}
html[data-ld227-theme="day"] body :is(.ld131-preview-dialog,.ld145-modal,.ld147-modal,.ld195-dialog,.ld197-dialog,.ld219-history-dialog) :is(label,small,p,.muted,.ld145-head p,.ld145-detail-head p,.ld145-list-label,.ld147-row small,.ld147-row span,.ld197-dialog label){
  color:#46637b!important;opacity:1!important;text-shadow:none!important;
}
html[data-ld227-theme="day"] body :is(.ld131-preview-dialog,.ld145-modal,.ld147-modal,.ld195-dialog,.ld197-dialog,.ld219-history-dialog) :is(input:not([type=checkbox]):not([type=radio]),select,textarea){
  background:#fff!important;color:#173a56!important;border-color:#a8c5d9!important;color-scheme:light!important;
}
html[data-ld227-theme="day"] body :is(.ld131-preview-dialog,.ld145-modal,.ld147-modal,.ld195-dialog,.ld197-dialog,.ld219-history-dialog) :is(input,textarea)::placeholder{color:#5b788d!important;opacity:1!important}
html[data-ld227-theme="day"] body :is(.ld145-stats>div,.ld145-detail,.ld145-filters,.ld145-decode,.ld147-help,.ld147-modal footer,.ld219-history-facts>div){
  background:#edf6fc!important;color:#183a54!important;border-color:#b9d0e1!important;
}
html[data-ld227-theme="day"] body :is(.ld145-stats>div,.ld145-detail,.ld145-decode,.ld147-help,.ld147-row,.ld219-history-facts>div) :is(span,small,b,strong,p){color:#284c66!important}
html[data-ld227-theme="day"] body :is(.ld145-item,.ld145-row,.ld147-row){border-color:#b7d0e1!important;color:#16364f!important}
html[data-ld227-theme="day"] body .ld145-filters button:not(.active){color:#355b76!important}
html[data-ld227-theme="day"] body :is(.ld147-modal button,.ld195-dialog button:not(.primary):not(.ld195-primary),.ld197-dialog button:not(.primary):not(.ld197-btn)){
  background:#e7f2fb!important;color:#153c56!important;border-color:#b6cfe0!important;
}
html[data-ld227-theme="day"] body .ld147-modal #ld147-query{background:#fff!important;color:#153650!important;border-color:#a7c4d8!important}
html[data-ld227-theme="day"] body .ld195-dialog :is(.ld195-fields label,.ld195-note-label){color:#315671!important}
html[data-ld227-theme="day"] body .ld219-history-dialog :is(.ld219-disclaimer,.ld219-history-facts span){color:#46637b!important}
}
