.vehicle-history-editor{container-type:inline-size;min-width:0;width:100%}
.vehicle-history-fields{border:0;margin:0;padding:0;min-width:0}
.vehicle-history-editor [hidden]{display:none!important}
.vehicle-history-header,.vehicle-history-summary,.vehicle-history-list-heading,.vehicle-mileage-row{display:flex;align-items:center;justify-content:space-between;gap:16px}
.vehicle-history-header h2{margin:0 0 8px}
.vehicle-history-header p{margin:0;color:var(--app-muted,#b3b9af)}
.vehicle-history-summary{margin:22px 0;padding:20px;border:1px solid var(--app-line,rgba(255,255,255,.14));border-radius:16px;background:rgba(255,255,255,.025)}
.vehicle-history-summary span,.vehicle-history-summary strong,.vehicle-service small,.vehicle-mileage-row small{display:block}
.vehicle-history-summary span{color:var(--app-muted,#b3b9af);font-size:13px;margin-bottom:6px}
.vehicle-history-summary strong{font-size:24px}
.vehicle-history-preferences,.vehicle-service-optional,.vehicle-mileage-history{padding:16px;border:1px solid var(--app-line,rgba(255,255,255,.14));border-radius:14px;margin:16px 0}
.vehicle-history-editor summary{cursor:pointer;font-weight:700;min-height:44px;display:flex;align-items:center}
.vehicle-history-editor summary:before{content:'+';margin-right:12px;font-size:20px;color:var(--app-primary,#bafb68)}
.vehicle-history-editor details[open]>summary:before{content:'−'}
.vehicle-history-editor details[open]>summary{margin-bottom:12px}
.vehicle-history-preferences label,.vehicle-history-public-option{display:flex;gap:10px;align-items:flex-start;margin:12px 0;font-size:14px}
.vehicle-history-editor input[type=checkbox]{width:18px;height:18px;min-width:18px;margin-top:2px}
.vehicle-history-list-heading{margin:24px 0 16px}
.vehicle-history-list-heading h3{margin:0}
.vehicle-service,.vehicle-mileage-row{border:1px solid var(--app-line,rgba(255,255,255,.14));border-radius:14px;padding:18px;margin:12px 0;background:rgba(255,255,255,.02);min-width:0}
.vehicle-service p,.vehicle-mileage-row p{white-space:pre-wrap;overflow-wrap:anywhere;margin:10px 0}
.vehicle-service small,.vehicle-mileage-row small{color:var(--app-muted,#b3b9af);margin:6px 0;overflow-wrap:anywhere}
.vehicle-service-meta{display:flex;align-items:center;gap:12px;flex-wrap:wrap;color:var(--app-muted,#b3b9af);font-size:13px;margin:12px 0}
.vehicle-status{border-radius:20px;padding:5px 10px;background:rgba(186,251,104,.1);color:#c4f891}
.vehicle-status.soon{background:rgba(255,191,80,.12);color:#ffd189}
.vehicle-status.overdue{background:rgba(255,113,113,.12);color:#ffaaaa}
.vehicle-service-form,.vehicle-mileage-form{margin:20px 0;padding:20px;border:1px solid var(--app-primary,#bafb68);border-radius:16px}
.vehicle-service-form h3,.vehicle-mileage-form h3{margin-top:0}
.vehicle-history-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:16px}
.vehicle-history-editor .app-button,.vehicle-history-public .app-button{min-height:44px;white-space:normal}
.vehicle-history-editor .app-field{min-width:0}
.vehicle-history-editor input:not([type=checkbox]),.vehicle-history-editor select,.vehicle-history-editor textarea{width:100%;min-width:0;box-sizing:border-box}
.vehicle-history-editor textarea{resize:vertical}
.vehicle-document{margin:8px 8px 0 0;overflow-wrap:anywhere;text-align:left}
.vehicle-attachment-list{list-style:none;padding:0;margin:12px 0}
.vehicle-attachment-list li{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 0;border-bottom:1px solid var(--app-line,rgba(255,255,255,.14))}
.vehicle-attachment-list span{overflow-wrap:anywhere;min-width:0}
.vehicle-service-attachments{margin:14px 0;padding:14px;border:1px solid var(--app-line,#dce5f1);border-radius:10px;min-width:0}
.vehicle-service-attachments h4{margin:0;font-size:15px;line-height:1.5}
.vehicle-service-attachments h4 span{font-weight:400;color:var(--app-muted,#60718b)}
.vehicle-service-attachments .pwa-file-options{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.vehicle-service-attachments input[type=file]{max-width:100%;font-size:14px}
.vehicle-service-attachments .vehicle-attachment-list:empty{display:none}
.vehicle-service-attachments .vehicle-attachment-list .app-button{flex-shrink:0}
.vehicle-history-message{min-height:24px;margin:16px 0 0;overflow-wrap:anywhere}
.vehicle-history-editor .danger{color:#ffaaaa;border-color:rgba(255,113,113,.35)}
.vehicle-history-public .vehicle-service{margin:12px 0}
@container (max-width:540px){.vehicle-history-header,.vehicle-history-summary,.vehicle-history-list-heading,.vehicle-mileage-row{align-items:stretch;flex-direction:column}.vehicle-history-editor .app-form{grid-template-columns:minmax(0,1fr)}.vehicle-history-editor .app-field.full{grid-column:1}.vehicle-service-form,.vehicle-mileage-form{padding:16px}.vehicle-history-header>.app-button,.vehicle-history-summary>.app-button,.vehicle-history-list-heading>.app-button{width:100%}.vehicle-history-actions .app-button{flex:1}.vehicle-service{padding:16px}}
@media (max-width:540px){.vehicle-history-public .vehicle-service{padding:14px}.vehicle-history-public .vehicle-document{width:100%}}

/* Compact owner editor; public NFC history keeps its existing layout. */
.vehicle-history-editor{font-size:15px;line-height:1.5}
.vehicle-history-editor .vehicle-history-header{gap:12px;margin-top:12px}
.vehicle-history-editor .vehicle-history-header h2{margin:0 0 4px;font-size:18px}
.vehicle-history-editor .vehicle-history-header p{font-size:14px;overflow-wrap:anywhere}
.vehicle-history-editor .vehicle-history-summary{margin:14px 0;padding:14px 16px;gap:12px;border-radius:12px}
.vehicle-history-editor .vehicle-history-summary strong{font-size:24px;line-height:1.25}
.vehicle-history-primary-actions{display:flex;gap:10px;flex-wrap:wrap}
.vehicle-history-editor .vehicle-history-list-heading{margin:18px 0 10px}
.vehicle-history-editor .vehicle-history-list-heading h3{font-size:16px;scroll-margin-block:20px}
.vehicle-history-editor .vehicle-service,.vehicle-history-editor .vehicle-mileage-row{padding:14px;margin:8px 0;border-radius:12px}
.vehicle-history-editor .vehicle-service{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:start}
.vehicle-history-editor .vehicle-service>.vehicle-history-actions{margin:0}
.vehicle-history-editor .vehicle-service p{margin:6px 0}
.vehicle-history-editor .vehicle-service-meta{margin:8px 0;gap:8px}
.vehicle-history-editor .vehicle-service-form,.vehicle-history-editor .vehicle-mileage-form{padding:16px;margin:14px 0;border-radius:12px;border-color:var(--app-line,#dce5f1)}
.vehicle-history-editor .vehicle-history-actions{margin-top:12px;gap:10px}
.vehicle-history-editor .app-form,.vehicle-history-attachment-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.vehicle-history-editor .app-field{align-content:start}
.vehicle-history-editor .app-field label{font-size:14px}
.vehicle-history-editor .app-field input,.vehicle-history-editor .app-field select,.vehicle-history-editor .app-field textarea{min-height:46px;padding:10px 12px;font-size:16px}
.vehicle-history-editor .app-button{min-height:46px;padding:10px 14px;font-size:14px}
.vehicle-history-editor .app-help{font-size:13px;line-height:1.5;margin:8px 0;color:var(--app-muted,#60718b)}
.vehicle-history-editor .vehicle-history-preferences,.vehicle-history-editor .vehicle-service-optional,.vehicle-history-editor .vehicle-mileage-history,.vehicle-history-editor .vehicle-history-documents{padding:0 14px;border:1px solid var(--app-line,#dce5f1);border-radius:10px;margin:8px 0}
.vehicle-history-editor details[open]{padding-bottom:12px}
.vehicle-history-editor summary{font-size:14px;min-height:48px}
.vehicle-history-editor summary:before{color:var(--app-cyan,#1764e8);font-size:18px;margin-right:10px}
.vehicle-history-editor details[open]>summary{margin-bottom:8px}
.vehicle-history-editor .vehicle-history-secondary{margin-top:16px}
.vehicle-history-editor .vehicle-more-information{margin:4px 0 8px;border:0;padding:0}
.vehicle-history-editor .vehicle-more-information>summary{display:list-item;list-style:none;width:fit-content;min-height:44px;color:var(--app-cyan,#1764e8);font-size:13px;font-weight:600;text-decoration:underline;text-underline-offset:3px;align-content:center}
.vehicle-history-editor .vehicle-more-information>summary::-webkit-details-marker{display:none}
.vehicle-history-editor .vehicle-more-information>summary:before{content:none}
.vehicle-history-editor .vehicle-more-information p{font-size:13px;margin:0 0 8px;color:var(--app-muted,#60718b)}
.vehicle-history-editor .pwa-file-options{display:flex;gap:8px;flex-wrap:wrap}
.vehicle-history-editor .vehicle-document{margin:0 8px 8px 0;max-width:100%}
.vehicle-history-editor .vehicle-history-message{margin:10px 0 0;font-size:14px}
.vehicle-history-editor .vehicle-history-message:empty{min-height:0;margin:0}
.vehicle-history-editor :is(button,a,input,select,textarea,summary):focus-visible{outline:2px solid var(--app-cyan,#1764e8);outline-offset:3px}
@container (max-width:600px){
 .vehicle-history-editor .vehicle-history-header{align-items:stretch;flex-direction:column}
 .vehicle-history-editor .vehicle-history-header>[data-vh-pdf]{align-self:flex-start;width:auto}
 .vehicle-history-editor .vehicle-history-summary{align-items:stretch;flex-direction:column;padding:14px}
 .vehicle-history-primary-actions{display:grid;grid-template-columns:1fr;gap:8px}
 .vehicle-history-editor .vehicle-history-primary-actions .app-button{width:100%}
 .vehicle-history-editor .app-form,.vehicle-history-attachment-grid{grid-template-columns:minmax(0,1fr)}
 .vehicle-history-editor .app-field.full{grid-column:1}
 .vehicle-history-editor .vehicle-service{grid-template-columns:minmax(0,1fr);gap:8px}
 .vehicle-history-editor .vehicle-service>.vehicle-history-actions{justify-content:flex-start}
 .vehicle-history-editor .vehicle-service-form,.vehicle-history-editor .vehicle-mileage-form{padding:14px}
 .vehicle-history-editor .vehicle-history-actions{display:grid;grid-template-columns:minmax(0,1fr)}
 .vehicle-history-editor .vehicle-history-actions>.app-button{width:100%;min-width:0}
 .vehicle-history-editor .pwa-file-options>.app-button{flex:1;min-width:80px}
}
/* Mobile maintenance overview */
.vehicle-history-editor .vehicle-history-header{margin-bottom:12px}
.vehicle-history-editor .vehicle-history-header>div{min-width:0}
.vehicle-history-editor .vehicle-mileage-reference{display:flex;align-items:center;gap:4px;margin-top:4px;min-width:0;color:var(--app-muted,#60718b)}
.vehicle-history-editor .vehicle-mileage-reference p{margin:0;font-size:14px;line-height:1.5;min-width:0;overflow-wrap:anywhere}
.vehicle-mileage-reference [data-vh-current],.vehicle-mileage-reference time{white-space:nowrap}
.vehicle-history-editor .vehicle-mileage-pencil{display:inline-flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;min-width:44px;height:44px;min-height:44px;padding:0;border:0;background:transparent;box-shadow:none;color:var(--app-cyan,#1764e8)}
.vehicle-history-editor .vehicle-history-register{width:100%;margin:0 0 4px;min-height:48px}
.vehicle-history-editor .vehicle-maintenance-row{display:grid;gap:2px;width:100%;padding:11px 4px;text-align:left;background:transparent;border:0;border-bottom:1px solid var(--app-line,#dce5f1);border-radius:0;color:inherit;cursor:pointer;font:inherit;overflow-wrap:anywhere}
.vehicle-maintenance-row strong{font-size:16px}
.vehicle-maintenance-row span{font-size:14px;color:var(--app-muted,#60718b)}
.vehicle-maintenance-row .vehicle-next-due{font-weight:600;color:var(--app-text,#162640)}
.vehicle-history-editor .vehicle-recent-row{display:grid;grid-template-columns:64px minmax(0,1fr) auto 12px;gap:8px;align-items:center;width:100%;padding:12px 4px;min-height:48px;font:inherit;font-size:13px;color:inherit;background:transparent;border:0;border-bottom:1px solid var(--app-line,#dce5f1);text-align:left;cursor:pointer;overflow-wrap:anywhere}
.vehicle-recent-row time,.vehicle-recent-row>span{color:var(--app-muted,#60718b)}
.vehicle-recent-row strong{font-size:14px}
.vehicle-history-editor .vehicle-history-full{margin:8px 0}
.vehicle-history-editor .vehicle-history-full>summary{color:var(--app-cyan,#1764e8)}
.vehicle-history-editor .vehicle-service-detail{border-bottom:1px solid var(--app-line,#dce5f1);padding:0}
.vehicle-history-editor .vehicle-components{border:0;padding:0;margin:0;min-width:0}
.vehicle-components legend{font-size:14px;font-weight:600;margin-bottom:4px}
.vehicle-components label{display:inline-flex;align-items:center;gap:8px;min-height:44px;margin-right:12px;font-size:14px;cursor:pointer}
.vehicle-components small{display:block;color:var(--app-muted,#60718b);font-size:13px}
.vehicle-history-editor [data-vh-components] summary{min-height:44px}
@container(max-width:420px){
 .vehicle-history-editor .vehicle-recent-row{grid-template-columns:58px minmax(0,1fr) 12px;column-gap:8px;row-gap:0}
 .vehicle-recent-row time{grid-row:1/3}
 .vehicle-recent-row>span:nth-child(3){grid-column:2;font-size:13px}
 .vehicle-recent-row>span:last-child{grid-column:3;grid-row:1/3}
}

/* Public NFC: authorized maintenance first, compact spacing in light and dark themes. */
#publicVehicleHistory{gap:10px;margin-top:16px;padding-top:0;min-width:0}
#publicVehicleHistory h2{margin:0;font-size:18px;color:inherit}
#publicVehicleHistory .vehicle-public-maintenance{display:grid;gap:8px}
#publicVehicleHistory .vehicle-public-service{padding:12px 14px;margin:0;border:1px solid var(--line,#d8e1e9);border-radius:12px;min-width:0;overflow-wrap:anywhere}
#publicVehicleHistory .vehicle-public-service h3{margin:0 0 4px;font-size:16px;line-height:1.4;color:inherit}
#publicVehicleHistory .vehicle-public-service p{margin:3px 0;font-size:14px;line-height:1.5;color:inherit}
#publicVehicleHistory .vehicle-public-next{font-weight:700}
#publicVehicleHistory .vehicle-public-service.soon{border-left:4px solid #ad7300}
#publicVehicleHistory .vehicle-public-service.overdue{border-left:4px solid #c74343}
#publicVehicleHistory .vehicle-public-alert{display:inline-block;margin-top:5px;font-size:13px;line-height:1.5;font-weight:700;padding:3px 8px;border-radius:6px}
#publicVehicleHistory .vehicle-public-alert.soon{background:#fff0c2;color:#684400}
#publicVehicleHistory .vehicle-public-alert.overdue{background:#ffe1e1;color:#852323}
#publicVehicleHistory .vehicle-public-mileage{font-size:13px;line-height:1.5;margin:8px 0 2px;opacity:.8;overflow-wrap:anywhere}
#publicVehicleHistory .vehicle-public-full{margin:0;min-width:0}
#publicVehicleHistory .vehicle-public-full>summary{display:list-item;cursor:pointer;min-height:44px;padding:10px 0;box-sizing:border-box;font-size:14px;font-weight:700}
#publicVehicleHistory .vehicle-public-full>summary:focus-visible{outline:2px solid currentColor;outline-offset:2px}
#publicVehicleHistory .vehicle-public-full .vehicle-public-service{margin-top:8px}
#publicVehicleHistory .vehicle-public-message{font-size:14px;margin:0;line-height:1.5}
#publicVehicleHistory [data-history-pdf]{min-height:44px;margin:0;padding:10px 14px;font-size:14px;white-space:normal}
#publicVehicleHistory .profile-feedback:empty{display:none}
[data-public-vehicle-history]:empty{display:none}
.vehicle-history-editor .vehicle-form-feedback{padding:10px 12px;margin:10px 0 0;border-radius:8px;font-size:14px;line-height:1.5;overflow-wrap:anywhere;background:var(--app-surface,#f1f6fc);color:var(--app-text,#162640)}
.vehicle-history-editor .vehicle-form-feedback.error{background:#fff0f0;color:#922525;border:1px solid #d77878}
.vehicle-history-editor [aria-invalid=true]{border-color:#b33232!important;outline:2px solid #b33232;outline-offset:1px}
