.settings-fab{position:fixed;right:12px;top:12px;z-index:40;border:1px solid #648095;border-radius:30px;background:#112e43;color:white;padding:8px 12px;box-shadow:0 3px 14px #0005;font-size:15px;cursor:pointer}.settings-fab span{font-size:12px;font-weight:700}.settings-dialog{width:min(92vw,440px);max-height:85vh;border:1px solid var(--line);border-radius:20px;background:#10293d;color:#fff;padding:22px;box-shadow:0 20px 80px #0008}.settings-dialog::backdrop{background:#0009}.settings-top{display:flex;align-items:center;justify-content:space-between;gap:15px}.settings-top h2{margin:0}.settings-top button{background:transparent;color:inherit;border:0;font-size:30px;padding:0 8px}.settings-dialog fieldset{border:1px solid var(--line);border-radius:14px;padding:12px;margin:18px 0}.settings-dialog legend{font-weight:800;padding:0 7px}.settings-dialog fieldset label{display:flex;align-items:center;gap:10px;padding:10px 4px;cursor:pointer}.settings-dialog input{accent-color:#ed1939}.settings-dialog #settings-done{width:100%;background:#ed1939;color:white;border:0;border-radius:12px;padding:13px;font-weight:800}
html[data-theme="light"]{color-scheme:light;--bg:#f3f7fb;--panel:#fff;--panel2:#edf3f8;--line:#b8cad8;--muted:#425a6e}html[data-theme="light"] body{background:#f3f7fb;color:#142a3b}html[data-theme="light"] p,html[data-theme="light"] .vehicle-info small{color:#425a6e}html[data-theme="light"] .hero-brand{background:#fff;border-color:#c4d2de}html[data-theme="light"] .bottom-nav{background:#fff;color:#19344b;border-color:#b8cad8}html[data-theme="light"] .bottom-nav a:not(.active){color:#19344b}html[data-theme="light"] .vehicle-card{background:linear-gradient(120deg,#fff,#eaf2f8);box-shadow:0 5px 15px #16354a17}html[data-theme="light"] .vehicle-link{color:#152c3e}html[data-theme="light"] .vehicle-arrow{color:#24435a}html[data-theme="light"] .vehicle-badge.pending{color:#24435a;background:#e4edf4}html[data-theme="light"] .vehicle-badge.done{color:#086f42;background:#dff8eb}html[data-theme="light"] .vehicle-badge.closed{color:#8e293b;background:#ffebee}html[data-theme="light"] .info-strip,html[data-theme="light"] .progress{background:#fff;color:#19344b}html[data-theme="light"] .tag{background:#e4f0f8;color:#204760}html[data-theme="light"] .back-link{color:#244c6c}html[data-theme="light"] .settings-dialog{background:#fff;color:#142a3b}html[data-theme="light"] .settings-fab{background:#fff;color:#16354a;border-color:#b8cad8}html[data-theme="light"] .intro{border-color:#b8cad8}html[data-theme="light"] .version{background:#ffe6eb;color:#9d1430}html[data-theme="light"] .admin-tiles button,html[data-theme="light"] .stats>div,html[data-theme="light"] .maint-card,html[data-theme="light"] .maint-form,html[data-theme="light"] .overview,html[data-theme="light"] .location,html[data-theme="light"] .item,html[data-theme="light"] .inspection-item{background:#fff;color:#142a3b;border-color:#b8cad8}html[data-theme="light"] input,html[data-theme="light"] textarea,html[data-theme="light"] select{background:#fff;color:#142a3b;border-color:#a9bdcb}html[data-theme="light"] .settings-dialog input{accent-color:#ed1939}html[data-theme="auto"]{color-scheme:dark}@media(prefers-color-scheme:light){html[data-theme="auto"]{color-scheme:light}html[data-theme="auto"] body{filter:none}html[data-theme="auto"]{--bg:#f3f7fb;--panel:#fff;--panel2:#edf3f8;--line:#b8cad8;--muted:#425a6e}html[data-theme="auto"] body{background:#f3f7fb;color:#142a3b}html[data-theme="auto"] .vehicle-card{background:#fff}html[data-theme="auto"] .vehicle-link,html[data-theme="auto"] .vehicle-info small{color:#142a3b}html[data-theme="auto"] .settings-dialog{background:#fff;color:#142a3b}}
@media(max-width:550px){.settings-fab{top:8px;right:8px;padding:5px 8px}.settings-fab span{display:none}}


/* V2: contrastes des statuts, visibles avant ET apres selection. */
#inspection-form fieldset label.choice-conforme{background:#087a43!important;border:2px solid #0fb96a!important;color:#fff!important}
#inspection-form fieldset label.choice-anomalie{background:#c52235!important;border:2px solid #ee5262!important;color:#fff!important}
#inspection-form fieldset label.choice-absent{background:#526374!important;border:2px solid #8796a5!important;color:#fff!important}
#inspection-form fieldset label:has(input:checked){outline:3px solid #f3b43f!important;outline-offset:2px;box-shadow:0 0 0 5px #172a3b45!important}
#inspection-form fieldset label:has(input:focus-visible){outline:3px solid #f3b43f!important;outline-offset:2px}
#inspection-form fieldset label .choice-icon{font-weight:900}
/* Tous les panneaux et formulaires du theme clair (y compris le controle par QR). */
html[data-theme="light"]{--bg:#f3f6fa;--panel:#fff;--panel2:#edf2f7;--line:#cad5df;--muted:#42576a}
html[data-theme="light"] :is(#inspection-form,#login-form,#maintenance-form,#history article,#anomalies article,#admin-items article,.maint-card,.maint-form,.history-card,.anomaly-card,.admin-item,.info-strip,.progress,.location,.location-body,.overview,.stats>div,.edit-dialog,.settings-dialog){background:#fff!important;color:#172c3e!important;border-color:#cbd7e0!important}
html[data-theme="light"] :is(.item-title,.location-name,.location summary,.check-heading,.stats strong,.maint-card strong,.maint-card h3,.admin-heading,.section-heading,.item-meta,.stats small,.location-count,label,.observation-label,.empty){color:#172c3e!important}
html[data-theme="light"] :is(.maint-intro,.item-meta,.location-count,.empty){color:#455c6e!important}
html[data-theme="light"] :is(.item,.location-body,.intro){border-color:#d8e1e9!important}
html[data-theme="light"] :is(.secondary,.admin-tiles button,.history-card button,.item-actions button.secondary){background:#e9f0f6!important;color:#17364c!important;border-color:#b7c8d6!important}
html[data-theme="light"] :is(input:not([type=radio]):not([type=checkbox]),textarea,select){background:#fff!important;color:#142a3b!important;border-color:#aabcca!important}
html[data-theme="light"] :is(input,textarea)::placeholder{color:#637789!important;opacity:1}
html[data-theme="light"] #alert:not(:empty){background:#fff2dc!important;color:#593b16!important;border-color:#e7b55e!important}
html[data-theme="light"] .edit-dialog form{background:#fff!important;color:#142a3b!important}
html[data-theme="light"] .item.admin-item{background:#f7fafc!important}
html[data-theme="light"] .progress-track{background:#d2dce4!important}
html[data-theme="light"] .bottom-nav a.active{color:#d71b39!important}
html[data-theme="light"] .settings-dialog fieldset label{background:#f2f6fa!important;color:#172c3e!important;border-color:#d2dde6!important}
html[data-theme="light"] #inspection-form fieldset label.choice-conforme,html[data-theme="light"] #inspection-form fieldset label.choice-anomalie,html[data-theme="light"] #inspection-form fieldset label.choice-absent{color:#fff!important}
/* En mode auto, appliquer le meme theme complet lorsque le telephone est en clair. */
@media(prefers-color-scheme:light){
 html[data-theme="auto"]{--bg:#f3f6fa;--panel:#fff;--panel2:#edf2f7;--line:#cad5df;--muted:#42576a}
 html[data-theme="auto"] :is(#inspection-form,#login-form,#maintenance-form,#history article,#anomalies article,#admin-items article,.maint-card,.maint-form,.history-card,.anomaly-card,.admin-item,.info-strip,.progress,.location,.location-body,.overview,.stats>div,.edit-dialog,.settings-dialog){background:#fff!important;color:#172c3e!important;border-color:#cbd7e0!important}
 html[data-theme="auto"] :is(.item-title,.location-name,.location summary,.check-heading,.stats strong,.maint-card strong,.maint-card h3,.admin-heading,.section-heading,.item-meta,.stats small,.location-count,label,.observation-label,.empty){color:#172c3e!important}
 html[data-theme="auto"] :is(.secondary,.admin-tiles button,.history-card button,.item-actions button.secondary){background:#e9f0f6!important;color:#17364c!important;border-color:#b7c8d6!important}
 html[data-theme="auto"] :is(input:not([type=radio]):not([type=checkbox]),textarea,select){background:#fff!important;color:#142a3b!important;border-color:#aabcca!important}
 html[data-theme="auto"] :is(input,textarea)::placeholder{color:#637789!important;opacity:1}
 html[data-theme="auto"] .settings-dialog fieldset label{background:#f2f6fa!important;color:#172c3e!important}
 html[data-theme="auto"] #inspection-form fieldset label.choice-conforme,html[data-theme="auto"] #inspection-form fieldset label.choice-anomalie,html[data-theme="auto"] #inspection-form fieldset label.choice-absent{color:#fff!important}
}

/* Correctif contraste V2 : les choix de contrôle gardent leur couleur et leurs textes blancs dans tous les thèmes. */
html #inspection-form fieldset label.choice-conforme,
html[data-theme="light"] #inspection-form fieldset label.choice-conforme,
html[data-theme="auto"] #inspection-form fieldset label.choice-conforme {background:#087a43!important;border:2px solid #087a43!important;color:#fff!important}
html #inspection-form fieldset label.choice-anomalie,
html[data-theme="light"] #inspection-form fieldset label.choice-anomalie,
html[data-theme="auto"] #inspection-form fieldset label.choice-anomalie {background:#c52235!important;border:2px solid #c52235!important;color:#fff!important}
html #inspection-form fieldset label.choice-absent,
html[data-theme="light"] #inspection-form fieldset label.choice-absent,
html[data-theme="auto"] #inspection-form fieldset label.choice-absent {background:#526374!important;border:2px solid #526374!important;color:#fff!important}
html #inspection-form fieldset label[class*="choice-"] :is(span,strong,small,.choice-icon),
html[data-theme="light"] #inspection-form fieldset label[class*="choice-"] :is(span,strong,small,.choice-icon) {color:#fff!important;opacity:1!important;filter:none!important;text-shadow:none!important}
html #inspection-form fieldset label[class*="choice-"]:has(input:checked){outline:4px solid #ffce32!important;outline-offset:2px!important;box-shadow:0 0 0 2px #132638!important}
html #inspection-form fieldset label[class*="choice-"]:focus-within{outline:3px solid #ffce32!important;outline-offset:2px!important}

/* Correctif définitif : les choix sont dans #locations, PAS #inspection-form. */
html #locations fieldset label.choice {color:#fff!important;opacity:1!important;filter:none!important;text-shadow:none!important}
html #locations fieldset label.choice.choice-conforme {background:#087a43!important;border:2px solid #11a85c!important;color:#fff!important}
html #locations fieldset label.choice.choice-anomalie {background:#c52235!important;border:2px solid #e84b60!important;color:#fff!important}
html #locations fieldset label.choice.choice-absent {background:#526374!important;border:2px solid #77899a!important;color:#fff!important}
html #locations fieldset label.choice span,html #locations fieldset label.choice .choice-icon {color:#fff!important;opacity:1!important;visibility:visible!important;filter:none!important;text-shadow:none!important;-webkit-text-fill-color:#fff!important}
html #locations fieldset label.choice:has(input:checked) {outline:4px solid #ffcf32!important;outline-offset:2px!important;box-shadow:0 0 0 2px #132638!important}
html #locations fieldset label.choice:focus-within {outline:3px solid #ffcf32!important;outline-offset:2px!important}
html[data-theme="light"] .bottom-nav a.active,html[data-theme="auto"] .bottom-nav a.active {color:#fff!important}
html[data-theme="light"] .bottom-nav a.active span,html[data-theme="auto"] .bottom-nav a.active span {color:#fff!important;-webkit-text-fill-color:#fff!important}

/* Selection uniquement : états neutres avant clic, colorés après clic. */
html[data-theme="light"] #locations fieldset label.choice,
html[data-theme="auto"] #locations fieldset label.choice {background:#f1f4f7!important;border:2px solid #c9d3dd!important;color:#263b4b!important;box-shadow:none!important;outline:none!important}
html[data-theme="light"] #locations fieldset label.choice span,
html[data-theme="auto"] #locations fieldset label.choice span {color:#263b4b!important;-webkit-text-fill-color:#263b4b!important}
html[data-theme="dark"] #locations fieldset label.choice,
html:not([data-theme]) #locations fieldset label.choice {background:#102b40!important;border:2px solid #486276!important;color:#fff!important;box-shadow:none!important;outline:none!important}
html #locations fieldset label.choice.choice-conforme:has(input:checked) {background:#087a43!important;border-color:#11a85c!important;color:#fff!important}
html #locations fieldset label.choice.choice-anomalie:has(input:checked) {background:#c52235!important;border-color:#e84b60!important;color:#fff!important}
html #locations fieldset label.choice.choice-absent:has(input:checked) {background:#526374!important;border-color:#77899a!important;color:#fff!important}
html #locations fieldset label.choice:has(input:checked) span,
html #locations fieldset label.choice:has(input:checked) .choice-icon {color:#fff!important;-webkit-text-fill-color:#fff!important}
html #locations fieldset label.choice:has(input:checked) {outline:3px solid #ffcf32!important;outline-offset:1px!important;box-shadow:0 0 0 1px #132638!important}
html #locations fieldset label.choice:focus-within:not(:has(input:checked)){outline:2px solid #668caf!important;outline-offset:1px!important}
@media(prefers-color-scheme:dark){html[data-theme="auto"] #locations fieldset label.choice:not(:has(input:checked)){background:#102b40!important;border-color:#486276!important;color:#fff!important}html[data-theme="auto"] #locations fieldset label.choice:not(:has(input:checked)) span{color:#fff!important;-webkit-text-fill-color:#fff!important}}
