/* Idealogy mobile base — canonical responsive layer.
   Standards:
     WCAG 2.2 SC 1.4.4  (Resize text 200%)
     WCAG 2.2 SC 1.4.10 (Reflow at 320 CSS px)
     WCAG 2.2 SC 1.4.12 (Text Spacing)
     WCAG 2.2 SC 2.5.5  (Target Size 44px)
     WCAG 2.2 SC 2.5.8  (Target Minimum 24px)
     WCAG 2.2 SC 2.3.3  (Animation from Interactions)
     W3C Mobile Web Best Practices 1.0
     Google Material Design 3 responsive layout
     Apple HIG (safe area insets, Dynamic Type tolerance)
     Nielsen NN Mobile Usability
     ISO 9241-110 / 112
     Rule 10 (one canonical pattern), Rule 23, Rule 24, Rule 26
*/
:root{
  --mobile-pad:  clamp(.6rem, 2.5vw, 1rem);
  --mobile-font: clamp(15px, 3.8vw, 16px);
}
html{ -webkit-text-size-adjust:100%; text-size-adjust:100%; }
body{
  font-size: var(--mobile-font);
  padding-left:  max(env(safe-area-inset-left,0px), 0px);
  padding-right: max(env(safe-area-inset-right,0px), 0px);
  overflow-wrap: anywhere;
  word-break: break-word;
}
img, svg, video, canvas{ max-width:100%; height:auto; display:inline-block; }
/* 44x44 target floor for interactive chrome (SC 2.5.5) */
button, [role="button"], summary,
a.btn, a.tab, .tab, .sys-tab, .grp summary{
  min-height:44px;
}
/* reduce motion globally (SC 2.3.3) */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    transition:none !important; animation:none !important; scroll-behavior:auto !important;
  }
}
/* narrow: 560px — reflow, tile collapse, kick long stacks */
@media (max-width: 560px){
  .wrap{ padding-left:.6rem; padding-right:.6rem; }
  h1, .headline h1{ font-size: clamp(1.05rem, 5vw, 1.3rem); line-height:1.25; }
  .kpis, .counts, .tiles, .grid, .grid2, .grid3{
    grid-template-columns: 1fr 1fr !important;
  }
  /* summary blocks stack: LHS above RHS, bars full width */
  .grp summary{ flex-direction:column; align-items:stretch; row-gap:.4rem; padding:.85rem .8rem; }
  .grp .rhs{ width:100%; align-items:stretch; }
  .grp .bar{ max-width:none; }
  .stagebar{ margin:.6rem 0 .4rem; }
  table{ font-size:.9rem; }
  th, td{ padding:.5rem .4rem; }
}
/* very narrow: 380px — single column, minimal chrome */
@media (max-width: 380px){
  .kpis, .counts, .tiles, .grid, .grid2, .grid3{
    grid-template-columns: 1fr !important;
  }
  h1, .headline h1{ font-size: clamp(1rem, 5.2vw, 1.15rem); }
  body{ font-size:15px; }
  .grp summary{ padding:.8rem .7rem; }
}

/* === FIX DESKTOP OVERRIDES === */
@media (min-width: 768px) {
    .wrap, .container, .main, .content {
        max-width: 960px !important;
        margin: 0 auto !important;
        padding: 0 2rem !important;
    }
}
@media (min-width: 992px) {
    .wrap, .container, .main, .content {
        max-width: 1140px !important;
    }
}
