/* Rail — mobile hardening (loaded on every page). Iterate by re-pasting this block. */

/* DASHBOARD app grid: cap the single column so a wide child (tables/rows) can't force the panel & note wider than the screen */
@media (max-width: 940px){
  .app { grid-template-columns: minmax(0,1fr) !important; }
}

@media (max-width: 860px){
  /* page never slides sideways; clip keeps position:sticky working */
  html, body { overflow-x: clip; }
  /* wide data tables become swipeable in place — all columns stay reachable */
  table { display: block; width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* long tokens wrap instead of punching out the side */
  p, li, td, th, dd, .block p, .narr, .cap, .tx__cap, .wy-p, .tvs-d { overflow-wrap: break-word; }
  /* DASHBOARD: top nav button row must wrap */
  .top > div { flex-wrap: wrap; }
}

/* HOMEPAGE market-map chart: kill 3D tilt + let it shrink to fit the screen (no sideways cut) */
@media (max-width: 760px){
  .tvmap-card { transform: none !important; transform-style: flat !important; }
  .tvmap-figure { transform: none !important; min-width: 0 !important; }
  .tvmap-figwrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* SIMULASI: stop the 2-col stage being forced wide by the flow's min-width:560px */
@media (max-width: 720px){
  .stage { grid-template-columns: minmax(0,1fr) !important; }
}
@media (max-width: 600px){
  .rail-canopy { flex-wrap: wrap; row-gap: 8px; }
  .rc-mid { min-width: 0 !important; }
  .rc-foot { white-space: normal !important; }
}

/* stat grids that stay 2-col get cramped on small phones */
@media (max-width: 520px){
  .stats { grid-template-columns: 1fr !important; }
}
