/* Keep the sale readable at terminal resolutions and in narrow browser panels. */
#pos .workspace>*{min-width:0}
#pos .cart-head span,#pos .cart-row span{min-width:0}
#pos.dual-active .cart-head,#pos.dual-active .cart-row{grid-template-columns:20px minmax(0,1fr) 12px 12px 12px 34px 72px 72px}
#pos.dual-active .cart-head span:nth-last-child(-n+2){white-space:normal;line-height:1.3}
#pos .dual-live-row{grid-template-columns:minmax(0,1fr) 76px 76px}
#pos .dual-live-balance{padding:12px 0 4px;font-size:24px}
#pos #empty-cart{min-height:0;padding:18px;gap:4px}
#pos #empty-cart img{width:190px;max-height:140px;object-fit:contain}
#pos #empty-cart p{font-size:14px;margin:8px 0}
#pos #empty-cart small{font-size:12px}
@media(min-width:901px) and (max-height:820px){
 #pos{grid-template-rows:76px minmax(0,1fr) 40px;padding:8px;gap:8px}
 #pos .workspace{grid-template-columns:60px minmax(0,1fr) minmax(0,1.08fr);gap:8px}
 #pos .topbar{gap:12px;padding:8px 10px}
 #pos .station-info{gap:12px}#pos .station-info strong{font-size:16px}
 #pos .right-pane{grid-template-rows:minmax(0,1fr) 270px;gap:8px}
 #pos .right-pane.browse{grid-template-rows:minmax(0,1fr)}
 #pos.dual-active .sale-pane{grid-template-rows:minmax(0,1fr) 218px;gap:8px}
 #pos .footer{padding:7px 12px;gap:12px}
 #pos .footer>strong{font-size:13px}
 #pos .payment-area{grid-template-rows:48px minmax(0,1fr) 20px;gap:7px}
 #pos .entry-payments{gap:8px}
 #pos .payment-buttons button{font-size:13px}
 #pos #cash-suggestions button{font-size:14px}
 #pos .rail>button{border-radius:8px}
}
@media(max-width:900px){
 body:has(#pos:not([hidden])){display:block}
 #pos{height:auto;min-height:100dvh;grid-template-rows:auto auto auto;padding:8px;gap:8px}
 #pos .topbar{flex-direction:column;gap:10px;padding:12px}
 #pos .station-info{width:100%;justify-content:space-between}
 #pos .station-info div:first-child{display:grid}
 #pos .station-info strong{font-size:16px}
 #pos .topbar nav{width:100%;height:54px;gap:6px}
 #pos .topbar button{font-size:12px;padding:6px}
 #pos .workspace{grid-template-columns:60px minmax(0,1fr);gap:8px}
 #pos .sale-pane{height:500px;grid-template-rows:minmax(0,1fr) 150px}
 #pos.dual-active .sale-pane{height:500px;grid-template-rows:minmax(0,1fr) 220px}
 #pos .right-pane{grid-column:1/-1;height:610px;grid-template-rows:minmax(0,1fr) 285px;gap:10px}
 #pos .right-pane.browse{height:650px;grid-template-rows:minmax(0,1fr)}
 #pos #catalog-grid .category{font-size:13px;min-height:48px;line-height:1.25}
 #pos .catalog-toolbar{flex-wrap:nowrap}#pos .catalog.products{grid-template-rows:42px minmax(0,1fr) 30px}
 #pos .catalog-toolbar input{order:0;width:auto;flex:1}
 #pos .footer{min-height:48px;flex-wrap:wrap;gap:8px;padding:10px}
 #pos .footer #status{flex:1;min-width:150px}
 #pos .rail .device-note{display:flex}
}
@media(max-width:450px){
 #pos .workspace{grid-template-columns:48px minmax(0,1fr)}
 #pos.dual-active .cart-head,#pos.dual-active .cart-row{grid-template-columns:14px minmax(0,1fr) 9px 9px 9px 25px 47px 47px;gap:2px;padding:10px 4px;font-size:10px}
 #pos .dual-live-row{grid-template-columns:minmax(0,1fr) 65px 65px;font-size:12px}
 #pos .dual-live-balance{font-size:20px}
 #pos .topbar button{font-size:10px}
 #pos .catalog-toolbar button{font-size:10px;padding:6px}
}

/* Shared amount tracks from the sale header through the balance. */
#pos.dual-active{--amount-width:76px;--amount-gap:4px;--sale-inset:8px}
#pos.dual-active .cart-head,#pos.dual-active .cart-row{grid-template-columns:20px minmax(0,1fr) 12px 12px 12px 34px var(--amount-width) var(--amount-width);gap:var(--amount-gap);padding-left:var(--sale-inset);padding-right:var(--sale-inset)}
#pos.dual-active .totals{padding-left:var(--sale-inset);padding-right:var(--sale-inset)}
#pos.dual-active .dual-live-row{grid-template-columns:minmax(0,1fr) var(--amount-width) var(--amount-width);gap:var(--amount-gap)}
#pos.dual-active .cart-head span:nth-last-child(-n+2){font-size:10px;font-weight:bold;line-height:13px;text-align:right}
#pos.dual-active .dual-live-head strong{font-size:10px;font-weight:bold;line-height:13px}
@media(max-width:450px){#pos.dual-active{--amount-width:50px;--amount-gap:2px;--sale-inset:4px}#pos.dual-active .cart-head,#pos.dual-active .cart-row{grid-template-columns:14px minmax(0,1fr) 9px 9px 9px 25px var(--amount-width) var(--amount-width)}}
/* Login: reserve a real footer row instead of overlaying the access card. */
@media(min-width:701px) and (max-height:820px){
 .login-screen{height:100dvh;min-height:620px;grid-template-columns:minmax(0,1.1fr) minmax(300px,1fr);grid-template-rows:minmax(0,1fr) auto;padding:20px 4vw 12px;gap:12px 5vw}
 .login-brand{height:100%;gap:16px;min-height:0}
 .login-logo{width:min(310px,90%);height:180px}
 .login-brand p{font-size:22px}
 .practice-note{margin-top:18px;font-size:20px}
 .practice-note small{font-size:12px}
 .login-card{padding:20px;max-width:420px}
 .login-card h1{margin:10px 0;font-size:30px}
 .login-card>p{margin:10px 0;font-size:14px}
 #login-key{height:56px;font-size:24px}
 .login-pad{gap:8px;margin:10px 0}
 .login-pad button{height:54px;font-size:24px}
 .login-card .large{height:50px;min-height:50px;font-size:18px}
 .login-card #login-feedback{margin:12px 0 0;line-height:1.4}
 .login-footer{position:static;grid-column:1/-1;align-self:end;gap:12px;font-size:11px;min-height:16px}
}

@keyframes added-product{0%,100%{box-shadow:inset 0 0 0 0 transparent}35%{box-shadow:inset 0 0 0 3px #7ce9ff;background:#225d7a}}
#pos .cart-row.just-added{animation:added-product .65s ease-out 1}
body.contrast #pos .cart-row.just-added{animation:none;box-shadow:inset 0 0 0 2px white}
@media(prefers-reduced-motion:reduce){#pos .cart-row.just-added{animation:none;box-shadow:inset 0 0 0 2px #7ce9ff}}
