/* SCUZO RC6709 — visual/touch stability only, UAT 8831.
   Existing finance, tender, sync and checkout JavaScript unchanged. */

/* Global dark paint prevents legacy white backing from flashing during Safari elastic scroll. */
html,body,body:has(#appView:not(.hidden)),#appView,.app-shell,.workspace,.view-stage{background-color:#0c1115!important;}
#deliveryView.scroll-view{background:#0d1419!important;color:#e8f3ed!important;overscroll-behavior-y:contain!important;}
#deliveryView .platform-ledger-card,#deliveryView .platform-ledger-card .table-wrap,
#deliveryView .platform-ledger-card .report-table{background:#172127!important;color:#eaf1ed!important;}
#deliveryView .platform-ledger-card .report-table thead,
#deliveryView .platform-ledger-card .report-table th{background:#214b64!important;color:#f8fcff!important;border-color:#345366!important;}
#deliveryView .platform-ledger-card .report-table tbody,
#deliveryView .platform-ledger-card .report-table tr,
#deliveryView .platform-ledger-card .report-table td{background:#17242b!important;color:#eaf3ef!important;border-color:#354a50!important;}
#deliveryView .platform-ledger-card .report-table tr:nth-child(even) td{background:#203138!important;}
#deliveryView .platform-ledger-card .report-table tr:hover td{background:#294247!important;color:#fff!important;}
#deliveryView .platform-ledger-card .report-table td[colspan]{background:#202d33!important;color:#dce9e3!important;}
#deliveryView .delivery-layout>.card,#deliveryView .delivery-detail-card{background:#192329!important;color:#f0f6f2!important;}
#deliveryView .table-wrap{isolation:isolate;overflow-x:auto;overflow-y:hidden;}

/* Control Tower: minimum tile dimensions and per-feature identities. Not arbitrary hover animations. */
#adminView .control-overview.control-visible{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:16px!important;align-items:stretch!important;margin:18px 0 24px!important;}
#adminView .control-overview button{box-sizing:border-box!important;min-width:0!important;min-height:125px!important;display:grid!important;grid-template-columns:42px minmax(0,1fr)!important;grid-template-rows:auto 1fr!important;align-content:start!important;align-items:start!important;column-gap:11px!important;row-gap:7px!important;padding:17px!important;border-radius:16px!important;box-shadow:none!important;transform:none!important;transition:background-color .15s ease,border-color .15s ease!important;}
#adminView .control-overview button>span{grid-row:1/3!important;grid-column:1!important;align-self:start!important;font-size:25px!important;line-height:36px!important;}
#adminView .control-overview button>b{grid-column:2!important;grid-row:1!important;color:#fff!important;font-size:14px!important;line-height:1.28!important;margin:0!important;overflow-wrap:anywhere!important;}
#adminView .control-overview button>small{grid-column:2!important;grid-row:2!important;color:#d5e4de!important;font-size:11px!important;line-height:1.45!important;margin:0!important;overflow-wrap:anywhere!important;}
#adminView .control-overview button:nth-child(6n+1){background:#16382f!important;border:1px solid #4d9c79!important;}
#adminView .control-overview button:nth-child(6n+2){background:#392b42!important;border:1px solid #9876b6!important;}
#adminView .control-overview button:nth-child(6n+3){background:#213b4c!important;border:1px solid #649abb!important;}
#adminView .control-overview button:nth-child(6n+4){background:#413321!important;border:1px solid #b49a55!important;}
#adminView .control-overview button:nth-child(6n+5){background:#442b36!important;border:1px solid #c27c9a!important;}
#adminView .control-overview button:nth-child(6n){background:#273c3a!important;border:1px solid #83bca8!important;}
#adminView .control-overview button:focus-visible{outline:3px solid #c3f6d6!important;outline-offset:2px!important;}
@media(max-width:1100px){#adminView .control-overview.control-visible{grid-template-columns:repeat(2,minmax(0,1fr))!important;}}
@media(max-width:700px){#adminView .control-overview.control-visible{grid-template-columns:1fr!important;gap:11px!important;}#adminView .control-overview button{min-height:100px!important;}}

/* Cash/EDC detail moved to scrollable cart quick-control zone.
   Footer remains short, stable; no nested new checkout button. */
@media(min-width:901px){
 #posView.active .cart-panel{height:100%!important;min-height:0!important;}
 #posView.active .cart-panel>.cart-scroll-body{flex:0 1 32%!important;min-height:90px!important;max-height:260px!important;}
 #posView.active .cart-panel>.cart-quick-controls{flex:1 1 0!important;min-height:90px!important;max-height:none!important;overflow-y:auto!important;overflow-x:hidden!important;scrollbar-gutter:stable!important;overscroll-behavior-y:contain!important;scroll-behavior:auto!important;}
 #posView.active .cart-panel>.cart-checkout-footer{flex:0 0 auto!important;max-height:38%!important;min-height:0!important;overflow-y:auto!important;overscroll-behavior-y:contain!important;position:relative!important;z-index:3!important;}
 #posView.active .cart-checkout-footer #checkoutBtn{position:sticky!important;bottom:0!important;z-index:7!important;}
}
#posView #cartQuickControls #rc6708TenderPanel{flex:0 0 auto!important;min-height:0!important;padding:4px 0!important;margin:0!important;}
#posView #cartQuickControls #rc6708TenderPanel .rc6708-tender-mode{background:#1b2b29!important;border-color:#48615a!important;}
#posView #cartQuickControls #rc6708NetworkGrid{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:7px!important;}
#posView #cartQuickControls #rc6708NetworkGrid button{min-height:42px!important;color:#f4fff9!important;white-space:normal!important;overflow-wrap:anywhere!important;}
#posView #cartQuickControls #rc6708NetworkGrid button.selected{background:#a7ecc4!important;color:#10291f!important;}
#posView #cartCheckoutFooter .payable{margin-top:4px!important;}
#posView #cartCheckoutFooter #checkoutBtn{display:block!important;min-height:48px!important;}
/* Small tablet and phone keep their established Review Bill drawer layout. */
@media(max-width:900px){#posView #cartQuickControls #rc6708NetworkGrid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}}
@media(prefers-reduced-motion:reduce){#adminView .control-overview button{transition:none!important;}}
/* Original payment select remains in DOM for existing JS but does not overprint
   the card-network area: touch payment buttons remain the visible control. */
#posView #posPaymentLegacySelect{position:absolute!important;left:-10000px!important;top:auto!important;width:1px!important;height:1px!important;margin:0!important;padding:0!important;overflow:hidden!important;opacity:0!important;pointer-events:none!important;}
/* Avoid Safari grid implicit-track overlap when tender content expands.
   Normal block flow makes payment sections stack without intercepting taps. */
@media(min-width:901px){
 #posView.active .cart-panel>.cart-quick-controls{display:block!important;}
 #posView.active .cart-panel>.cart-quick-controls>div,#posView.active .cart-panel>.cart-quick-controls>fieldset{position:relative!important;margin-bottom:8px!important;}
}
