/* FAST 1.9.18 mobile preview: only activates on phone-sized viewports. */
@media(max-width:767px){
 html,body{max-width:100%;min-width:0;overflow-x:clip}body{font-size:15px}
 header{height:auto;min-height:64px;padding:9px 12px;gap:8px;display:flex;flex-wrap:nowrap;max-width:100%;min-width:0}
 header .logo{flex:0 0 auto;min-width:0}header .fast-brand{width:clamp(68px,19vw,94px)!important;max-width:100%;height:auto}
 header .header-right{margin-left:auto;flex:0 1 auto;min-width:0;display:flex;gap:5px;flex-wrap:nowrap;align-items:center}
 header .trial{display:none!important}header .header-right>*{min-width:0}
 header .language-switch{flex:none;padding:2px;gap:0}header .language-switch button{font-size:11px;padding:8px 6px}
 header #fast-account-button,header .header-right>button{width:34px;min-width:34px;height:36px;padding:4px;display:grid;place-items:center}
 header select{min-width:0!important;max-width:clamp(92px,28vw,160px)!important;width:100%!important;font-size:11px!important;padding:7px 15px 7px 5px!important;text-overflow:ellipsis}
 main,.fast-list-view main{display:block!important;width:100%;min-width:0;max-width:100%;height:auto!important;padding:12px!important;overflow:visible}
 main>.inventory,main>.details{width:100%;max-width:100%;min-width:0;overflow:visible!important;padding:0!important}
 main>.details{display:none!important}body.fast-mobile-detail main>.inventory{display:none!important}body.fast-mobile-detail main>.details{display:block!important}
 .fast-mobile-back{display:block!important;width:100%;min-height:46px;text-align:left;margin:0 0 12px;background:#233f5d;border:1px solid #456789;border-radius:12px;font-size:15px}
 .panel,.detail-card{max-width:100%;min-width:0}.panel{padding:14px!important}.panel select{max-width:100%;width:100%}
 .addrow{display:flex;min-width:0}.addrow input{min-width:0;width:100%;font-size:16px}.addrow button{padding:10px 12px;font-size:13px}
 .toolbar{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:10px!important;align-items:center!important;max-width:100%;width:100%;margin-top:12px}
 .toolbar .tabs{grid-column:1/-1;display:flex;gap:7px}.toolbar .tabs button{font-size:14px!important;padding:9px 14px!important;min-height:42px}
 .toolbar #search{grid-column:1;width:100%!important;min-width:0!important;flex:none!important;font-size:16px!important;min-height:44px;padding:10px 14px!important}
 .toolbar .view-switch{grid-column:2}.toolbar .view-switch button{width:39px!important;height:39px!important}
 .fast-inventory-meta{display:flex!important;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;max-width:100%}
 #count{font-size:12px!important;min-width:0}.fast-sort-controls{max-width:100%;min-width:0}.fast-sort-controls select{max-width:100%;font-size:14px}
 .cards{display:flex!important;flex-direction:column!important;gap:10px!important;min-width:0;max-width:100%}
 .vehicle-card,.fast-list-view .vehicle-card{width:100%;max-width:100%;min-width:0;overflow:hidden}
 .vehicle-card .name{font-size:14px;white-space:normal;overflow-wrap:anywhere;line-height:1.3;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
 .vehicle-card .price{font-size:19px}.vehicle-card button{min-height:39px}
 .detail-card{overflow:hidden}body:not(.future-preview) .detail-content{padding:14px!important}.detail-title{font-size:19px}.detail-price{font-size:24px}
 .hero{max-width:100%;height:auto}.thumbs{max-width:100%;overflow-x:auto}.specs{grid-template-columns:repeat(2,minmax(0,1fr))}
 .detail-content input,.detail-content select,.detail-content textarea,.details input,.details select,.details textarea{max-width:100%;min-width:0;font-size:16px}
 .details img{max-width:100%}.details .detail-actions{flex-wrap:wrap}.details .detail-actions button{min-height:44px}
 .details [style*="grid-template-columns"]{max-width:100%}
}
@media(max-width:390px){header{padding:8px 7px;gap:4px}header .header-right{gap:3px}header .fast-brand{width:68px!important}header select{max-width:100px!important}.fast-sort-controls{width:100%;justify-content:flex-end}}
@media(min-width:768px){.fast-mobile-back{display:none!important}}

/* Preview 2: prevent header overflow and keep inventory controls in one row. */
@media(max-width:767px){
 header{width:100%;overflow:hidden;padding:8px 10px!important;gap:6px!important}
 header .logo{flex:0 0 82px!important;width:82px!important}
 header .fast-brand{width:82px!important;max-width:82px!important}
 header .header-right{flex:1 1 0!important;width:0;justify-content:flex-end;gap:4px!important;overflow:hidden}
 header .fast-role-switch{flex:1 1 50px;min-width:0;max-width:125px;overflow:hidden;padding:2px}
 header .fast-role-switch select{width:100%!important;max-width:100%!important;min-width:0!important;font-size:10px!important;padding:8px 15px 8px 4px!important;text-overflow:ellipsis}
 header .language-switch{flex:0 0 auto}header .language-switch button{font-size:11px;padding:8px 5px}
 header #fast-account-button,header .header-right>button{flex:0 0 32px;width:32px!important;min-width:32px!important}
 .toolbar{display:flex!important;flex-flow:row nowrap!important;gap:5px!important;align-items:center!important}
 .toolbar .tabs{flex:0 0 auto!important;display:flex!important;gap:3px!important;min-width:0}
 .toolbar .tabs button{min-height:36px!important;font-size:11px!important;padding:7px 6px!important}
 .toolbar #search{flex:1 1 0!important;width:0!important;min-width:0!important;min-height:38px!important;padding:7px 8px!important;font-size:14px!important}
 .toolbar .view-switch{flex:0 0 auto!important;gap:1px!important}
 .toolbar .view-switch button{width:29px!important;height:34px!important;padding:4px!important}
 body.fast-mobile-detail main>.inventory{display:none!important;visibility:hidden!important}
 body.fast-mobile-detail main>.details{display:block!important;visibility:visible!important;width:100%!important;min-width:0!important}
 body.fast-mobile-detail main{display:block!important}
}
@media(max-width:390px){header .logo{flex-basis:70px!important;width:70px!important}header .fast-brand{width:70px!important}.toolbar .tabs button{padding:6px 4px!important;font-size:10px!important}.toolbar .view-switch button{width:26px!important}}

/* Preview 3: enforce single-row toolbar and viewport-safe header after static assets load. */
@media(max-width:767px){
 body,html{width:100%;overflow-x:clip}
 header{display:flex!important;align-items:center!important;flex-wrap:nowrap!important;min-width:0!important}
 header .header-right{min-width:0!important;flex:1 1 auto!important;overflow:visible!important;gap:3px!important}
 header .fast-role-switch{flex:1 1 0!important;min-width:0!important;max-width:none!important}
 header .fast-role-switch select{max-width:100%!important;width:100%!important;font-size:10px!important}
 header .language-switch{flex:0 0 auto!important}
 header #fast-account-button{flex:0 0 30px!important;min-width:30px!important;width:30px!important}
 .inventory .toolbar{display:flex!important;flex-direction:row!important;flex-wrap:nowrap!important;align-items:center!important;gap:4px!important}
 .inventory .toolbar .tabs{display:flex!important;flex:0 0 auto!important;gap:2px!important}
 .inventory .toolbar .tabs button{padding:7px 5px!important;font-size:11px!important;min-height:35px!important}
 .inventory .toolbar #search{flex:1 1 0!important;width:0!important;min-width:0!important;font-size:14px!important;padding:7px 8px!important}
 .inventory .toolbar .view-switch{flex:0 0 auto!important}
 body.fast-mobile-detail main>.inventory{display:none!important}
 body.fast-mobile-detail main>.details{display:block!important}
}

/* Preview 4 — mobile control geometry and overflow containment.
   Scoped to phones; desktop appearance and application logic are unchanged. */
@media (max-width:767px){
  header .header-right{display:flex!important;align-items:center!important;flex-wrap:nowrap!important;min-width:0!important}
  header .fast-role-switch{flex:0 1 auto!important;width:auto!important;min-width:0!important;max-width:min(42vw,190px)!important;padding:2px!important}
  header .fast-role-switch select{width:auto!important;max-width:100%!important;min-width:0!important;padding:7px 20px 7px 6px!important;background-position:right 5px center!important;white-space:nowrap;text-overflow:ellipsis}
  header .language-switch{display:inline-flex!important;align-items:center!important;flex:0 0 auto!important;min-width:max-content!important;white-space:nowrap}
  header .language-switch button{flex:0 0 27px!important;min-width:27px!important;width:27px!important;height:30px!important;padding:0!important;text-align:center}
  header #fast-account-button,header .header-right>button:not(.language-switch button){box-sizing:border-box!important;flex:0 0 32px!important;width:32px!important;min-width:32px!important;max-width:32px!important;height:32px!important;min-height:32px!important;border-radius:50%!important;aspect-ratio:1!important;padding:0!important;display:grid!important;place-items:center!important}
  .inventory .toolbar .tabs button{flex:none!important;white-space:nowrap}
  .inventory .toolbar .view-switch{flex:none!important;min-width:max-content!important;display:flex!important;align-items:center!important}
  .inventory .toolbar .view-switch button{box-sizing:border-box!important;flex:0 0 32px!important;width:32px!important;min-width:32px!important;height:32px!important;min-height:32px!important;aspect-ratio:1!important;border-radius:50%!important;padding:6px!important}
  .inventory .toolbar .view-switch svg{width:18px!important;height:18px!important}
  .vehicle-card .actions{min-width:0!important;display:flex!important;align-items:center!important;flex-wrap:nowrap!important}
  .vehicle-card .actions .open{flex:1 1 0!important;min-width:0!important}
  .vehicle-card .actions .icon-action{box-sizing:border-box!important;flex:0 0 34px!important;width:34px!important;min-width:34px!important;max-width:34px!important;height:34px!important;min-height:34px!important;aspect-ratio:1!important;border-radius:50%!important;padding:7px!important}
  .addrow{display:flex!important;align-items:stretch!important;gap:10px!important}
  .addrow #stock{flex:1 1 62%!important;width:0!important;min-width:0!important}
  .addrow #generate{flex:0 0 34%!important;min-width:112px!important;max-width:38%!important;background:#d83a49!important;color:#fff!important;padding:10px 8px!important;white-space:nowrap}
  .detail-media .photo-upload-actions{padding:10px 14px 12px!important;margin:0!important;justify-content:flex-start!important;max-width:100%!important;box-sizing:border-box!important}
  .detail-card,.detail-content,.detail-options,.specs,.spec,.editable{min-width:0!important;max-width:100%!important;box-sizing:border-box!important}
  .detail-content .specs{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:9px!important}
  .detail-content .spec{min-width:0!important;overflow:hidden!important}
  .fast-carfax-inline,.fast-carfax-inline .carfax-badges,.fast-carfax-inline .fast-verified-badges{display:flex!important;flex-wrap:wrap!important;align-items:center!important;justify-content:flex-start!important;gap:8px!important;max-width:100%!important;min-width:0!important}
  .fast-carfax-inline img,.fast-carfax-inline .carfax-badge-image,.fast-carfax-inline .fast-verified-badges img{display:block!important;box-sizing:border-box!important;width:auto!important;max-width:100%!important;height:41px!important;object-fit:contain!important;flex:0 1 auto!important}
  .carfax-link-row{display:flex!important;min-width:0!important;max-width:100%!important;gap:7px!important}
  .carfax-link-row input{flex:1 1 0!important;width:0!important;min-width:0!important}
  .carfax-link-row button{flex:0 0 auto!important;max-width:45%!important;padding:8px!important;white-space:normal!important}
}
@media(max-width:380px){
  header .fast-brand{width:65px!important}
  header .logo{flex-basis:65px!important;width:65px!important}
  header .fast-role-switch{max-width:37vw!important}
  .detail-content .specs{grid-template-columns:minmax(0,1fr)!important}
  .addrow #generate{min-width:102px!important}
}

/* FAST 1.9.18.1 — focused mobile refinement */
/* The Generate action is red on every viewport. */
#generate,#generate.primary{background:#d83a49!important;color:#fff!important}
#generate:hover{background:#e54b59!important}
/* Compact counts, including desktop; keep the original count element for JS updates. */
#count{display:flex!important;align-items:center;flex-wrap:wrap;gap:6px!important;margin:0!important;min-width:0}
.fast-count-chip{display:inline-flex;align-items:center;gap:5px;white-space:nowrap;border:1px solid #38536e;border-radius:999px;background:#1a3047;padding:3px 9px;font-size:11px;line-height:1.4;color:#b9cee1}
.fast-count-chip strong{font-size:12px;color:#f4f8ff;font-weight:750}
@media(max-width:767px){
 /* Center icon glyphs within a fixed square, regardless of inherited padding. */
 header .header-right button:not(.language-switch button){display:grid!important;place-items:center!important;line-height:1!important;text-align:center!important;padding:0!important}
 header .header-right button:not(.language-switch button) svg{display:block;margin:auto;flex:none}
 /* The selected card only indicates the side-by-side editor on desktop. */
 .vehicle-card.selected,.fast-list-view .vehicle-card.selected{border-color:transparent!important;box-shadow:none!important}
 .vehicle-card.selected:hover{border-color:#446b98!important}
 /* Match the listing button height to all three round actions. */
 .vehicle-card .actions{align-items:center!important;gap:7px!important}
 .vehicle-card .actions .open{height:34px!important;min-height:34px!important;max-height:34px!important;padding:0 8px!important;line-height:34px!important}
 .vehicle-card .actions .icon-action{height:34px!important;width:34px!important;min-height:34px!important;min-width:34px!important;padding:0!important;display:grid!important;place-items:center!important;line-height:1!important}
 .vehicle-card .actions .icon-action svg{display:block;max-width:19px;max-height:19px}
 /* Allow two columns to shrink without truncating the control itself. */
 .details .specs,.details .specs.editable,.details .marketplace-fields{grid-template-columns:repeat(2,minmax(0,1fr))!important;max-width:100%!important;min-width:0!important}
 .details .spec,.details .specs>div{min-width:0!important;max-width:100%!important;box-sizing:border-box!important}
 .details .specs label,.details .spec small{overflow-wrap:anywhere}
 .fast-count-chip{padding:3px 7px}
}
@media(max-width:380px){.details .specs,.details .specs.editable,.details .marketplace-fields{grid-template-columns:minmax(0,1fr)!important}}

/* FAST 1.9.18.2: compact statistics, mobile hover suppression and native select sizing. */
#count{display:flex!important;align-items:center!important;flex-wrap:nowrap!important;white-space:nowrap!important;gap:5px!important}
.fast-count-chip{flex:0 0 auto!important;white-space:nowrap!important}
@media(max-width:767px){
 #count{gap:4px!important;width:100%!important;overflow:hidden!important}
 .fast-count-chip{font-size:10px!important;padding:3px 5px!important;gap:3px!important}
 .fast-count-chip strong{font-size:11px!important}
 .vehicle-card:hover,.vehicle-card:focus,.vehicle-card:focus-within,.vehicle-card.selected,.vehicle-card.selected:hover,.fast-list-view .vehicle-card:hover,.fast-list-view .vehicle-card.selected{outline:none!important;box-shadow:none!important;border-color:transparent!important;transform:none!important}
 /* Single canonical mobile Marketplace control rule. Both controls share
    typography, box geometry, and alignment; selects alone reserve arrow space. */
 .details .spec input,.details .spec select,
 .details .specs input,.details .specs select,
 .detail-content .spec input,.detail-content .spec select{
  display:block!important;box-sizing:border-box!important;
  width:100%!important;min-width:0!important;max-width:100%!important;
  height:33px!important;min-height:33px!important;max-height:33px!important;
  margin:0!important;border:1px solid #3b5978!important;border-radius:9px!important;
  background-color:#10243a!important;color:var(--text)!important;
  font-family:"Open Sans",sans-serif!important;font-size:14px!important;
  font-weight:600!important;line-height:normal!important;
  padding:0 8px!important;text-overflow:ellipsis!important;
  white-space:nowrap!important;overflow:hidden!important;
 }
 .details .spec select,.details .specs select,.detail-content .spec select{
  -webkit-appearance:none!important;appearance:none!important;
  padding-right:25px!important;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' stroke='%23dce9f7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E")!important;
  background-repeat:no-repeat!important;background-size:12px 8px!important;
  background-position:right 8px center!important;
 }
 .details .spec select:disabled,.detail-content .spec select:disabled{
  opacity:1!important;-webkit-text-fill-color:var(--text)!important;
 }
 .details .spec select option,.details .specs select option{font-size:14px!important}

}

/* v1.9.18.6 — mobile-only shared gallery adjustments */
@media (max-width: 767px) {
  .fast-shared-gallery .gallery-selector { margin: 14px; }
  .fast-shared-gallery .hero { border-radius: 0; }
}
