/* Mobile-host layout only. Keep the current quote artwork, type, palette,
   copy, native controls and calculation flow. Printed documents keep their
   existing paper layout. */
@media screen{
 /* Inline in the first view, so the existing stage visibility also hides AI. */
 body[data-cd-mobile="true"] #cm-story-view:not([hidden]) #quote-ai-open{display:inline-flex!important;position:static!important;grid-row:5;justify-self:start;align-items:center;min-height:44px;margin:8px 0 0;padding:8px 0!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;color:#e7eeea!important;font-size:13px!important;text-decoration:underline!important;text-underline-offset:4px}

 /* Keep the model name and whole vehicle together in the first phone screen.
    Only the presentational wrapper is flattened; controls keep their handlers. */
 body[data-cd-mobile="true"] #cm138 .cm-hero{display:grid;grid-template-columns:minmax(0,1fr);gap:0;min-height:0;padding:24px 16px}
 body[data-cd-mobile="true"] #cm138 .cm-hero-copy{display:contents}
 body[data-cd-mobile="true"] #cm138 .cm-eyebrow{grid-row:1;margin:0 0 12px;font-size:11px;line-height:1.5;overflow-wrap:anywhere}
 body[data-cd-mobile="true"] #cm138 #cm-model-title{grid-row:2;min-width:0;margin:0 0 20px;display:block!important}
 body[data-cd-mobile="true"] #cm138 #cm-model-title .cm-model-ko{font-size:clamp(32px,9vw,42px)!important;line-height:1.12!important;letter-spacing:-.025em!important;margin:0!important;max-width:100%;overflow-wrap:anywhere}
 body[data-cd-mobile="true"] #cm138 #cm-model-title .cm-model-local-name{margin-top:8px!important;font-size:14px!important;line-height:1.5!important}
 body[data-cd-mobile="true"] #cm138 #cm-model-title .cm-model-sub{margin-top:12px!important;font-size:14px!important;line-height:1.6!important}
 body[data-cd-mobile="true"] #cm138 .cm-hero-media{grid-row:3;position:relative;width:100%;height:clamp(170px,52vw,270px);min-height:0;margin:0 0 18px;padding:0;overflow:hidden}
 body[data-cd-mobile="true"] #cm138 .cm-hero-media img{position:static;display:block;width:100%;height:100%;max-height:100%;object-fit:contain!important;transform:none!important;padding:8px!important}
 body[data-cd-mobile="true"] #cm138 .cd-configure-top{grid-row:4;width:100%;min-width:0;min-height:48px;margin:0;padding:12px 16px;font-size:15px}
 body[data-cd-mobile="true"] #cm138 #cm-intro{grid-row:6;max-width:none;margin:18px 0;font-size:14px;line-height:1.75;word-break:keep-all;overflow-wrap:anywhere}
 body[data-cd-mobile="true"] #cm138 .cm-hero-price{grid-row:7}
 body[data-cd-mobile="true"] #cm138 .cm-hero-price strong{font-size:24px}
 body[data-cd-mobile="true"] #cm138 .cm-hero .cm-model-change{grid-row:8;justify-self:start;margin-top:12px;font-size:13px}

 body[data-cd-mobile="true"] #cm138{min-width:0;padding-bottom:calc(var(--cd-mobile-quote-dock-height,184px) + 84px)}
 body[data-cd-mobile="true"] #cm138 .cm-stepbar{position:sticky;top:var(--cd-mobile-header-height,64px);z-index:110;justify-content:flex-start;gap:8px;padding:8px 16px;max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;scroll-padding-inline:16px}
 body[data-cd-mobile="true"] #cm138 .cm-stepbar button{flex:0 0 auto;min-height:44px;padding:10px 12px}
 body[data-cd-mobile="true"] #cm138 .cm-workspace{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:20px!important;max-width:760px;padding:16px 16px 24px}
 body[data-cd-mobile="true"] #cm138 .cm-workspace>*,body[data-cd-mobile="true"] #cm138 [id^="cm-stage-"]{min-width:0}
 body[data-cd-mobile="true"] #cm138 [id^="cm-stage-"]{scroll-margin-top:calc(var(--cd-mobile-header-height,64px) + 72px);scroll-margin-bottom:calc(var(--cd-mobile-quote-dock-height,184px) + 16px)}

 /* Retain vehicle and price fields; show the shared stage instruction once. */
 body[data-cd-mobile="true"] #cm138 .cm-aside{position:static;display:grid!important;grid-template-columns:80px minmax(0,1fr);gap:4px 12px;align-items:center;margin:0;padding-bottom:14px}
 body[data-cd-mobile="true"] #cm138 .cm-aside-media{grid-column:1;grid-row:1/3;width:100%!important;height:64px!important;min-height:0;margin:0!important;padding:0!important}
 body[data-cd-mobile="true"] #cm138 #cm-aside-model{grid-column:2;margin:0;min-width:0;font-size:18px!important;line-height:1.4;overflow-wrap:anywhere}
 body[data-cd-mobile="true"] #cm138 .cm-aside-summary{grid-column:2;min-width:0;font-size:12px;line-height:1.5;overflow-wrap:anywhere}
 body[data-cd-mobile="true"] #cm138 .cd-price-breakdown{grid-column:1/-1;margin:8px 0 0;padding:8px 0;font-size:12px;line-height:1.6}
 body[data-cd-mobile="true"] #cm138 .cd-price-breakdown>div{gap:8px;margin:0;padding:3px 0}
 body[data-cd-mobile="true"] #cm138 .cm-aside-media img{transform:none!important}
 body[data-cd-mobile="true"] #cm138 .cm-aside-price{display:flex;grid-column:1/-1;align-items:baseline;justify-content:space-between;gap:12px;margin-top:0;padding-top:8px;min-width:0}
 body[data-cd-mobile="true"] #cm138 .cm-aside-price strong{min-width:0;font-size:22px;line-height:1.4;overflow-wrap:anywhere}
 body[data-cd-mobile="true"] #cm138 .cm-aside .cm-note{display:none} /* The same instruction is directly under the stage heading. */
 body[data-cd-mobile="true"] #cm138 .cm-stage-title{font-size:28px!important;line-height:1.35;word-break:keep-all}
 body[data-cd-mobile="true"] #cm138 .cm-stage-sub{font-size:14px;line-height:1.65;margin:8px 0 18px;overflow-wrap:anywhere}
 body[data-cd-mobile="true"] #cm138 :is(.cm-stage-title,.summary .sv,.benefit-hero>strong){overflow-wrap:anywhere}
 body[data-cd-mobile="true"] #cm138 :is(.cm-choice-grid,.cd-buyer-fields,.cd-buyer-types,.cd-package-fields,.summarygrid){grid-template-columns:minmax(0,1fr)!important}
 body[data-cd-mobile="true"] #cm138 :is(.cm-choice,.cm-trim-grid .cm-choice){min-width:0;padding:18px 16px}
 body[data-cd-mobile="true"] #cm138 :is(.cm-choice strong,.cm-choice small,.cm-note){overflow-wrap:anywhere}
 body[data-cd-mobile="true"] #cm138 :is(select,input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),textarea){max-width:100%;min-width:0;min-height:48px;scroll-margin-top:calc(var(--cd-mobile-header-height,64px) + 84px);scroll-margin-bottom:calc(var(--cd-mobile-quote-dock-height,184px) + 24px)}
 body[data-cd-mobile="true"] #cm138 :is(.cm-primary,.cm-model-change,.cd-finance-back,.cd-combo-categories button,.cm145-term-grid button,.cm-brands button){min-height:44px}
 body[data-cd-mobile="true"] #cm138 button{scroll-margin-top:calc(var(--cd-mobile-header-height,64px) + 86px);scroll-margin-bottom:calc(var(--cd-mobile-quote-dock-height,184px) + 84px)}
 body[data-cd-mobile="true"] #cm138 .cm-brands{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain}
 body[data-cd-mobile="true"] #cm138 .cm140-option-card .opt{padding:18px 14px 8px;gap:12px}
 body[data-cd-mobile="true"] #cm138 .cm140-option-more{max-width:calc(100% - 28px);margin:12px 14px!important}
 body[data-cd-mobile="true"] #cm138 :is(.cd-buyer-card,.cd-package-picker,.cd-combo-card){min-width:0}
 body[data-cd-mobile="true"] #cm138 :is(.cd-combo-payment,.cd-combo-breakdown,.cd-finance-receipt,.cd-package-stories,.cd-package-extras){grid-template-columns:minmax(0,1fr)!important}
 body[data-cd-mobile="true"] #cm138 :is(.cd-combo-top,.cd-combo-result,.cd-package-no-selection){flex-wrap:wrap}
 body[data-cd-mobile="true"] #cm138 :is(.cd-combo-result button,.cd-package-clear){min-height:48px}
 body[data-cd-mobile="true"] #cm138 .cd-package-picker dl>div{flex-wrap:wrap;gap:6px 14px}
 body[data-cd-mobile="true"] #cm138 .cd-package-picker dd{max-width:100%;overflow-wrap:anywhere}

 body[data-cd-mobile="true"] #cm138 :is(.amountgrid,.cm145-pay-grid){grid-template-columns:minmax(0,1fr)!important}
 body[data-cd-mobile="true"] #cm138 :is(.amountbox,.cd-buyer .cd-buyer-card){padding:18px 16px!important}
 body[data-cd-mobile="true"] #cm138 :is(input,select,textarea){font-size:16px}
 body[data-cd-mobile="true"] #cm138 .cm145-pay-grid button{min-height:88px;padding:16px}
 body[data-cd-mobile="true"] #cm138 .cd-finance-receipt>div{padding:16px}
 body[data-cd-mobile="true"] #cm138 .cd-finance-receipt>div+div{border-left:0;border-top:1px solid #d7e1da}
 body[data-cd-mobile="true"] #cm138 .cd-finance-receipt strong{font-size:24px}
 body[data-cd-mobile="true"] #cm138 .cm140-color-panel{padding:16px}
 body[data-cd-mobile="true"] #cm138 .cm140-color-summary{grid-template-columns:64px minmax(0,1fr);gap:12px;padding-bottom:16px}
 body[data-cd-mobile="true"] #cm138 .cm140-color-sample{height:80px;padding:4px}
 body[data-cd-mobile="true"] #cm138 .cm140-color-summary h3{font-size:18px;line-height:1.5;overflow-wrap:anywhere}
 body[data-cd-mobile="true"] #cm138 .cm140-color-summary strong{font-size:15px;line-height:1.5;overflow-wrap:anywhere}
 body[data-cd-mobile="true"] #cm138 .cm140-color-choice{min-width:0;white-space:normal;overflow-wrap:anywhere}
 body[data-cd-mobile="true"] #cm138 .cm150-color-footer{flex-wrap:wrap;gap:12px}
 body[data-cd-mobile="true"] #cm138 .cm150-color-next{min-height:48px;max-width:100%;white-space:normal}

 /* Keep the complete amount and benefit note above the existing next/back
    controls, with space for a phone's home indicator. */
 body[data-cd-mobile="true"] #cm138 .cm-dock{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;padding:10px 16px calc(10px + env(safe-area-inset-bottom,0px))}
 body[data-cd-mobile="true"] #cm138 .cm-dock-price{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:0 12px}
 body[data-cd-mobile="true"] #cm138 .cm-dock-price small{grid-column:1;font-size:11px;flex:1 1 120px;max-width:none;white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere}
 body[data-cd-mobile="true"] #cm138 .cm-dock-price strong{grid-column:2;text-align:right;font-size:18px;line-height:1.3;flex:0 1 auto;min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere}
 body[data-cd-mobile="true"] #cm138 .cm-dock-price span{display:block;grid-column:1;grid-row:2;margin:0;font-size:10px;line-height:1.5}
 body[data-cd-mobile="true"] #cm138 .cm-dock-actions{display:grid;grid-template-columns:minmax(0,.75fr) minmax(0,1.25fr);gap:10px;min-width:0}
 body[data-cd-mobile="true"] #cm138 .cm-dock-actions>.cm-prev[hidden]+.cm-next{grid-column:1/-1}
 body[data-cd-mobile="true"] #cm138 :is(.cm-prev,.cm-next){width:100%;min-width:0!important;min-height:48px;padding:8px 12px}
 body[data-cd-mobile="true"] #cm138 .cm-next{gap:8px}
 body[data-cd-mobile="true"] #cm138 .cm150-next-copy{min-width:0}
 body[data-cd-mobile="true"] #cm138 .cm150-next-copy strong{white-space:normal}
 body[data-cd-mobile="true"] #cm138 .cm-next>b{flex:none}


 /* Existing detail, image, quote and consultation dialogs scroll inside the
    visible viewport; their close controls stay reachable above the dock. */
 body[data-cd-mobile="true"] :is(#cm-model-modal,#cm163-trim-modal,#quoteModal,#consultModal){padding:8px;max-width:100vw;overscroll-behavior:contain}
 body[data-cd-mobile="true"] :is(.cm-modal-panel,.cm163-panel,#quoteModal .quote-modal,#consultModal .quote-modal){width:100%;min-width:0;max-height:calc(100dvh - 16px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));overflow:auto;overscroll-behavior:contain}
 body[data-cd-mobile="true"] .cm-modal-panel{padding:20px 16px}
 body[data-cd-mobile="true"] :is(.cm-modal-top,.cm163-top,#quoteModal .qm-head,#consultModal .qm-head){gap:12px;flex-wrap:wrap;align-items:flex-start}
 body[data-cd-mobile="true"] :is(.cm-modal-top,.cm163-top,.cm140-info-sheet>header) button{min-width:44px;min-height:44px;flex:none}
 body[data-cd-mobile="true"] .cm140-info-sheet{width:100%;max-width:100vw}
 body[data-cd-mobile="true"] .cm140-info-content{padding:16px 16px calc(24px + env(safe-area-inset-bottom,0px))}
 body[data-cd-mobile="true"] .cm161-lightbox-actions{flex-wrap:wrap;gap:8px}
 body[data-cd-mobile="true"] .cm161-lightbox-actions button{min-width:44px;min-height:44px}
 body[data-cd-mobile="true"] #quoteModal .qm-actions{display:flex;flex-wrap:wrap;gap:8px;max-width:100%;margin-left:0}
 body[data-cd-mobile="true"] #quoteModal .qm-actions button{min-height:44px}
 body[data-cd-mobile="true"] #quoteModal #quotePaper{padding:8px}
 body[data-cd-mobile="true"] #consultModal :is(input,select,button){min-height:44px;max-width:100%}
 body[data-cd-mobile="true"] #consultModal textarea{min-height:96px;max-width:100%}

 /* Saved documents retain every amount and original print/export styles. */
 body[data-cd-mobile="true"] #saved-status{padding:0 16px!important;overflow-wrap:anywhere}
 body[data-cd-mobile="true"] #saved-paper{box-sizing:border-box;width:100%;max-width:760px!important;min-width:0;padding:0 8px}
 body[data-cd-mobile="true"] :is(#saved-paper,#quotePaper) .cdq-document{padding:24px 16px;min-width:0}
 body[data-cd-mobile="true"] :is(#saved-paper,#quotePaper) :is(.cdq-vehicle,.cdq-overview,.cdq-columns){grid-template-columns:minmax(0,1fr)}
 body[data-cd-mobile="true"] :is(#saved-paper,#quotePaper) .cdq-masthead{flex-wrap:wrap;gap:16px}
 body[data-cd-mobile="true"] :is(#saved-paper,#quotePaper) .cdq-issued{text-align:left}
 body[data-cd-mobile="true"] :is(#saved-paper,#quotePaper) .cdq-row{grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);gap:10px}
 body[data-cd-mobile="true"] :is(#saved-paper,#quotePaper) .cdq-row>*{min-width:0;overflow-wrap:anywhere}
 body[data-cd-mobile="true"] :is(#saved-paper,#quotePaper) .cdq-item-group .cdq-row{grid-template-columns:minmax(0,1fr) minmax(0,.7fr)}
 body[data-cd-mobile="true"] :is(#saved-paper,#quotePaper) summary{box-sizing:border-box;min-height:44px;padding-block:10px}
 body[data-cd-mobile="true"]>nav.cdq-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;max-width:760px;margin:16px auto;padding:0 16px calc(16px + env(safe-area-inset-bottom,0px))}
 body[data-cd-mobile="true"]>nav.cdq-actions :is(a,button){display:flex;align-items:center;justify-content:center;min-width:0;min-height:48px;white-space:normal;text-align:center}
 body[data-cd-mobile="true"] #saved-consult-form{display:grid;grid-template-columns:minmax(0,1fr);gap:14px;max-width:760px;margin:16px auto;padding:16px}
 body[data-cd-mobile="true"] #saved-consult-form :is(input,select,button,textarea){box-sizing:border-box;width:100%;max-width:100%;min-height:48px}
 body[data-cd-mobile="true"] #saved-consult-form :is(input[type="checkbox"],input[type="radio"]){width:auto;min-height:0}
 body[data-cd-mobile="true"] :is(#saved-consult-form,.cdq-actions)[hidden],body[data-cd-mobile="true"] .cdq-actions [hidden]{display:none!important}
}
