dialog.p18-dialog{box-sizing:border-box;width:min(94vw,580px);max-width:580px;max-height:90dvh;margin:auto;padding:0;border:0;border-radius:22px;background:#fff;color:#202124;box-shadow:0 24px 90px #0005;overflow:hidden;font:inherit}dialog.p18-dialog[open]{display:flex;flex-direction:column}.p18-dialog::backdrop{background:#1119}.p18-dialog *{box-sizing:border-box}.p18-head{position:relative;padding:24px 24px 16px;border-bottom:1px solid #eee}.p18-head h2{font-size:25px;line-height:1.2;margin:8px 35px 14px 0}.p18-kicker{font-size:11px;font-weight:800;letter-spacing:1px;color:#a65b16}.p18-close{position:absolute;right:18px;top:18px;border:0;background:#f4f4f4;border-radius:50%;width:36px;height:36px;font-size:24px;color:#333;cursor:pointer}.p18-progress{display:flex;gap:5px}.p18-progress span{height:4px;flex:1;background:#e9e9e9;border-radius:4px}.p18-progress .done{background:#e98218}.p18-choices{overflow:auto;min-height:0;padding:18px 24px;display:flex;flex-direction:column;gap:10px}.p18-summary{display:flex;align-items:center;gap:12px;background:#f6f6f6;border-radius:12px;padding:10px;margin-bottom:5px}.p18-summary img,.p18-choice img{width:58px;height:58px;object-fit:cover;border-radius:9px}.p18-summary small,.p18-choice small,.p18-total small,.p18-review small{display:block;color:#666;font-size:13px;margin-top:4px}.p18-choice{display:flex;align-items:center;gap:12px;width:100%;text-align:left;border:1px solid #ddd;background:#fff;color:#222;padding:14px;border-radius:12px;cursor:pointer;font:inherit;min-height:64px}.p18-choice-text{flex:1;min-width:0}.p18-choice strong{font-size:15px}.p18-selected{border-color:#e98218;background:#fff7ed}.p18-check{width:22px;height:22px;border:1px solid #ccc;border-radius:50%;display:grid;place-items:center;flex:none}.p18-selected .p18-check{background:#e98218;color:white;border-color:#e98218}.p18-footer{padding:15px 24px 20px;border-top:1px solid #eee;background:#fff}.p18-total{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.p18-total strong{font-size:22px}.p18-nav{display:flex;gap:10px}.p18-nav button{font:inherit;font-weight:700;border-radius:10px;padding:13px 18px;cursor:pointer}.p18-back{border:1px solid #ddd;background:white;color:#333}.p18-primary{flex:1;border:0;background:#c65d08;color:white}.p18-dialog button:disabled{opacity:.5;cursor:not-allowed}.p18-hint,.p18-error{font-size:14px;margin:4px 0}.p18-error{color:#a22}.p18-review{padding:10px 0;border-bottom:1px solid #eee}.p18-review strong{display:block;margin-top:4px}@media(max-width:600px){dialog.p18-dialog{width:100%;max-width:none;max-height:92dvh;margin:auto 0 0;border-radius:20px 20px 0 0}.p18-head,.p18-choices,.p18-footer{padding-left:16px;padding-right:16px}.p18-footer{padding-bottom:max(16px,env(safe-area-inset-bottom))}}
/* V18D: scoped layout and native-scroll enhancement */
dialog.p18-dialog{--p18-accent:#c65d08;--p18-scroll:#d67b29;width:min(94vw,540px);max-width:540px;height:min(650px,calc(100dvh - 32px));max-height:calc(100dvh - 32px);border-radius:18px;overscroll-behavior:contain}
.p18-dialog .p18-head,.p18-dialog .p18-footer{flex:none;padding:14px 18px}.p18-dialog .p18-head h2{font-size:22px;margin:5px 36px 12px 0}.p18-dialog .p18-close{top:12px;right:12px}.p18-dialog .p18-choices{flex:1 1 auto;min-height:0;padding:12px 18px;gap:7px;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--p18-scroll) transparent;touch-action:pan-y}.p18-dialog .p18-choices::-webkit-scrollbar{width:6px;height:6px}.p18-dialog .p18-choices::-webkit-scrollbar-track{background:transparent}.p18-dialog .p18-choices::-webkit-scrollbar-thumb{background:var(--p18-scroll);border-radius:10px}.p18-dialog .p18-choices::-webkit-scrollbar-button{display:none;width:0;height:0}.p18-dialog .p18-progress span{height:auto;background:none;border-top:3px solid #e9e9e9;padding-top:5px;font-size:10px;color:#666;text-align:center;white-space:nowrap}.p18-dialog .p18-progress .done{border-color:#e98218;color:#a65310}.p18-dialog .p18-summary{padding:7px;gap:9px;margin:0}.p18-dialog .p18-summary img,.p18-dialog .p18-choice img{width:44px;height:44px}.p18-dialog .p18-choice{padding:9px 11px;min-height:48px;flex-shrink:0;gap:8px}.p18-dialog .p18-choice small{font-size:12px;margin-top:2px}.p18-dialog .p18-nav button{padding:10px 14px;min-height:44px}.p18-dialog .p18-total{margin-bottom:8px}.p18-dialog .p18-review{padding:5px 0}.p18-dialog .p18-review strong{margin-top:2px;font-size:14px}.p18-dialog .p18-count-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.p18-dialog .p18-count-grid .p18-choice{flex-direction:column;text-align:center;position:relative;padding:9px 5px}.p18-dialog .p18-count-grid svg{width:48px;height:48px}.p18-dialog .p18-count-grid .p18-check{position:absolute;right:6px;top:6px;width:17px;height:17px;font-size:11px}.p18-dialog .p18-selected-list{display:flex;flex-wrap:wrap;gap:5px}.p18-dialog .p18-selected-list span{background:#fff2e3;color:#93470a;border-radius:8px;padding:5px 8px;font-size:12px}.p18-dialog .p18-search{width:100%;min-height:40px;border:1px solid #ddd;border-radius:9px;padding:8px 10px;font:inherit}.p18-dialog [hidden]{display:none!important}.p18-dialog button:focus-visible,.p18-dialog input:focus-visible{outline:2px solid var(--p18-accent);outline-offset:2px}
@media(min-width:480px){.p18-dialog .p18-count-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:600px){dialog.p18-dialog{width:100%;max-width:none;height:min(650px,96dvh);max-height:96dvh;margin:auto 0 0;border-radius:18px 18px 0 0}.p18-dialog .p18-head,.p18-dialog .p18-choices,.p18-dialog .p18-footer{padding-left:14px;padding-right:14px}.p18-dialog .p18-footer{padding-bottom:max(12px,env(safe-area-inset-bottom))}}

/* V18E — adaptive dialog and custom scroll indicator */
dialog.p18-dialog{height:auto;max-height:calc(100dvh - 32px);width:min(94vw,540px)}
.p18-dialog .p18-choices{flex:0 1 auto;scrollbar-width:none;padding-right:22px;position:relative}.p18-dialog .p18-choices::-webkit-scrollbar{display:none!important;width:0!important;height:0!important}.p18-dialog .p18-scroll-rail{position:absolute;right:4px;width:4px;pointer-events:none;z-index:2;overflow:hidden;border-radius:8px}.p18-dialog .p18-scroll-thumb{display:block;width:4px;border-radius:8px;background:var(--p18-scroll);opacity:.8}.p18-dialog .p18-choice{min-height:44px;padding:8px 10px}.p18-dialog .p18-count-grid svg{width:52px;height:52px}.p18-dialog .p18-review-flavor{display:flex;align-items:center;gap:8px;margin:5px 0}.p18-dialog .p18-fraction{font-size:11px;background:#fff2e3;color:#93470a;border-radius:6px;padding:3px 7px;min-width:34px;text-align:center}.p18-dialog .p18-breakdown{background:#f7f7f7;border-radius:10px;padding:10px 12px}.p18-dialog .p18-breakdown-line{display:flex;justify-content:space-between;gap:8px;font-size:13px;padding:3px 0}.p18-dialog .p18-head,.p18-dialog .p18-footer{padding-block:12px}.p18-dialog .p18-progress span{white-space:normal}.p18-dialog .p18-summary{flex-shrink:0}.p18-dialog .p18-choice-text{overflow-wrap:anywhere}
@media(max-width:600px){dialog.p18-dialog{height:auto;width:100%;max-width:none;max-height:96dvh}.p18-dialog .p18-footer{padding-bottom:max(12px,env(safe-area-inset-bottom))}.p18-dialog .p18-choices{padding-right:18px}.p18-dialog .p18-progress span{font-size:9px}}
/* Restrict cart sizing to the review stage, not checkout. */
@supports selector(:has(*)){@media(min-width:601px){#cartModal .cart-sheet:has(#cartReviewActions:not(.hidden)):not(:has(#checkoutModeSwitch:not(.hidden))){max-width:720px;width:min(94vw,720px);margin-inline:auto}}}

/* V18F: explicit intrinsic sizing; only the content region may shrink. */
dialog.p18-dialog[open]{position:fixed;inset:0;margin:auto;height:fit-content;min-height:0;max-height:calc(100dvh - 32px);outline:none;align-items:stretch;justify-content:flex-start}
.p18-dialog .p18-head,.p18-dialog .p18-footer{flex:0 0 auto}
.p18-dialog .p18-choices{flex:0 1 auto;min-height:0;height:auto}
.p18-dialog .p18-choices:focus-visible{outline:2px solid var(--p18-accent);outline-offset:-3px}
@media(max-width:600px){dialog.p18-dialog[open]{inset:auto 0 0;margin:0;width:100%;max-height:calc(100dvh - 12px);height:fit-content;min-height:0}}
#cartModal .p18-cart-details{display:flex;gap:12px;align-items:flex-start;min-width:0;flex:1}
#cartModal .p18-cart-photo{width:68px;height:68px;object-fit:cover;border-radius:10px;flex:none}
#cartModal .p18-cart-copy{min-width:0;overflow-wrap:anywhere}
#cartModal .p18-cart-flavor{display:flex;gap:7px;align-items:baseline;font-size:13px;margin:3px 0}
#cartModal .p18-cart-fraction{color:#93470a;background:#fff2e3;border-radius:5px;padding:2px 5px;font-size:11px;flex:none}
#cartModal .p18-cart-meta{font-size:12px;color:#666;margin:5px 0}
#cartModal .p18-cart-subtotal{display:flex;justify-content:space-between;align-items:center;padding:10px 0 14px;font-weight:700}
@media(max-width:480px){#cartModal .p18-cart-photo{width:44px;height:44px}#cartModal .p18-cart-details{gap:7px}#cartModal .cart-item:has(.p18-cart-details){flex-wrap:wrap}#cartModal .cart-item:has(.p18-cart-details) .cart-item-actions{margin-left:auto}}

/* V18G — purchase overlays and compact mobile review; no payment changes. */
body:has(dialog.p18-dialog[open],#cartModal:not(.hidden),#pixModal:not(.hidden),#productModal:not(.hidden)) #nomadePushEnable{display:none!important}
@media(max-width:768px){
 #cartModal:has(#cartReviewActions:not(.hidden)):not(:has(#checkoutGrid:not(.hidden),#checkoutModeSwitch:not(.hidden))){align-items:flex-end!important;justify-content:center!important}
 #cartModal:has(#cartReviewActions:not(.hidden)):not(:has(#checkoutGrid:not(.hidden),#checkoutModeSwitch:not(.hidden))) .modal-backdrop{display:block!important}
 #cartModal .cart-sheet:has(#cartReviewActions:not(.hidden)):not(:has(#checkoutGrid:not(.hidden),#checkoutModeSwitch:not(.hidden))){height:auto!important;min-height:0!important;max-height:calc(100dvh - max(12px,env(safe-area-inset-top)))!important;border-radius:20px 20px 0 0!important;display:flex!important;flex-direction:column;overflow:hidden!important;padding:0 0 max(12px,env(safe-area-inset-bottom))!important}
 #cartModal .cart-sheet:has(#cartReviewActions:not(.hidden)):not(:has(#checkoutGrid:not(.hidden),#checkoutModeSwitch:not(.hidden))) .sheet-head{flex:none;position:relative!important}
 #cartModal .cart-sheet:has(#cartReviewActions:not(.hidden)):not(:has(#checkoutGrid:not(.hidden),#checkoutModeSwitch:not(.hidden))) #cartItems{min-height:0;flex:0 1 auto;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#d67b29 transparent}
 #cartModal #cartItems::-webkit-scrollbar{width:4px}#cartModal #cartItems::-webkit-scrollbar-thumb{background:#d67b29;border-radius:8px}#cartModal #cartItems::-webkit-scrollbar-button{display:none}
 #cartModal #cartReviewActions{flex:none}
 dialog.p18-dialog[open]{max-height:calc(100dvh - max(12px,env(safe-area-inset-top)))}
 .p18-dialog .p18-footer{padding-bottom:calc(10px + env(safe-area-inset-bottom))}
 .p18-dialog[data-step="review"] .p18-choices{gap:4px;padding-block:8px}
 .p18-dialog[data-step="review"] .p18-summary{padding:5px 7px}
 .p18-dialog[data-step="review"] .p18-review{padding:3px 0}
 .p18-dialog[data-step="review"] .p18-review small{margin-top:0;font-size:12px}
 .p18-dialog[data-step="review"] .p18-review-flavor{margin:2px 0}
 .p18-dialog[data-step="review"] .p18-breakdown{padding:5px 9px}
 .p18-dialog[data-step="review"] .p18-breakdown-line{padding:2px 0}
}
