/* RCH OS v1.6 — iPhone 17 Pro mobile polish
   Final mobile-only layer. It intentionally owns Territory phone contrast,
   KPI paging and the fixed action-bar geometry. */
@media (max-width: 48rem) {
  body.rch-territory-v1 {
    --territory-mobile-nav-height: 4.35rem;
  }

  body.rch-territory-v1 .rch-home-header {
    background:
      radial-gradient(circle at 82% -55%, rgba(42,137,255,.32), transparent 24rem),
      linear-gradient(112deg,#06172f,#0a2d58 58%,#071d3c) !important;
    color:#f7fbff !important;
    border-bottom-color:rgba(142,183,229,.24) !important;
    box-shadow:0 .55rem 1.45rem rgba(3,20,43,.24) !important;
  }

  body.rch-territory-v1 .rch-home-brand,
  body.rch-territory-v1 .rch-home-brand .brand-copy strong {
    color:#f7fbff !important;
  }

  body.rch-territory-v1 .rch-home-brand .brand-copy strong {
    font-weight:900 !important;
    letter-spacing:.025em !important;
    text-shadow:0 1px 2px rgba(0,0,0,.28) !important;
  }

  body.rch-territory-v1 :is(
    #territoryNavToggle,
    #territoryMenuBtn,
    .territory-nav-toggle,
    .territory-nav-trigger,
    .territory-menu-toggle,
    .rch-territory-header-menu-toggle
  ) {
    width:2.8rem !important;
    min-width:2.8rem !important;
    height:2.8rem !important;
    min-height:2.8rem !important;
    display:inline-grid !important;
    place-items:center !important;
    padding:0 !important;
    border:1px solid rgba(160,194,232,.34) !important;
    border-radius:.88rem !important;
    color:#f5f9ff !important;
    background:rgba(6,35,71,.88) !important;
    box-shadow:0 .35rem .9rem rgba(2,17,37,.18) !important;
  }

  body.rch-territory-v1 :is(
    #territoryNavToggle,
    #territoryMenuBtn,
    .territory-nav-toggle,
    .territory-nav-trigger,
    .territory-menu-toggle,
    .rch-territory-header-menu-toggle
  ) svg {
    width:1.35rem !important;
    height:1.35rem !important;
    stroke-width:2.25 !important;
  }

  /* Two complete KPI cards per page instead of clipping a third card. */
  body.rch-territory-v1 .rch-home-kpis {
    display:flex !important;
    align-items:stretch !important;
    gap:.55rem !important;
    padding:.7rem .75rem !important;
    overflow-x:auto !important;
    overscroll-behavior-inline:contain !important;
    scroll-snap-type:x mandatory !important;
    scroll-padding-inline:.75rem !important;
    -webkit-overflow-scrolling:touch !important;
  }

  body.rch-territory-v1 .rch-home-kpis > .rch-kpi-card {
    flex:0 0 calc((100% - .55rem) / 2) !important;
    width:auto !important;
    min-width:0 !important;
    min-height:5.15rem !important;
    padding:.8rem .75rem !important;
    scroll-snap-align:start !important;
    box-sizing:border-box !important;
  }

  body.rch-territory-v1 .rch-kpi-card {
    grid-template-columns:minmax(0,1fr) 2.35rem !important;
    column-gap:.55rem !important;
  }

  body.rch-territory-v1 .rch-kpi-card .kpi-copy {
    min-width:0 !important;
  }

  body.rch-territory-v1 .rch-kpi-card .kpi-copy > span {
    font-size:1.75rem !important;
    line-height:1 !important;
  }

  body.rch-territory-v1 .rch-kpi-card .kpi-copy small {
    display:block !important;
    max-width:100% !important;
    margin-top:.35rem !important;
    line-height:1.12 !important;
    white-space:normal !important;
    overflow-wrap:normal !important;
    word-break:normal !important;
  }

  body.rch-territory-v1 .rch-kpi-card .kpi-icon {
    width:2.2rem !important;
    height:2.2rem !important;
  }

  /* Bottom toolbar: identical columns, icon and label baselines. */
  body.rch-territory-v1 .rch-mobile-action-bar {
    height:calc(var(--territory-mobile-nav-height) + env(safe-area-inset-bottom,0px)) !important;
    min-height:calc(var(--territory-mobile-nav-height) + env(safe-area-inset-bottom,0px)) !important;
    grid-template-columns:repeat(5,minmax(0,1fr)) !important;
    align-items:stretch !important;
    gap:0 !important;
    padding:.25rem .25rem env(safe-area-inset-bottom,0px) !important;
    background:rgba(5,27,56,.985) !important;
  }

  body.rch-territory-v1 .rch-mobile-action-bar > :where(a,button) {
    min-width:0 !important;
    min-height:3.85rem !important;
    height:3.85rem !important;
    display:flex !important;
    flex-direction:column !important;
    align-items:center !important;
    justify-content:center !important;
    gap:.28rem !important;
    padding:.2rem .1rem !important;
    line-height:1 !important;
    text-align:center !important;
    box-sizing:border-box !important;
  }

  body.rch-territory-v1 .rch-mobile-action-bar svg {
    flex:0 0 auto !important;
    width:1.35rem !important;
    height:1.35rem !important;
    margin:0 !important;
  }

  body.rch-territory-v1 .rch-mobile-action-bar span {
    width:100% !important;
    margin:0 !important;
    font-size:.66rem !important;
    line-height:1 !important;
    white-space:nowrap !important;
    text-align:center !important;
  }

  body.rch-territory-v1.mobile-panel-open .rch-mobile-action-bar {
    grid-template-columns:minmax(0,1fr) !important;
  }
}

@media (max-width: 25rem) {
  body.rch-territory-v1 .rch-home-kpis > .rch-kpi-card {
    flex-basis:calc((100% - .45rem) / 2) !important;
    padding-inline:.6rem !important;
  }
  body.rch-territory-v1 .rch-mobile-action-bar span {
    font-size:.62rem !important;
  }
}
