#kd-market-v5.cashier-r2 .shop-customer-portrait canvas{width:100%;height:100%;display:block;position:absolute;inset:0}
#kd-market-v5.cashier-r2 .shop-customer-portrait[data-npc-state=ready]>img{visibility:hidden}
#kd-market-v5.cashier-r2 .shop-npc-camera{position:absolute;inset:0;z-index:2;pointer-events:none}
#kd-market-v5.cashier-r2 .shop-npc-camera canvas{width:100%;height:100%;display:block}
#kd-market-v5.cashier-r2 .market-camera-feed:has(.shop-npc-camera:is([data-npc-state=ready],[data-npc-state=rendering])) :is(.market-camera-actor,.market-camera-item,.market-camera-bear,.market-camera-bag,.market-camera-paper){visibility:hidden}
#kd-market-v5.cashier-r2 .market-camera-repair-text{z-index:5}
#kd-market-v5.cashier-r2 .market-camera-stamp{z-index:6}
#kd-market-v5.cashier-r2 .shop-npc-story{height:130px;min-height:75px;max-height:25vh;flex:none;position:relative;width:100%;background:linear-gradient(#e8d7fa,#f7e8bc);border-radius:14px}
#kd-market-v5.cashier-r2 .shop-npc-story canvas{width:100%;height:100%;display:block}
#kd-market-v5.cashier-r2 [data-story-overlay]{display:flex;flex-direction:column;gap:6px;padding:7px;overflow:hidden;background:#f5eddd}
#kd-market-v5.cashier-r2 [data-story-overlay][hidden]{display:none}
#kd-market-v5.cashier-r2 [data-story-overlay]>.market-scene-card{position:static;min-height:0;max-height:none;flex:1;width:100%;box-sizing:border-box;overflow:auto}
#kd-market-v5.cashier-r2 [data-story-overlay]:has(.shop-npc-story[data-npc-state=ready])>[data-story-bear]{display:none}
#kd-market-v5.cashier-r2 .market-scene:is(.with-camera,.with-overlay)>[data-cashier-actor]{display:none}
#kd-market-v5.cashier-r2[data-normal-phase=scan] [data-instruction],#kd-market-v5.cashier-r2[data-normal-phase=done] [data-instruction]{visibility:hidden}
#kd-market-v5.cashier-r2 .shop-all-games{display:block;color:#4d2a73;background:#f3ecfa;padding:12px;border:1px solid #c9b8dd;border-radius:9px;text-decoration:none;text-align:center;min-height:24px}
.shop-cause-effect{position:fixed;box-sizing:border-box;z-index:2147482000;border:3px solid #8860b5;border-radius:12px;box-shadow:0 0 0 3px #fff9;pointer-events:none;transform-origin:center}
.shop-cause-effect--error{border-color:#ad3f32;background:#ffd16b29;box-shadow:0 0 0 3px #fff8}
.shop-cause-effect--success{border-color:#367e56;box-shadow:0 0 0 3px #ddf7dba8}
@media(max-width:680px) and (max-height:520px){#kd-market-v5.cashier-r2 .shop-npc-story{height:90px;min-height:65px}}
@media(prefers-reduced-motion:reduce){.shop-cause-effect{transform:none!important}}

@media(max-width:680px) and (min-height:441px){
 #kd-market-v5.cashier-r2:is([data-normal-phase=scan],[data-normal-phase=done]) [data-game]{grid-template-rows:0px 100px 88px minmax(0,1fr)}
}
@media(max-width:680px) and (min-height:441px) and (max-height:520px){
 #kd-market-v5.cashier-r2:is([data-normal-phase=scan],[data-normal-phase=done]) [data-game]{grid-template-rows:0px 48px 84px minmax(0,1fr)}
}

/* Keep complete price and unit inside every moving card, including four-item baskets. */
#kd-market-v5.cashier-r2 .market-item{grid-template-rows:minmax(14px,1fr) 11px 22px;min-width:0}
#kd-market-v5.cashier-r2 .market-item-price{display:flex;flex-direction:column;justify-content:center;align-items:center;font-size:10.5px;line-height:11px;white-space:nowrap;margin:0}
#kd-market-v5.cashier-r2 .market-item-value{font-size:inherit;line-height:11px;white-space:nowrap}
#kd-market-v5.cashier-r2 .market-item-unit{font-size:8px;line-height:10px}
#kd-market-v5.cashier-r2 .market-items:has(.market-item:nth-child(4)) .market-item-price{font-size:10.5px}
@media(min-width:500px) and (max-height:440px){#kd-market-v5.cashier-r2 [data-game]{grid-template-rows:22px minmax(0,1fr) 84px}#kd-market-v5.cashier-r2 .market-belt-title{height:18px}#kd-market-v5.cashier-r2 .market-items{height:calc(100% - 19px)}}
/* Tablets in portrait use the same clear checkout hierarchy as phones. */
@media(min-width:681px) and (max-width:1023px) and (min-height:641px){
 #kd-market-v5.cashier-r2{height:calc(100dvh - 58px);min-height:0}
 #kd-market-v5.cashier-r2 [data-game]{grid-template-columns:1fr;grid-template-rows:30px 150px 112px minmax(0,1fr);gap:7px}
 #kd-market-v5.cashier-r2:is([data-normal-phase=scan],[data-normal-phase=done]) [data-game]{grid-template-rows:0px 150px 112px minmax(0,1fr)}
 #kd-market-v5.cashier-r2 .market-instruction{grid-column:1;grid-row:1}
 #kd-market-v5.cashier-r2 .shop-theatre{grid-column:1;grid-row:2}
 #kd-market-v5.cashier-r2 .market-belt{grid-column:1;grid-row:3}
 #kd-market-v5.cashier-r2 .market-desk{grid-column:1;grid-row:4;grid-template-columns:minmax(130px,.5fr) minmax(0,1.5fr);padding:12px 10px 24px}
 #kd-market-v5.cashier-r2 .market-register{display:flex;flex-direction:column;min-height:0;transform:none}
 #kd-market-v5.cashier-r2 .market-keypad{grid-template-columns:repeat(5,minmax(44px,1fr));grid-auto-rows:minmax(44px,1fr);min-height:144px;flex:1;gap:5px}
 #kd-market-v5.cashier-r2 .market-key{min-width:0;min-height:44px;max-height:none}
 #kd-market-v5.cashier-r2 .market-key.times{grid-column:span 2}
}

#kd-market-v5.cashier-r2 :is([data-npc-state=loading],[data-npc-state=rendering])>canvas{visibility:hidden}

#kd-market-v5 :is(button,a,input,select):focus-visible{outline:3px solid #69409b;outline-offset:2px}

#kd-market-v5.cashier-r2 .shop-npc-closeup-label{position:absolute;z-index:8;background:#e8d9bc;color:#47324f;font:600 9px/12px system-ui;text-align:center;padding:2px 0;border-radius:0 0 5px 5px;box-sizing:border-box}
#kd-market-v5.cashier-r2 .shop-npc-closeup-label[hidden]{display:none}
