/* Shared add/edit picker; native values continue to serve save and AI flows. */
body .mobile-modal .vcp-field { position: relative; min-width: 0; }
body .mobile-modal select.vcp-native { position: absolute !important; width: 1px !important; min-width: 0 !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; margin: -1px !important; border: 0 !important; clip-path: inset(50%); overflow: hidden !important; pointer-events: none; }
body .mobile-modal .vcp-search-replaced { display: none !important; }
body .mobile-modal button.vcp-trigger { display: flex !important; align-items: center; justify-content: space-between; gap: 10px; width: 100% !important; min-width: 0; min-height: 48px; height: auto; margin: 0; padding: 12px; border: 1px solid #dcdedb; border-radius: 12px; background: #fff; color: #213e49; font: inherit; font-size: 16px; line-height: 1.45; text-align: left; box-shadow: none; }
body .mobile-modal .vcp-value { display: block; min-width: 0; overflow-wrap: anywhere; font: inherit; color: inherit; }
body .vcp-trigger svg, body .vcp-card svg { flex: 0 0 18px; width: 18px; height: 18px; fill: none; stroke: #aa8643; stroke-width: 1.8; }
body .vcp-trigger.is-empty { color: #7b8588; }
body .vcp-trigger:disabled { opacity: .55; cursor: not-allowed; }
body dialog.vcp-dialog { box-sizing: border-box; width: min(760px, calc(100vw - 28px)); max-width: none; height: min(680px, calc(100dvh - 32px)); max-height: calc(100dvh - 32px); margin: auto; padding: 0; border: 1px solid #e0dfd7; border-radius: 24px; background: #fbfaf7; color: #24404b; box-shadow: 0 24px 80px #102d4940; overflow: hidden; font: 16px/1.5 system-ui, -apple-system, 'Microsoft JhengHei', sans-serif; }
body dialog.vcp-dialog[open] { display: flex; flex-direction: column; }
body dialog.vcp-dialog::backdrop { background: #14293780; }
.vcp-dialog *, .vcp-dialog *::before, .vcp-dialog *::after { box-sizing: border-box; }
.vcp-dialog button, .vcp-dialog input { font: inherit; letter-spacing: normal; }
body dialog.vcp-dialog, body dialog.vcp-dialog * { font-family: system-ui, -apple-system, 'Microsoft JhengHei', sans-serif !important; }
.vcp-dialog button { cursor: pointer; }
.vcp-dialog button:disabled { opacity: .45; cursor: not-allowed; }
.vcp-dialog button:focus-visible, .vcp-trigger:focus-visible, .vcp-dialog input:focus-visible { outline: 3px solid #b28a43; outline-offset: 2px; }
.vcp-head { display: flex; flex: 0 0 auto; justify-content: space-between; align-items: center; padding: 22px 24px 18px; gap: 12px; border-bottom: 1px solid #e6e4dc; }
.vcp-head small { font-size: 12px; color: #9a7d45; }
.vcp-head h2 { margin: 2px 0 0; font-size: 23px; font-weight: 750; line-height: 1.4; }
.vcp-close { flex: 0 0 44px; width: 44px; height: 44px; border: 1px solid #dfdfd8; border-radius: 50%; background: #fff; color: #294551; font-size: 28px !important; }
.vcp-steps { display: grid; grid-template-columns: 1fr 1fr; flex: 0 0 auto; gap: 10px; padding: 18px 24px 12px; }
.vcp-steps button { min-width: 0; min-height: 68px; padding: 9px 12px; border: 1px solid #e0e2df; border-radius: 12px; background: #fff; text-align: left; color: #5d6b70; }
.vcp-steps button.is-active { background: #edf4f3; border-color: #577f86; color: #214753; }
.vcp-steps small { display: block; font-size: 12px; }
.vcp-steps strong { display: block; font-size: 16px; font-weight: 650; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.vcp-search { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; margin: 0 24px; padding: 0 12px; border: 1px solid #dcded8; border-radius: 12px; background: #fff; }
.vcp-search > svg { width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: #9c824d; stroke-width: 1.6; }
body dialog.vcp-dialog .vcp-search input { width: 100%; min-width: 0; height: 48px; padding: 8px 0; border: 0 !important; box-shadow: none !important; background: transparent; color: #223d49; font-size: 16px !important; }
.vcp-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.vcp-clear { width: 30px; height: 32px; padding: 0; border: 0; background: transparent; color: #6b7475; font-size: 22px !important; }
.vcp-clear[hidden] { display: none; }
.vcp-count { flex: 0 0 auto; margin: 12px 24px 8px; color: #7b8581; font-size: 13px; }
.vcp-results { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); grid-auto-rows: min-content; align-content: start; gap: 10px; min-height: 0; flex: 1 1 auto; overflow: auto; overscroll-behavior: contain; padding: 2px 24px 20px; }
.vcp-card { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-width: 0; min-height: 46px; padding: 3px 14px; border: 1px solid #e0e2db; border-radius: 13px; background: #fff; color: #28424d; text-align: left; font-weight: 650 !important; }
.vcp-card span { min-width: 0; overflow-wrap: anywhere; }
.vcp-brands .vcp-card { min-height: 56px; background: #f4f3ec; }
.vcp-card.is-selected { border-color: #a88643; background: #fff7e4; }
.vcp-card b { color: #9a7531; }
@media (hover:hover) { .vcp-card:hover { border-color: #9f874f; background: #faf5e9; } }
.vcp-empty { grid-column: 1 / -1; padding: 25px 5px; color: #77827f; text-align: center; }
.vcp-footer { display: flex; flex: 0 0 auto; justify-content: space-between; gap: 12px; padding: 14px 24px max(14px,env(safe-area-inset-bottom)); border-top: 1px solid #e4e3db; background: #fff; }
.vcp-footer button { min-height: 44px; padding: 9px 18px; border: 1px solid #ddded8; border-radius: 11px; background: #fff; color: #38525b; }
.vcp-footer [data-vcp-brand-only] { background: #f4f3eb; border-color: #d6c99e; }
@media(max-width:599px) {
  body dialog.vcp-dialog { border-radius: 20px; }
  .vcp-head { padding: 16px; }.vcp-head h2 { font-size: 21px; }
  .vcp-steps { padding: 14px 16px 12px; }.vcp-search { margin: 0 16px; }.vcp-count { margin: 10px 16px 8px; }
  .vcp-results { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 2px 16px 16px; gap: 9px; }.vcp-card { padding: 3px 12px; }
  .vcp-footer { padding-left: 16px; padding-right: 16px; }
}

/* Brand imagery and explicit third-step year selection. */
.vcp-steps { grid-template-columns:repeat(3,minmax(0,1fr)); }
.vcp-brands .vcp-card { position:relative; flex-direction:column; justify-content:center; gap:5px; min-height:82px; padding:8px 18px; text-align:center; font-size:14px; }
.vcp-logo { width:72px; height:30px; object-fit:contain; }
.vcp-brands .vcp-card > svg,.vcp-brands .vcp-card > b { position:absolute;right:5px;top:8px;width:12px; }
.vcp-years { grid-template-columns:repeat(4,minmax(0,1fr)); }
.vcp-years .vcp-card { justify-content:center; padding:6px; min-height:44px; }
.vcp-years .vcp-card > svg { display:none; }
@media(max-width:599px) { .vcp-brands {grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;} .vcp-brands .vcp-card {padding:7px 10px;font-size:12px;} .vcp-steps {gap:6px;} .vcp-steps button {padding:7px;} .vcp-head h2 {font-size:19px;} }

.vcp-logo[src$="/dfsk.png"], .vcp-logo[src$="/foxtron.png"] { background:#263d47; border-radius:4px; padding:4px; }

.vcp-years .vcp-card {position:relative;white-space:nowrap;} .vcp-years .vcp-card > b {position:absolute;right:3px;top:1px;font-size:11px;}

/* Alphabetical brand grid matched to the compact logo reference. */
body dialog.vcp-dialog .vcp-brands {grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;}
.vcp-brand-letter {grid-column:1 / -1;margin:12px 0 0;padding:0 0 5px;border-bottom:1px solid #d8d9d4;font-size:13px;font-weight:650;color:#4b5353;line-height:1.3;}
.vcp-brand-letter:first-child {margin-top:0;}
body dialog.vcp-dialog .vcp-brands .vcp-card {height:92px;min-height:92px;padding:10px 3px;gap:8px;border-radius:10px;background:#f3f3f5;justify-content:center;text-align:center;}
body dialog.vcp-dialog .vcp-brands .vcp-card > span {font-family:Arial,sans-serif;font-size:12px!important;font-weight:700;line-height:1.2;color:#172027;overflow-wrap:normal;}
body dialog.vcp-dialog .vcp-brands .vcp-logo {width:40px;height:28px;object-fit:contain;flex:0 0 28px;}
body dialog.vcp-dialog .vcp-brands .vcp-card > svg {display:none;}
body dialog.vcp-dialog .vcp-brands .vcp-card.is-selected {background:#fff7e4;border-color:#a88643;}
@media(max-width:360px){body dialog.vcp-dialog .vcp-brands .vcp-card > span {font-size:10px!important;}}

/* Compact reference header and undistorted logo slots. */
body dialog.vcp-dialog[data-picker-stage="brand"] .vcp-head {padding:14px 16px;min-height:64px;}
body dialog.vcp-dialog[data-picker-stage="brand"] .vcp-head small,body dialog.vcp-dialog[data-picker-stage="brand"] .vcp-steps,body dialog.vcp-dialog[data-picker-stage="brand"] .vcp-count {display:none;}
body dialog.vcp-dialog[data-picker-stage="brand"] .vcp-head h2 {font-size:18px!important;}
body dialog.vcp-dialog[data-picker-stage="brand"] .vcp-search {margin:14px 16px 12px;}
body dialog.vcp-dialog .vcp-brands .vcp-card {height:auto!important;min-height:88px!important;aspect-ratio:1.22;gap:9px!important;padding:10px 4px!important;}
body dialog.vcp-dialog .vcp-brands .vcp-logo {display:block!important;width:40px!important;height:36px!important;min-width:40px!important;max-width:40px!important;min-height:36px!important;max-height:36px!important;flex:0 0 36px!important;object-fit:contain!important;object-position:center!important;}
body dialog.vcp-dialog .vcp-brands .vcp-card span {flex:0 0 auto!important;}

body dialog.vcp-dialog .vcp-brands .vcp-card {box-sizing:border-box!important;min-width:0!important;width:100%!important;max-width:100%!important;min-height:0!important;}

/* Three aligned identity fields; registry sections span their parent grid. */
body .mobile-modal .vcp-three-fields {display:block!important;grid-column:1 / -1!important;width:100%!important;min-width:0!important;box-sizing:border-box;}
body .mobile-modal .vcp-three-fields .manage-brand-grid {display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:10px!important;width:100%!important;grid-column:1 / -1!important;}
body .mobile-modal .vcp-three-fields .manage-brand-grid > .mobile-field {grid-column:auto!important;width:auto!important;min-width:0!important;}
body .mobile-modal .vcp-three-fields .vcp-trigger,body .mobile-modal .vcp-three-fields .vcp-year-field input {height:52px!important;min-height:52px!important;width:100%!important;box-sizing:border-box!important;padding:10px!important;font-size:16px!important;}
body .mobile-modal .vcp-three-fields .vcp-value {overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;}
body .mobile-modal .vcp-three-fields .manage-brand-actions {display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:6px!important;margin-top:12px!important;width:100%!important;}
body .mobile-modal .vcp-three-fields .manage-brand-actions button {min-width:0!important;padding:8px 3px!important;font-size:12px!important;}
body .mobile-modal [data-add-section="registry"],body .mobile-modal [data-manage-section="registry"] {grid-column:1 / -1!important;width:100%!important;max-width:none!important;min-width:0!important;box-sizing:border-box!important;}
@media(max-width:899px){body .mobile-modal [data-add-section="registry"] .manage-vehicle-fields,body .mobile-modal [data-manage-section="registry"] .manage-vehicle-fields {display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;width:100%!important;min-width:0!important;gap:12px!important;}body .mobile-modal .manage-vehicle-fields > .mobile-field {min-width:0!important;}body .mobile-modal .manage-vehicle-fields .intake-plate-fields {grid-column:1 / -1!important;}}

/* Align all three fields and place maintenance actions under their own field. */
body .mobile-modal .form-section.vcp-three-fields .manage-brand-grid {align-items:start!important;gap:10px!important;}
body .mobile-modal .form-section.vcp-three-fields .manage-brand-grid > label {display:flex!important;flex-direction:column!important;gap:8px!important;margin:0!important;}
body .mobile-modal .form-section.vcp-three-fields .manage-brand-grid > label > span {margin:0!important;line-height:1.4!important;font-size:14px!important;}
body .mobile-modal .form-section.vcp-three-fields .manage-brand-grid .vcp-trigger,body .mobile-modal .form-section.vcp-three-fields .manage-brand-grid .vcp-year-field input {appearance:none!important;display:flex!important;align-items:center!important;height:52px!important;min-height:52px!important;max-height:52px!important;margin:0!important;padding:0 10px!important;border:1px solid #dddfdc!important;border-radius:12px!important;background:#fff!important;box-shadow:0 1px 2px #1e354506!important;color:#29434e!important;font-size:15px!important;line-height:normal!important;}
body .mobile-modal .form-section.vcp-three-fields .manage-brand-grid .vcp-trigger svg {width:14px!important;flex:0 0 14px!important;}
body .mobile-modal .form-section.vcp-three-fields .manage-brand-actions {grid-template-columns:repeat(3,minmax(0,1fr))!important;grid-template-rows:auto auto!important;gap:6px 10px!important;padding:0!important;margin:10px 0 0!important;}
body .mobile-modal .form-section.vcp-three-fields .manage-brand-actions button {position:static!important;width:100%!important;min-height:28px!important;height:28px!important;max-height:28px!important;padding:3px!important;border-radius:7px!important;font-size:11px!important;line-height:20px!important;background:#faf9f5!important;box-shadow:none!important;}





/* Plate and replacement choice share a row; replacement plate spans the next row. */
body .mobile-modal [data-add-section="registry"] .manage-vehicle-fields .intake-plate-fields,body .mobile-modal [data-manage-section="registry"] .manage-vehicle-fields .intake-plate-fields {display:contents!important;}
body .mobile-modal .manage-vehicle-fields .intake-plate-fields > .mobile-field {grid-column:auto!important;min-width:0!important;width:100%!important;}
body .mobile-modal .manage-vehicle-fields .intake-plate-fields > [data-vehicle-intake-replacement-field] {grid-column:1 / -1!important;}
body .mobile-modal .manage-vehicle-fields .intake-plate-fields > [data-vehicle-intake-replacement-field][hidden] {display:none!important;}

body .mobile-modal .form-section.vcp-three-fields .manage-brand-grid .vcp-trigger,body .mobile-modal .form-section.vcp-three-fields .manage-brand-grid .vcp-year-field input {height:42px!important;min-height:42px!important;max-height:42px!important;border-radius:10px!important;}
body .mobile-modal .form-section.vcp-three-fields .manage-brand-actions {grid-template-columns:repeat(4,minmax(0,1fr))!important;grid-template-rows:auto!important;gap:6px!important;margin-top:10px!important;}
body .mobile-modal .form-section.vcp-three-fields .manage-brand-actions button {grid-column:auto!important;grid-row:1!important;white-space:nowrap!important;}

/* Only the actual selected filter is gold; touch hover/focus is not selection. */
body dialog.vcp-filter-dialog .vcp-card:not(.is-selected){background:#fff!important;border-color:#e0e2db!important;box-shadow:none!important;}
body dialog.vcp-filter-dialog .vcp-brands .vcp-card:not(.is-selected){background:#f3f3f5!important;}
body dialog.vcp-filter-dialog .vcp-card.is-selected{background:#fff7e4!important;border-color:#a88643!important;}
body dialog.vcp-filter-dialog .vcp-card:focus-visible{outline:2px solid #43768e;outline-offset:2px;}
body dialog.vcp-filter-dialog .vcp-card>b{color:#9f7834;font-size:17px;}
body dialog.vcp-filter-dialog .vcp-brands .vcp-card>b{position:absolute;right:6px;top:4px;}
