/* SunDine/POS007 7.9.4 login-cart-scroll-router final bugfix layer.
   Purpose: route/login recovery, click contracts, document-owned mobile scrolling, modal hitboxes, health/deploy UI. */
:root{--sundine-fix-version:"7.9.4";}
html{min-height:100%;overflow-y:auto!important;overflow-x:hidden!important;scroll-behavior:auto;}
body{min-height:100%;overflow:visible!important;overscroll-behavior-y:auto!important;}
body.modal-open,body.sundine-modal-locked{overflow:hidden!important;}
@media (max-width:1100px),(pointer:coarse){
  body:not(.modal-open):not(.sundine-modal-locked){overflow:visible!important;height:auto!important;max-height:none!important;}
  .phone{height:auto!important;min-height:auto!important;max-height:none!important;overflow:hidden!important;overflow-x:clip!important;overflow-y:clip!important;-webkit-overflow-scrolling:auto!important;overscroll-behavior:initial!important;touch-action:auto!important;}
  .main,.page,.panel,.card,.list-card,.food-card,.role-card,.menu-frame,.menu-slider,.menu-page,.table-wrap,.table-scroll,.customer-shell,.customer-main,.customer-layout,.customer-menu,.customer-grid,.pos-cart-panel,.sundine-table-card{height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important;overflow-x:visible!important;overflow-y:visible!important;overscroll-behavior:initial!important;scroll-snap-type:none!important;}
  .toolbar,.chip-row{max-height:none!important;overflow-y:visible!important;}
}
/* Login route must remain usable even if legacy auth splash CSS loads. */
body.sundine-login-route .auth-shell,body.sundine-login-route main.auth-shell{display:flex!important;visibility:visible!important;opacity:1!important;min-height:100vh!important;align-items:center!important;justify-content:center!important;padding:18px!important;}
body.sundine-login-route .auth-card{display:block!important;visibility:visible!important;opacity:1!important;width:min(680px,calc(100vw - 28px))!important;max-width:680px!important;z-index:5!important;}
body.sundine-login-route .login-repair-card{display:block!important;}
.login-repair-card .field,.login-card .field{display:flex;flex-direction:column;gap:7px;margin:10px 0;}
.login-repair-card input,.login-card input{min-height:46px;border-radius:14px;padding:0 12px;}
.login-repair-card .toolbar,.login-card .toolbar{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px;}
.auth-required-card .toolbar a,.auth-required-card .toolbar button{min-height:44px;}
/* A single-click visual contract for route and action buttons. */
[data-route],a.btn,.food-action,.food-quick-add-btn,[data-action]{touch-action:manipulation;cursor:pointer;}
/* Customer modal: centered in the visual viewport and not constrained by .phone. */
#itemModal.modal-backdrop,.modal-backdrop[data-sundine-modal]{position:fixed!important;inset:0!important;z-index:99990!important;display:none!important;align-items:center!important;justify-content:center!important;padding:clamp(12px,3vw,22px)!important;background:rgba(0,0,0,.62)!important;backdrop-filter:blur(16px) saturate(1.05)!important;-webkit-backdrop-filter:blur(16px) saturate(1.05)!important;}
#itemModal.modal-backdrop.open,.modal-backdrop[data-sundine-modal].open{display:flex!important;}
#itemModal .modal,.sundine-item-dialog{position:relative!important;width:min(94vw,560px)!important;max-height:min(86dvh,720px)!important;overflow:auto!important;border-radius:26px!important;border:1px solid rgba(255,190,78,.38)!important;background:linear-gradient(145deg,rgba(77,26,8,.98),rgba(24,10,3,.97))!important;color:#fff6dd!important;box-shadow:0 34px 90px rgba(0,0,0,.54),inset 0 1px 0 rgba(255,230,150,.14)!important;padding:18px!important;transform:none!important;}
#itemModal .modal::before,.sundine-item-dialog::before{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(135deg,transparent 0 43%,rgba(255,157,45,.18) 44%,transparent 58%);border-radius:inherit;}
#itemModal .modal > *,.sundine-item-dialog > *{position:relative;z-index:1;}
#closeItemModal,.sundine-item-close,.qty button,.qty-btn,.option-chip,.addon-chip,#addToCart,[data-action="modal-add-to-cart"]{min-width:44px!important;min-height:44px!important;touch-action:manipulation!important;}
#closeItemModal,.sundine-item-close{width:46px!important;height:46px!important;display:inline-grid!important;place-items:center!important;border-radius:14px!important;}
.qty,.qty-control{display:flex;align-items:center;gap:12px;}
.qty button,.qty-btn{width:48px!important;height:48px!important;border-radius:14px!important;display:inline-grid!important;place-items:center!important;font-size:20px!important;}
.option-chip,.addon-chip,.chip.opt{border-radius:999px!important;padding:0 16px!important;font-weight:900!important;}
.option-chip[aria-pressed="true"],.addon-chip[aria-pressed="true"],.chip.opt.active{background:linear-gradient(135deg,#ffd66b,#ff862e)!important;color:#190b02!important;border-color:transparent!important;}
#posItemModal .pos-option-chip{position:relative!important;min-height:44px!important;padding:10px 16px!important;font-weight:950!important;border-width:2px!important;transition:transform .12s ease,box-shadow .12s ease,background .12s ease!important;}
#posItemModal .pos-option-chip.active,#posItemModal .pos-option-chip[aria-pressed="true"]{background:linear-gradient(135deg,#ffe07a,#ff8a2c)!important;color:#180800!important;border-color:#ffe07a!important;box-shadow:0 0 0 3px rgba(255,224,122,.24),0 10px 22px rgba(255,138,44,.24)!important;}
#posItemModal .pos-option-chip.active::after,#posItemModal .pos-option-chip[aria-pressed="true"]::after{content:"✓";position:absolute;right:-6px;top:-8px;width:18px;height:18px;border-radius:999px;background:#fff7cc;color:#4b2200;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:950;box-shadow:0 4px 12px rgba(0,0,0,.3);}
#posItemModal .pos-option-chip:active{transform:scale(.97)!important;}
.sundine-item-error{margin-top:10px;color:#ffdf9e;font-weight:800;min-height:20px;}
.sundine-toast{position:fixed!important;right:16px!important;bottom:16px!important;z-index:100000!important;}
/* Customer cards and buttons. */
.food-card{cursor:pointer;}
.food-action,.food-select-btn{min-height:46px!important;}
.food-action span[aria-hidden="true"]{pointer-events:none;}
/* Health UI. */
.health-shell{max-width:980px;margin:0 auto;padding:32px 18px;}
.health-card{border-radius:28px;padding:22px;background:linear-gradient(180deg,rgba(35,12,3,.95),rgba(8,4,1,.95));border:1px solid rgba(255,190,78,.3);box-shadow:0 28px 70px rgba(0,0,0,.32);}
.health-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px;margin:18px 0;}
.health-stat{padding:14px;border-radius:18px;background:rgba(255,255,255,.06);border:1px solid rgba(255,218,130,.16);}
.health-stat span{display:block;color:#d6bd75;font-size:12px;font-weight:900;text-transform:uppercase;letter-spacing:.08em;}
.health-stat strong{display:block;margin-top:6px;font-size:20px;}
/* Deploy page online read-only mode. */
body.sundine-deploy-readonly [data-local-deploy-action],body.sundine-deploy-readonly .deploy-write-action{opacity:.55!important;pointer-events:none!important;}
.sundine-readonly-banner{margin:12px 0;padding:14px 16px;border-radius:18px;background:rgba(255,214,107,.16);border:1px solid rgba(255,214,107,.38);color:#ffe7a8;font-weight:800;}

/* 7.9.4 interaction/scroll repair: ordinary customer content must never own vertical scroll.
   Only fixed modal bodies/dropdowns/textarea may scroll.  Do not remove: it prevents first-swipe nested scroll regressions. */
body.sundine-customer-standalone, body.surface-customer{display:block!important;overflow:visible!important;height:auto!important;max-height:none!important;}
body.sundine-customer-standalone .phone, body.surface-customer .phone{margin:0 auto!important;overflow:hidden!important;overflow-x:clip!important;overflow-y:clip!important;height:auto!important;min-height:auto!important;max-height:none!important;}
body.sundine-customer-standalone .main,
body.sundine-customer-standalone .page,
body.sundine-customer-standalone .menu-frame,
body.sundine-customer-standalone .menu-slider,
body.sundine-customer-standalone .menu-page,
body.sundine-customer-standalone .food-card,
body.sundine-customer-standalone .card,
body.sundine-customer-standalone .pos-cart-panel,
body.sundine-customer-standalone .checkout-panel,
body.sundine-customer-standalone .sundine-cart-line{overflow:visible!important;height:auto!important;max-height:none!important;overscroll-behavior:initial!important;}
body.sundine-customer-standalone .food-action,
body.sundine-customer-standalone .food-select-btn,
body.sundine-customer-standalone .qty-btn,
body.sundine-customer-standalone .option-chip,
body.sundine-customer-standalone .addon-chip,
body.sundine-customer-standalone #addToCart,
body.sundine-customer-standalone .sundine-cart-actions button{min-width:44px!important;min-height:44px!important;touch-action:manipulation!important;position:relative!important;z-index:3!important;}
body.sundine-customer-standalone .food-action{pointer-events:auto!important;cursor:pointer!important;}
body.sundine-customer-standalone #itemModal{position:fixed!important;inset:0!important;display:none;align-items:center!important;justify-content:center!important;z-index:9999!important;}
body.sundine-customer-standalone #itemModal.open{display:flex!important;}
body.sundine-customer-standalone #itemModal .modal, body.sundine-customer-standalone .sundine-item-dialog{max-height:min(86dvh,720px)!important;overflow:auto!important;}
