/* Enhanced VIN review only; the approved calculator shell stays intact. */

.vehicle-details-dialog{width:min(760px,calc(100vw - 40px));max-width:none;max-height:calc(100dvh - 32px);padding:0;border:1px solid var(--border);border-radius:18px;color:var(--text);background:var(--card);box-shadow:0 24px 80px #0005;overflow:hidden}

.vehicle-details-dialog[open]{display:flex;flex-direction:column}

.vehicle-details-dialog::backdrop{background:rgba(7,22,43,.68)}

.vehicle-details-open .calculator-navigation{visibility:hidden!important}

.vd-header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 24px;background:var(--card);border-bottom:1px solid var(--border);flex:none}

.vd-brand img{display:block;width:220px;max-width:65vw;height:auto}.vd-brand span{display:block;margin-top:5px;padding-left:120px;font-size:.75rem;color:var(--muted)}

.vd-logo-dark{display:none!important}.dark .vd-logo-light{display:none!important}.dark .vd-logo-dark{display:block!important}

.vd-header button{width:44px;height:44px;padding:0;font-size:1.6rem;border-radius:50%}

.vd-scenic{flex:none;height:64px;background:url('../assets/home-scenic-hero-preferred.webp') 68% 60%/cover no-repeat}.dark .vd-scenic{box-shadow:inset 0 0 0 100px #071c3540}

.vd-body{padding:22px 24px;overflow-y:auto;min-height:0;overscroll-behavior:contain}

.vd-body h2{font-size:1.5rem;margin:0 0 6px}.vd-body h3{font-size:1rem;margin:0 0 8px}.vd-body p{font-size:.875rem;line-height:1.5;margin:8px 0 14px}.vd-body>label{display:block;font-size:.875rem;font-weight:650;margin:16px 0 6px}

.vd-reopen{color:var(--accent)}.vd-vin-row{display:flex;gap:12px;align-items:center}.vd-vin-row input{flex:1;min-width:0;font-family:monospace;letter-spacing:.04em}

.vehicle-details-dialog :is(input,select,button){min-height:44px;max-width:100%;font-size:.875rem}.vehicle-details-dialog input,.vehicle-details-dialog select{width:100%;margin-top:0;background:var(--bg);border:1px solid var(--border);border-radius:8px;color:var(--text);padding:10px}

.vehicle-details-dialog button{font-weight:650}.vehicle-details-dialog button:not(.secondary){background:#075dc8;color:#fff}

.vd-error,.vd-fixture{padding:12px 14px;border-radius:10px;background:var(--soft);border:1px solid var(--border);color:var(--text)}.vd-error{border-left:4px solid #d48a24}.vd-fixture{font-size:.8125rem;line-height:1.5;margin:12px 0;font-weight:650}

.vd-identity,.vd-evidence,.vd-warnings{padding:16px;border:1px solid var(--border);border-radius:12px;margin:16px 0;background:var(--soft)}

.vd-identity-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:0}.vd-identity-grid div{display:block;border:0;padding:0}.vd-identity-grid dt{font-size:.75rem;color:var(--muted)}.vd-identity-grid dd{margin:3px 0 0;font-size:.875rem;font-weight:650;overflow-wrap:anywhere;text-align:left}

.vd-footer{flex:none;display:flex;justify-content:space-between;align-items:center;gap:16px;padding:16px 24px;border-top:1px solid var(--border);background:var(--card)}.vd-footer>span{font-size:.75rem;color:var(--muted)}.vd-footer>div{display:flex;gap:10px}.vehicle-details-dialog [hidden]{display:none!important}



.vd-vin-row{justify-content:flex-start}.vehicle-details-dialog .vd-vin-row input{flex:none;width:22ch;max-width:100%}.vd-vin-row button{white-space:nowrap}.vd-body label{display:block;font-weight:650;font-size:.875rem;margin-bottom:6px}

.vd-identity h3{font-size:1.45rem;margin-bottom:4px}.vd-eyebrow{font-size:.7rem!important;font-weight:700;letter-spacing:.12em;color:var(--accent)}.vd-engine{color:var(--muted)}.vd-identity-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:12px}.vd-source{font-size:.75rem!important;color:var(--muted);line-height:1.5}

.vd-confirmation{margin:18px 0}.vd-confirmation>div{display:flex;gap:10px;flex-wrap:wrap}.vd-edit-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin-top:20px}.vd-edit-field:first-child{grid-column:1/-1}.vd-conflict{color:var(--muted);font-size:.8125rem!important;margin-bottom:0!important}.vd-warnings p:last-child{margin-bottom:0}.vd-footer{justify-content:flex-end}.vd-footer>div{flex-wrap:wrap}

@media(max-width:600px){.vehicle-details-dialog{width:calc(100vw - 16px);max-height:calc(100dvh - 16px);border-radius:14px}.vd-header{padding:12px 14px}.vd-brand img{width:184px}.vd-brand span{padding-left:96px;font-size:.625rem}.vd-scenic{height:48px}.vd-body{padding:18px 14px}.vd-body h2{font-size:1.2rem}.vd-vin-row{flex-direction:column;align-items:stretch;gap:8px}.vehicle-details-dialog .vd-vin-row input{width:100%;max-width:24ch}.vd-identity-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.vd-confirmation>div{display:grid;grid-template-columns:1fr}.vd-edit-grid{grid-template-columns:1fr}.vd-footer{padding:12px 14px}.vd-footer>div{display:flex;width:100%;gap:8px;justify-content:flex-end}.vd-footer button{padding:9px 10px;font-size:.8125rem}}

@media(prefers-reduced-motion:reduce){.vehicle-details-dialog *{scroll-behavior:auto!important}}


/* Results/editing refinement only: approved entry-mode geometry is unchanged. */
.vehicle-details-dialog[data-mode="summary"],.vehicle-details-dialog[data-mode="edit"]{width:min(620px,calc(100vw - 40px))}
.vehicle-details-dialog[data-mode="summary"] .vd-body,.vehicle-details-dialog[data-mode="edit"] .vd-body{padding:16px 22px}
.vehicle-details-dialog[data-mode="summary"] .vd-header,.vehicle-details-dialog[data-mode="edit"] .vd-header{padding:12px 22px}
.vehicle-details-dialog[data-mode="summary"] .vd-brand img,.vehicle-details-dialog[data-mode="edit"] .vd-brand img{width:190px}
.vehicle-details-dialog[data-mode="summary"] .vd-brand span,.vehicle-details-dialog[data-mode="edit"] .vd-brand span{padding-left:104px;font-size:.6875rem}
.vehicle-details-dialog[data-mode="summary"] .vd-scenic,.vehicle-details-dialog[data-mode="edit"] .vd-scenic{height:48px}
.vehicle-details-dialog[data-mode="summary"] .vd-body>h2{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.vehicle-details-dialog .vd-text-action{display:inline-block;background:transparent!important;color:var(--accent)!important;padding:8px 0;border:0;text-decoration:underline;box-shadow:none;font-weight:600;min-height:44px}
.vehicle-details-dialog[data-mode="summary"] .vd-identity{padding:0;border:0;border-radius:0;background:transparent;margin:8px 0 12px}
.vehicle-details-dialog[data-mode="summary"] .vd-eyebrow{margin:0 0 6px}.vehicle-details-dialog[data-mode="summary"] .vd-engine{margin:6px 0 14px}
.vd-powertrain-line{display:flex;justify-content:space-between;gap:16px;align-items:baseline;font-size:.875rem;padding:10px 0;border-block:1px solid var(--border)}
.vehicle-details-dialog[data-mode="summary"] .vd-confirmation{margin:14px 0}.vehicle-details-dialog[data-mode="summary"] .vd-confirmation h3{margin-bottom:10px}
.vehicle-details-dialog[data-mode="summary"] .vd-conflict{margin:8px 0 0}.vehicle-details-dialog[data-mode="summary"] .vd-warnings,.vehicle-details-dialog[data-mode="edit"] .vd-warnings{padding:0 0 0 10px;border:0;border-left:3px solid var(--border);background:transparent;border-radius:0;margin:12px 0}
.vehicle-details-dialog[data-mode="summary"] .vd-warnings p,.vehicle-details-dialog[data-mode="edit"] .vd-warnings p{font-size:.8125rem;margin:6px 0}
.vd-edit-identity{font-weight:650;color:var(--muted)}.vehicle-details-dialog[data-mode="edit"] #vehicleDetailsRows{display:block;margin:14px 0}.vehicle-details-dialog[data-mode="edit"] .vd-edit-field{max-width:100%}
#vehicleDetailsOther,#vehicleDetailsAbout{margin-top:12px;font-size:.8125rem;color:var(--muted)}#vehicleDetailsOther summary,#vehicleDetailsAbout summary{min-height:44px;display:list-item;align-content:center;cursor:pointer;color:var(--accent)}#vehicleDetailsOther .vd-edit-grid{margin-top:10px}
@media(max-width:600px){.vehicle-details-dialog[data-mode="summary"],.vehicle-details-dialog[data-mode="edit"]{width:calc(100vw - 16px)}.vehicle-details-dialog[data-mode="summary"] .vd-header,.vehicle-details-dialog[data-mode="edit"] .vd-header{padding:12px 14px}.vehicle-details-dialog[data-mode="summary"] .vd-brand img,.vehicle-details-dialog[data-mode="edit"] .vd-brand img{width:184px}.vehicle-details-dialog[data-mode="summary"] .vd-brand span,.vehicle-details-dialog[data-mode="edit"] .vd-brand span{padding-left:96px;font-size:.625rem}.vehicle-details-dialog[data-mode="summary"] .vd-body,.vehicle-details-dialog[data-mode="edit"] .vd-body{padding:14px}.vd-powertrain-line{gap:10px;flex-wrap:wrap}.vehicle-details-dialog[data-mode="summary"] .vd-identity h3{font-size:1.25rem}}

label.vehicle-details-completed{display:none!important}
.vehicle-details-dialog[data-mode="edit"] #vehicleDetailsRows{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.vehicle-details-dialog[data-mode="edit"] #vehicleDetailsRows .vd-edit-field:first-child{grid-column:1/-1}
.vd-legal-help{display:block;font-size:.6875rem;color:var(--muted);line-height:1.4;margin-top:6px}
@media(max-width:600px){.vehicle-details-dialog[data-mode="edit"] #vehicleDetailsRows{grid-template-columns:1fr}}
/* Compact state-required editor; entry and results presentation is preserved. */
.vehicle-details-dialog[data-mode="edit"]{width:min(700px,calc(100vw - 40px))}
.vehicle-details-dialog[data-mode="edit"] #vehicleDetailsRows{grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:12px;margin:10px 0 4px}
.vehicle-details-dialog[data-mode="edit"] #vehicleDetailsRows .vd-edit-field:first-child{grid-column:auto}
.vehicle-details-dialog[data-mode="edit"] #vehicleDetailsRows[data-count="1"]{grid-template-columns:minmax(0,320px)}
.vehicle-details-dialog[data-mode="edit"] #vehicleDetailsRows[data-count="2"]{grid-template-columns:1.5fr 1fr}
.vehicle-details-dialog[data-mode="edit"] #vehicleDetailsRows[data-count="3"]{grid-template-columns:1.6fr 1fr 1fr}
.vehicle-details-dialog[data-mode="edit"] .vd-edit-identity{margin:6px 0 8px}
.vehicle-details-dialog[data-mode="edit"] #vehicleDetailsAnother{padding:2px 0;min-height:36px;font-size:.8125rem}
.vd-field-label{display:flex;align-items:center;gap:6px;min-height:32px;margin-bottom:4px}
.vd-field-label label{margin:0;line-height:1.3}
.vd-field-help{font-size:.75rem;color:var(--muted)}
.vd-field-help summary{list-style:none;display:flex;align-items:center;justify-content:center;width:28px;height:28px;border:1px solid var(--border);border-radius:50%;background:var(--soft);color:var(--accent);font-weight:700;cursor:pointer}
.vd-field-help summary:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
.vd-field-help[open] .vd-help-content{position:absolute;inset-inline:0;z-index:2;background:var(--card);border:1px solid var(--border);border-radius:8px;padding:12px;box-shadow:0 4px 12px #0002;line-height:1.5}
.vehicle-details-dialog[data-mode="edit"] #vehicleDetailsEditing{position:relative}
@media(max-width:600px){
 .vehicle-details-dialog[data-mode="edit"]{width:calc(100vw - 16px)}
 .vehicle-details-dialog[data-mode="edit"] #vehicleDetailsRows{grid-template-columns:repeat(2,minmax(0,1fr))}
 .vehicle-details-dialog[data-mode="edit"] #vehicleDetailsRows[data-count="3"]{grid-template-columns:repeat(2,minmax(0,1fr))}
 .vehicle-details-dialog[data-mode="edit"] #vehicleDetailsRows[data-count="3"] .vd-edit-field:first-child{grid-column:1/-1}
 .vehicle-details-dialog[data-mode="edit"] #vehicleDetailsRows[data-count="2"]{grid-template-columns:repeat(2,minmax(0,1fr))}
}
/* Read-only decoded specifications; initial entry and compact editor untouched. */
.vd-specifications{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 18px;margin:12px 0}
.vd-specifications div{display:block;min-width:0;border:0;padding:0}
.vd-specifications dt{font-size:.75rem;color:var(--muted);line-height:1.35}
.vd-specifications dd{font-size:.875rem;font-weight:600;line-height:1.4;margin:2px 0 0;text-align:left;overflow-wrap:anywhere}
.vd-additional-specifications{margin:8px 0 12px}
.vd-additional-specifications>summary{cursor:pointer;min-height:44px;align-content:center;color:var(--accent);font-size:.8125rem;font-weight:600}
.vd-additional-specifications>summary:focus-visible{outline:3px solid var(--accent);outline-offset:2px;border-radius:4px}
@media(max-width:380px){.vd-specifications{gap:9px 12px}.vd-specifications dd{font-size:.8125rem}}
/* Results-only identity consolidation; approved entry/editor geometry retained. */
.vehicle-details-dialog[data-mode="summary"] .vd-identification h3{margin:0 0 5px}
.vd-compact-specs{margin:0;font-size:.875rem;line-height:1.5;color:var(--muted);overflow-wrap:anywhere}
.vehicle-details-dialog[data-mode="summary"] .vd-additional-specifications{margin:6px 0 8px}
.vehicle-details-dialog[data-mode="summary"] .vd-additional-specifications>summary{min-height:36px}
/* Narrow only decoded results; entry and state-required editing stay unchanged. */
.vehicle-details-dialog[data-mode="summary"]{width:min(520px,calc(100vw - 40px))}
.vehicle-details-dialog[data-mode="summary"] .vd-compact-specs{margin:0}
@media(max-width:600px){.vehicle-details-dialog[data-mode="summary"]{width:calc(100vw - 16px)}}
/* Shared approved-image presentation, independent of text height. */
.vehicle-details-dialog[data-mode="summary"]{width:min(860px,calc(100vw - 40px))}
.vin-confirmed-identification,.vin-result-identification{display:grid;grid-template-columns:minmax(0,1fr);align-items:start;gap:16px;min-width:0;width:100%}
.vin-confirmed-identification.vin-has-image,.vin-result-identification.vin-has-image{grid-template-columns:minmax(0,1fr) 256px}
.vin-confirmed-text{display:block;min-width:0;overflow-wrap:anywhere}
.vin-confirmed-text>strong{display:block;color:var(--text);font-size:.875rem;line-height:1.4}
.vin-confirmed-specs{display:block;color:var(--muted);font-size:.75rem;line-height:1.4;margin-top:4px}
.vin-confirmed-text .vin-entry-link{display:block;min-height:44px;font-size:.8125rem;padding:4px 0;text-align:left;background:transparent;color:var(--accent)}
.vin-confirmed-text .vin-entry-link:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
.vin-image{display:block;width:256px;max-width:100%;margin:0;justify-self:end}
.vin-representative{display:block;width:100%;height:auto;object-fit:contain;border:0;padding:0}
.vin-image figcaption{font-size:.75rem;line-height:1.4;color:var(--muted);margin-top:6px;white-space:normal}
.vin-image[hidden],.vin-image figcaption[hidden]{display:none!important}
.calculator-entry-status{min-width:0}
.purchase-layout #vehicleVinEntry[hidden],.purchase-layout #vehicle[hidden],#vehicleConfirmedDescription[hidden]{display:none!important}
#vehicleConfirmedDescription{margin-top:6px}
/* Span the existing lookup/description row; State and Condition retain their
   separate first-row positions in the current shared two-column grid. */
@media(min-width:851px){
 .purchase-layout #purchase-vehicle-fields.vin-description-confirmed>.purchase-description-field,
 .purchase-layout.private-purchase-scope #purchase-vehicle-fields.vin-description-confirmed>.purchase-description-field{grid-column:1/-1;grid-row:2}
}
@media(max-width:850px){
 .vin-image{width:128px}
 .vin-confirmed-identification.vin-has-image,.vin-result-identification.vin-has-image{grid-template-columns:minmax(0,1fr) 128px;gap:12px}
}
@media(max-width:600px){
 .vehicle-details-dialog[data-mode="summary"]{width:calc(100vw - 16px)}
 .vin-confirmed-identification.vin-has-image,.vin-result-identification.vin-has-image{grid-template-columns:minmax(0,1fr)}
 .vin-image{justify-self:end}
}
