.theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;white-space:nowrap}.theme-toggle svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.8}.theme-toggle[aria-pressed="true"]{box-shadow:inset 0 0 0 2px #ffd071}
html[data-theme="dark"]{color-scheme:dark;--ink:#edf1f5}
html[data-theme="dark"] body{background:#151a21;color:#edf1f5}
html[data-theme="dark"] header{background:#1d2530;color:#edf1f5;flex-wrap:wrap}
html[data-theme="dark"] header>img{background:#fff;border-radius:8px;padding:6px}
html[data-theme="dark"] fieldset,html[data-theme="dark"] .user-card,html[data-theme="dark"] .local-report,html[data-theme="dark"] .login,html[data-theme="dark"] .notice,html[data-theme="dark"] .signature-dialog,html[data-theme="dark"] .app-launcher .app-tile{background:#202833;color:#edf1f5;border-color:#485362}
html[data-theme="dark"] .app-launcher .app-tile:hover{background:#30303b;border-color:#ff6b78;color:#fff}
html[data-theme="dark"] .app-tile-icon{background:#48272f;color:#ff8490}
html[data-theme="dark"] .note,html[data-theme="dark"] .app-tile-note{color:#bdc8d5}
html[data-theme="dark"] input,html[data-theme="dark"] textarea,html[data-theme="dark"] select,
html[data-theme="dark"] #report input[required]:valid,html[data-theme="dark"] #report select[required]:valid,html[data-theme="dark"] #report textarea[required]:valid{background:#151d27;color:#f3f5f7;border-color:#647182}
html[data-theme="dark"] input[required]:invalid,html[data-theme="dark"] select[required]:invalid,html[data-theme="dark"] textarea[required]:invalid,
html[data-theme="dark"] #report input[required]:invalid,html[data-theme="dark"] #report select[required]:invalid,html[data-theme="dark"] #report textarea[required]:invalid{background:#49252e;border-color:#f18b9b}
html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder{color:#aeb9c7;opacity:1}
html[data-theme="dark"] label{--required-marker:#ffacb6}
html[data-theme="dark"] main>h1::after,html[data-theme="dark"] .required-caption{color:#ffacb6}
html[data-theme="dark"] .labor-row,html[data-theme="dark"] .video-device-card,html[data-theme="dark"] .serial-scanner,html[data-theme="dark"] .material>.serial-scanner{background:#252e3a;border-color:#536071}
html[data-theme="dark"] a:not(.button):not(.app-tile){color:#ffb5bd}
html[data-theme="dark"] .customer-results,html[data-theme="dark"] .material-search-results{background:#202833;color:#edf1f5}
html[data-theme="dark"] th{background:#303b49;color:#fff}html[data-theme="dark"] td{background:#202833;color:#edf1f5;border-color:#536071}
html[data-theme="dark"] button:hover,html[data-theme="dark"] .button:hover{background:#fff0f1;color:#a40016}
html[data-theme="dark"] canvas,html[data-theme="dark"] .signature-dialog .signature-pad{background:#fff;color-scheme:light}
@media(max-width:700px){header{gap:12px}.theme-toggle{margin-left:auto;font-size:14px;padding:10px 12px}}

html[data-theme="light"]{color-scheme:light}
html[data-theme="dark"] header img{background:#fff;border-radius:8px;padding:6px}
html[data-theme="dark"] .dashboard-card,html[data-theme="dark"] .asset-ribbon,html[data-theme="dark"] .asset-filter,html[data-theme="dark"] .asset-table,html[data-theme="dark"] .customer-table table,html[data-theme="dark"] .customer-picker,html[data-theme="dark"] .session-warning,html[data-theme="dark"] main>.internal-nav,html[data-theme="dark"] .internal-nav .nav-dropdown{background:#202833;color:#edf1f5;border-color:#536071}
html[data-theme="dark"] .dashboard-icon{background:#48272f;color:#ff8490}
html[data-theme="dark"] .asset-ribbon .asset-tab,html[data-theme="dark"] .type-catalog-actions .catalog-button,html[data-theme="dark"] .asset-row-actions .secondary,html[data-theme="dark"] .video-device-card>button{background:#263241;color:#ffb5bd;border-color:#94616a}
html[data-theme="dark"] .internal-nav .nav-dropdown>a{background:#263241;color:#edf1f5;border-color:#536071}
html[data-theme="dark"] .internal-nav .nav-dropdown>a:hover,html[data-theme="dark"] .asset-ribbon .asset-tab:hover,html[data-theme="dark"] .asset-ribbon .asset-tab.is-selected{background:#49252e;color:#fff;border-color:#f18b9b}
html[data-theme="dark"] .badge{background:#344354;color:#edf1f5}html[data-theme="dark"] .badge.overdue,html[data-theme="dark"] .asset-table .badge.overdue{background:#592b34;color:#ffc3cc}
html[data-theme="dark"] input,html[data-theme="dark"] textarea,html[data-theme="dark"] select{color:#f3f5f7;-webkit-text-fill-color:#f3f5f7;caret-color:#fff;opacity:1}
html[data-theme="light"] input,html[data-theme="light"] textarea,html[data-theme="light"] select{color:#34383b;-webkit-text-fill-color:#34383b;caret-color:#34383b;opacity:1}
html[data-theme="dark"] input:-webkit-autofill,html[data-theme="dark"] input:-webkit-autofill:hover,html[data-theme="dark"] input:-webkit-autofill:focus{ -webkit-text-fill-color:#f3f5f7;caret-color:#fff;-webkit-box-shadow:0 0 0 1000px #151d27 inset;box-shadow:0 0 0 1000px #151d27 inset}
html[data-theme="light"] input:-webkit-autofill{-webkit-text-fill-color:#34383b;-webkit-box-shadow:0 0 0 1000px #fff inset;box-shadow:0 0 0 1000px #fff inset}
html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder{-webkit-text-fill-color:#aeb9c7;color:#aeb9c7}
html[data-theme="dark"] input:disabled,html[data-theme="dark"] textarea:disabled,html[data-theme="dark"] select:disabled{-webkit-text-fill-color:#aeb9c7;color:#aeb9c7}
@media print{html[data-theme="dark"]{color-scheme:light}html[data-theme="dark"] body,html[data-theme="dark"] fieldset,html[data-theme="dark"] td,html[data-theme="dark"] th{background:#fff;color:#000}.theme-toggle{display:none!important}}

/* Menu buttons keep white text in both themes, including hover and active states. */
html[data-theme] .internal-nav a,html[data-theme] .internal-nav summary,html[data-theme] .internal-nav button{color:#fff;-webkit-text-fill-color:#fff}
html[data-theme] .internal-nav>a,html[data-theme] .internal-nav .nav-group>summary,html[data-theme] .internal-nav .nav-logout button{background:#e50914;border-color:#e50914;color:#fff;-webkit-text-fill-color:#fff}
html[data-theme] .internal-nav a:hover,html[data-theme] .internal-nav a:focus-visible,html[data-theme] .internal-nav summary:hover,html[data-theme] .internal-nav summary:focus-visible,html[data-theme] .internal-nav button:hover,html[data-theme] .internal-nav button:focus-visible,html[data-theme] .internal-nav a[aria-current="page"],html[data-theme] .internal-nav .nav-group>summary.is-current,html[data-theme] .internal-nav .nav-group[open]>summary{background:#bb0016;border-color:#bb0016;color:#fff;-webkit-text-fill-color:#fff}
html[data-theme] header>.theme-toggle,html[data-theme] header>.theme-toggle:hover{background:#bb0016;color:#fff;-webkit-text-fill-color:#fff}

html[data-theme] .internal-nav .nav-dropdown>a{color:#fff;-webkit-text-fill-color:#fff}

/* Completed required controls must not inherit the light-theme white background. */
@media screen{
html[data-theme="dark"] input[required]:valid,html[data-theme="dark"] select[required]:valid,html[data-theme="dark"] textarea[required]:valid,
html[data-theme="dark"] #report input[required]:valid,html[data-theme="dark"] #report select[required]:valid,html[data-theme="dark"] #report textarea[required]:valid{background-color:#151d27;color:#f3f5f7;-webkit-text-fill-color:#f3f5f7;border-color:#647182;caret-color:#fff}
html[data-theme="dark"] select option,html[data-theme="dark"] select optgroup{background-color:#151d27;color:#f3f5f7;-webkit-text-fill-color:#f3f5f7}
}

/* One paired foreground/background definition for every editable field state. */
@media screen{
html{--field-bg:#fff;--field-fg:#202830;--field-border:#8a96a3;--field-required:#fff0f1;--field-placeholder:#5c6673;--field-disabled-bg:#edf0f3;--field-disabled-fg:#526170}
html[data-theme="dark"]{--field-bg:#151d27;--field-fg:#f3f5f7;--field-border:#647182;--field-required:#49252e;--field-placeholder:#adbac8;--field-disabled-bg:#28313d;--field-disabled-fg:#c2ccd7}
html body input:where(:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"])),html body textarea,html body select{background-color:var(--field-bg)!important;color:var(--field-fg)!important;-webkit-text-fill-color:var(--field-fg)!important;border-color:var(--field-border);caret-color:var(--field-fg)!important;opacity:1!important}
html body input[required]:invalid:not([type="checkbox"]):not([type="radio"]),html body textarea[required]:invalid,html body select[required]:invalid{background-color:var(--field-required)!important}
html body input:disabled:not([type="hidden"]),html body textarea:disabled,html body select:disabled{background-color:var(--field-disabled-bg)!important;color:var(--field-disabled-fg)!important;-webkit-text-fill-color:var(--field-disabled-fg)!important;opacity:1!important}
html body input::placeholder,html body textarea::placeholder{color:var(--field-placeholder)!important;-webkit-text-fill-color:var(--field-placeholder)!important;opacity:1!important}
html body select option,html body select optgroup{background-color:var(--field-bg)!important;color:var(--field-fg)!important;-webkit-text-fill-color:var(--field-fg)!important}
html body input:-webkit-autofill,html body input:-webkit-autofill:hover,html body input:-webkit-autofill:focus{background-color:var(--field-bg)!important;-webkit-box-shadow:0 0 0 1000px var(--field-bg) inset!important;box-shadow:0 0 0 1000px var(--field-bg) inset!important;-webkit-text-fill-color:var(--field-fg)!important;caret-color:var(--field-fg)!important}
html body input::file-selector-button{background:#bb0016;color:#fff;-webkit-text-fill-color:#fff;border:0;border-radius:6px;padding:8px 10px;margin-right:10px}
html[data-theme="dark"] label,html[data-theme="dark"] legend{color:#edf1f5}
}

@media screen{html[data-theme="dark"] label{--required-marker:#ffb2be!important}html[data-theme="dark"] label::after{color:#ffb2be!important}html[data-theme="light"] label::after{color:#982035!important}}

@media screen{html body input:autofill{color:var(--field-fg)!important;-webkit-text-fill-color:var(--field-fg)!important;caret-color:var(--field-fg)!important;box-shadow:0 0 0 1000px var(--field-bg) inset!important}}

/* v66: Search wrappers and text must use the same theme in every dialog. */
@media screen{
html body .site-search-field{background-color:var(--field-bg,#fff)!important;color:var(--field-fg,#202830)!important;border-color:var(--field-border,#8a96a3)}
html body .site-search-field input,html body input[type="search"]{background-color:var(--field-bg,#fff)!important;color:var(--field-fg,#202830)!important;-webkit-text-fill-color:var(--field-fg,#202830)!important;caret-color:var(--field-fg,#202830)!important;opacity:1!important}
html body .site-search-field input::placeholder,html body input[type="search"]::placeholder{color:var(--field-placeholder,#5c6673)!important;-webkit-text-fill-color:var(--field-placeholder,#5c6673)!important}
html body .site-search-panel{background-color:var(--field-bg,#fff);color:var(--field-fg,#202830)}
html body .site-search-panel a,html body .site-search-panel strong{color:var(--field-fg,#202830)!important}
html body .site-search-panel span,html body .site-search-status{color:var(--field-placeholder,#5c6673)!important}
html[data-theme="dark"] .inbox-message-button,html[data-theme="dark"] .inbox-message-button:hover,html[data-theme="dark"] .inbox-message-button:focus-visible{color:#edf1f5!important;-webkit-text-fill-color:#edf1f5!important;background:#202833!important}
}

/* v71: native date/time editors and selected input text keep a readable foreground. */
@media screen{
html body input::-webkit-datetime-edit{color:var(--field-fg,#202830)!important;-webkit-text-fill-color:var(--field-fg,#202830)!important}
html body input::selection,html body textarea::selection{background:#005fcc;color:#fff;-webkit-text-fill-color:#fff}
html[data-theme="dark"] body input::selection,html[data-theme="dark"] body textarea::selection{background:#8ab4f8;color:#101720;-webkit-text-fill-color:#101720}
.live-search-results[aria-busy="true"]{cursor:progress}.live-search-status{min-height:1.5em}
}
