/* Keep category artwork, labels and counts inside their own touch targets. */
@media(max-width:900px){
  #stock .subs{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  #stock .subs .sub{display:grid;grid-template-columns:36px minmax(0,1fr) auto;justify-content:start;gap:8px;min-height:68px;padding:10px;font-size:13px}
  #stock .subs .sub-page-avatar{width:36px;height:36px;border-radius:10px}
  #stock .subs .sub-page-copy{min-width:0;line-height:1.45}
  #stock .subs .sub-t{overflow-wrap:break-word}
  #stock .subs .sub-page-copy small{font-size:10px}
  #stock .subs .sub i{margin:0;font-size:10px;padding:3px 5px;min-width:24px;text-align:center}
  #stock .subs .sub[data-cat="ALL"]{grid-template-columns:minmax(0,1fr) auto;padding:10px 14px}
}
@media(max-width:600px){
  #stock{padding-top:24px;padding-bottom:90px}
  #stock .catalog-heading{margin-bottom:20px}
  #stock .catalog-heading h1{font-size:clamp(24px,5.5vw,30px);line-height:1.4}
  #stock .catalog-heading .lead{font-size:13px;line-height:1.8;margin-top:8px}
  #stock .tabs{gap:10px}
  #stock .games{gap:8px;flex-wrap:nowrap}
  #stock .game{flex:1 1 0;min-width:0;gap:9px;padding:7px;min-height:54px;font-size:14px}
  #stock .game-ic,#stock .game-ic img{width:38px;height:38px}
  #stock .toolbar{gap:10px;padding:12px;border-radius:16px}
  #stock .chips{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
  #stock .chip{min-height:44px;font-size:12px;padding:9px 3px}
  #stock .tb-right{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;width:100%;min-width:0}
  #stock .budget{width:100%;min-width:0;box-sizing:border-box;padding:6px 12px}
  #stock .budget input{flex:1;min-width:0;width:0;font-size:16px}
  #stock #sort{width:100%;min-width:0;box-sizing:border-box;font-size:14px}
  #stock .result{gap:8px;font-size:12px}
  #stock .btn-clear{padding:8px 12px;font-size:12px}
  #store-chat-launch{right:12px;bottom:calc(12px + env(safe-area-inset-bottom));padding:11px 14px;font-size:12px}
}
@media(max-width:360px){
  #stock .subs .sub{grid-template-columns:28px minmax(0,1fr) auto;gap:5px;padding:8px;font-size:12px}
  #stock .subs .sub-page-avatar{width:28px;height:28px;border-radius:8px}
}
@media(max-width:600px){
  #stock #area .grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  #stock #area .grid>li{min-width:0}
  #stock .card{width:100%;min-width:0;border-radius:15px;height:100%}
  #stock .card .c-body{position:relative;inset:auto;display:flex;padding:10px;gap:6px;background:#140d24}
  #stock .card .poster-heading{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:5px}
  #stock .card .poster-code{font-size:10px;letter-spacing:0}
  #stock .card .c-price{font-size:20px}
  #stock .card .poster-more{grid-template-rows:1fr}
  #stock .card .poster-more>span{opacity:1;transform:none}
  #stock .card .c-inst{flex-wrap:wrap;gap:4px;margin-top:0}
  #stock .card .c-inst .ci{padding:3px 5px}
  #stock .card .c-inst small,#stock .card .c-inst b{font-size:10px}
  #stock .card .c-cta{font-size:11px;padding:0 8px;margin-top:7px;min-height:34px}
}
/* Override the older square-card overlay on phones: image and details use separate rows. */
@media(max-width:600px){
  #stock #area .card{display:flex;flex-direction:column;aspect-ratio:auto;height:auto;text-align:left}
  #stock #area .card>.shot{position:relative;inset:auto;display:block;flex:none;width:100%;height:auto;aspect-ratio:1 / 1}
  #stock #area .card>.c-body{position:relative;inset:auto;width:100%;box-sizing:border-box;flex:none}
}
/* Mobile card details have their own theme-aware surface and readable rows. */
@media(max-width:600px){
  #stock #area .grid{align-items:stretch}
  #stock #area .grid>li{align-self:stretch;display:flex}
  #stock #area .card{height:100%;background:var(--surface);color:var(--text);border-color:var(--line)}
  #stock #area .card>.c-body{flex:1;min-width:0;padding:12px;gap:9px;background:var(--surface);color:var(--text)}
  #stock #area .card .poster-heading{display:flex;flex-direction:column;align-items:flex-start;gap:5px}
  #stock #area .card .poster-code{font-size:12px;font-weight:500;color:var(--muted);opacity:1;line-height:1.4}
  #stock #area .card .c-price{font-size:22px;line-height:1.25;color:var(--text);text-shadow:none;padding:0;white-space:nowrap}
  #stock #area .card .poster-more{margin-top:auto;min-width:0}
  #stock #area .card .c-inst{display:flex;flex-direction:column;gap:5px}
  #stock #area .card .c-inst .ci{display:flex;flex-direction:row;justify-content:space-between;align-items:center;gap:4px;border-radius:7px;padding:5px 6px;background:var(--glass-2)}
  #stock #area .card .c-inst small{font-size:11px;color:var(--muted)}
  #stock #area .card .c-inst b{font-size:11px;color:var(--text);overflow:visible}
  #stock #area .card .c-inst .ci.warn{background:var(--warn-bg)}
  #stock #area .card .c-inst .ci.warn b{color:var(--text)}
  #stock #area .card .c-cta{font-size:12px;min-height:40px;height:auto;padding:0 9px;margin:10px 0 0;color:#fff}
}


/* Preserve full-width artwork and the original overlay card. */
@media(min-width:601px){#stock #area .card>.shot{height:100%;inset:0;width:100%}#stock #area .card>.shot img{width:100%;height:100%;object-fit:contain;transform:none}}

/* Product cards keep a square frame regardless of source-photo dimensions. */
#stock #area .card{display:block;position:relative;box-sizing:border-box;width:100%;height:auto;min-height:0;aspect-ratio:1/1;padding:0;overflow:hidden}
#stock #area .card>.shot{position:absolute;inset:0;width:100%;height:100%;min-height:0;max-height:none;aspect-ratio:auto}
#stock #area .card>.shot img{width:100%;height:100%;object-fit:contain;transform:none}
#stock #area .card>.c-body{position:absolute;inset:auto 0 0;display:block;padding:12px;background:linear-gradient(transparent,#10091de8);color:white}
#stock #area .card .poster-heading{display:flex;flex-direction:row;align-items:end;justify-content:space-between;gap:5px}
#stock #area .card .poster-code{color:white;font-size:12px}
#stock #area .card .c-price{color:white;font-size:clamp(20px,2.2vw,32px);line-height:1.2}
#stock #area .card .poster-more{display:none}
