/* ═══════════════════════════════════════════════════════════
   RSM STORE — Global responsive layer (load LAST on every page)
   Breakpoints: 360 / 480 / 640 / 768 / 960 / 1200 / 1600
   Goals: no sideways scroll, 44px touch targets, no iOS input-zoom, notch-safe, readable on 4K
   ═══════════════════════════════════════════════════════════ */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%;max-width:100%;overflow-x:clip;-webkit-tap-highlight-color:rgba(230,57,70,.18)}
body{max-width:100%;overflow-x:clip;min-height:100vh;min-height:100dvh;
  padding-left:env(safe-area-inset-left,0);padding-right:env(safe-area-inset-right,0)}
img,video,svg,canvas,iframe{max-width:100%}
img{height:auto}
a,button,summary,[role=button]{touch-action:manipulation}
:focus-visible{outline:2px solid #e63946;outline-offset:2px}
::selection{background:rgba(230,57,70,.4);color:#fff}

/* long words / keys / urls never break the layout */
h1,h2,h3,h4,p,li,td,th,label,.toast{overflow-wrap:anywhere}
code,pre,kbd,samp{max-width:100%}
pre{overflow-x:auto;-webkit-overflow-scrolling:touch}

/* tables scroll inside their own box instead of stretching the page */
.table-wrap,.tbl-wrap,.rsm-table-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch}

/* modals & toasts */
.modal-box,.modal .box,.modal>div{max-height:calc(100dvh - 2rem);overflow-y:auto;-webkit-overflow-scrolling:touch}
.toast{bottom:max(1rem,env(safe-area-inset-bottom,0px))}

/* ── Touch devices: bigger tap targets, no zoom-on-focus ── */
@media(pointer:coarse){
  button,.btn-sm,.btn-primary,.nav-btn,.hero-btn,.navbar-link,select,summary{min-height:44px}
  .btn-sm{padding-top:.6rem;padding-bottom:.6rem}
}
@media(max-width:768px){
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]),select,textarea{font-size:16px!important}
  .view table,.card table,.tbl table{display:block;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
  .card,.panel{border-radius:14px}
  .form-row{grid-template-columns:1fr!important}
  .toast{left:1rem;right:1rem;max-width:none}
  .card-head{flex-wrap:wrap;gap:.6rem}
  .card-head>div,.card-head>.btn-sm{max-width:100%}
}
@media(max-width:480px){
  .container,.content,.wrap{padding-left:max(12px,3.5vw)!important;padding-right:max(12px,3.5vw)!important}
  .hero-btns{max-width:100%}
  .hero-btn{min-width:0}
  .section-title{font-size:clamp(1.35rem,7vw,1.7rem)}
}
@media(max-width:360px){
  html{font-size:15px}
  .stats-strip{grid-template-columns:repeat(3,minmax(0,1fr))}
}
/* big monitors / TVs */
@media(min-width:1600px){html{font-size:17px}}
@media(min-width:2200px){html{font-size:19px}}
/* landscape phones: keep fixed headers from eating the screen */
@media(max-height:480px) and (orientation:landscape){
  .hero{padding-top:1.5rem;padding-bottom:1.5rem}
  .nav{min-height:52px}
}
@media print{#matrix-bg,.nav,.rsm-bn,.toast,.rsmf-cta{display:none!important}}

/* sticky-header fix: overflow-x:clip does not create a scroll container (html+body overflow hidden broke position:sticky). Old browsers: only html clips. */
@supports not (overflow:clip){body,body.home,body.sx-body{overflow-x:visible!important}}
