/* Synapse 1.25 Public Layout Enforcement / Viewport Hotfix
   Loaded last on public and app routes. Presentation-only; no diagnostic, cover, veil, state-light runtime, or RuntimeDomainLoader authority. */
:root{
  --synapse-1-25-header-h: 3.55rem;
  --synapse-1-25-shell-pad: clamp(.55rem, 1.1vw, .9rem);
  --synapse-1-25-panel-gap: clamp(.75rem, 1.5vw, 1.05rem);
}

/* Public header: compact, predictable, and menu contained. */
.site-header{
  min-height: var(--synapse-1-25-header-h) !important;
  padding-block: .45rem !important;
  border-bottom: 1px solid rgba(16,43,53,.14) !important;
}
.brand__sigil{ width:2rem !important; height:2rem !important; flex:0 0 auto; }
.brand__copy strong{ font-size:.96rem !important; }
.brand__copy span{ font-size:.66rem !important; }
.menu-button{ width:auto !important; min-width:4.6rem !important; max-width:6.5rem !important; justify-content:center !important; white-space:nowrap !important; }
.site-nav[data-open="true"]{ overscroll-behavior:contain !important; }

/* Mobile portrait: keep Menu compact and give the access buttons the width. */
@media (max-width: 860px){
  .site-header{
    display:grid !important;
    grid-template-columns:minmax(0, 1fr) auto !important;
    row-gap:.55rem !important;
    column-gap:.6rem !important;
    padding:.58rem .78rem .7rem !important;
  }
  .brand{ min-width:0 !important; }
  .menu-button{ min-height:2.45rem !important; padding:.52rem .78rem !important; font-size:.92rem !important; }
  .header-actions{
    grid-column:1 / -1 !important;
    display:grid !important;
    grid-template-columns:.86fr 1.05fr 1.08fr !important;
    gap:.48rem !important;
    width:100% !important;
    overflow:visible !important;
  }
  .header-actions .button{
    min-width:0 !important;
    min-height:2.35rem !important;
    padding:.48rem .5rem !important;
    font-size:.86rem !important;
    white-space:nowrap !important;
  }
  .site-nav{
    grid-column:1 / -1 !important;
    position:absolute !important;
    top:calc(100% + .38rem) !important;
    left:.72rem !important;
    right:.72rem !important;
    width:auto !important;
    max-height:calc(100dvh - 8.3rem) !important;
    overflow:auto !important;
    z-index:80 !important;
    padding:.55rem !important;
    border-radius:22px !important;
    background:rgba(255,253,248,.98) !important;
    backdrop-filter:blur(16px) !important;
    box-shadow:0 18px 38px rgba(16,43,53,.16) !important;
  }
  .site-nav[data-open="true"]{ display:flex !important; }
  .site-nav__link{ padding:.72rem .9rem !important; font-size:.92rem !important; }
  .page-shell{ width:min(100% - .75rem,1120px) !important; padding-top:.72rem !important; }
  .hero__content{ padding:1.05rem !important; }
  .hero h1{ font-size:clamp(2.05rem, 8.4vw, 3.15rem) !important; line-height:1.03 !important; max-width:13.2ch !important; letter-spacing:-.052em !important; }
  .hero__lede{ font-size:clamp(.98rem, 4.2vw, 1.16rem) !important; line-height:1.48 !important; margin-top:.86rem !important; }
}

/* Mobile landscape and small laptop tablet widths: compact single-row header where possible. */
@media (orientation: landscape) and (max-height: 560px) and (max-width: 980px){
  .site-header{
    grid-template-columns:minmax(9.5rem, 1fr) auto minmax(16rem, auto) !important;
    row-gap:0 !important;
    padding:.42rem .7rem !important;
  }
  .brand__sigil{ width:1.7rem !important; height:1.7rem !important; }
  .brand__copy strong{ font-size:.82rem !important; }
  .brand__copy span{ display:none !important; }
  .menu-button{ grid-column:auto !important; min-height:2.1rem !important; padding:.36rem .64rem !important; font-size:.8rem !important; }
  .header-actions{ grid-column:auto !important; display:flex !important; flex-wrap:nowrap !important; gap:.38rem !important; justify-content:flex-end !important; }
  .header-actions .button{ min-height:2.1rem !important; padding:.36rem .56rem !important; font-size:.78rem !important; }
  .site-nav{ left:auto !important; right:.7rem !important; top:calc(100% + .28rem) !important; width:min(15rem, calc(100vw - 1rem)) !important; max-height:calc(100dvh - 4.2rem) !important; }
  .page-shell{ padding-top:.45rem !important; }
}

/* Desktop/laptop public pages: the shell owns scroll; titles and rails stay proportionate. */
@media (min-width: 980px){
  html, body{ height:100%; }
  body[data-public-chamber-shell="soft-active"]{ overflow:hidden !important; }
  body[data-public-chamber-shell="soft-active"] .site-header{
    height:var(--synapse-1-25-header-h) !important;
    padding:.42rem clamp(1rem, 2.4vw, 1.8rem) !important;
    grid-template-columns:minmax(13rem, 18rem) minmax(0, 1fr) auto !important;
    gap:.7rem !important;
  }
  body[data-public-chamber-shell="soft-active"] .site-nav{ display:flex !important; justify-content:center !important; gap:.16rem !important; }
  body[data-public-chamber-shell="soft-active"] .site-nav__link{ font-size:.82rem !important; padding:.45rem .58rem !important; }
  body[data-public-chamber-shell="soft-active"] .header-actions{ flex-wrap:nowrap !important; gap:.42rem !important; }
  body[data-public-chamber-shell="soft-active"] .header-actions .button{ min-height:2.12rem !important; padding:.42rem .68rem !important; font-size:.8rem !important; }
  body[data-public-chamber-shell="soft-active"] .page-shell.synapse-public-viewport{
    width:min(1240px, calc(100vw - 1.2rem)) !important;
    height:calc(100dvh - var(--synapse-1-25-header-h)) !important;
    min-height:0 !important;
    padding:.62rem 0 1rem !important;
    overflow:auto !important;
    overscroll-behavior:contain !important;
    scrollbar-gutter:stable both-edges !important;
  }
  body[data-public-chamber-shell="soft-active"] .active-chamber{
    min-height:calc(100dvh - var(--synapse-1-25-header-h) - 1.25rem) !important;
    padding:.55rem !important;
    gap:var(--synapse-1-25-panel-gap) !important;
    align-content:start !important;
  }
  body[data-public-chamber-shell="soft-active"] .hero{
    grid-template-columns:minmax(0,.98fr) minmax(18.5rem,.62fr) !important;
    gap:var(--synapse-1-25-panel-gap) !important;
    align-items:start !important;
  }
  body[data-public-chamber-shell="soft-active"] .hero__content,
  body[data-public-chamber-shell="soft-active"] .access-card{
    align-self:start !important;
    min-height:0 !important;
  }
  body[data-public-chamber-shell="soft-active"] .hero__content{ padding:clamp(1.35rem,2vw,2rem) !important; }
  body[data-public-chamber-shell="soft-active"] .hero h1{
    font-size:clamp(2.35rem,3.45vw,3.45rem) !important;
    line-height:1.02 !important;
    max-width:13.4ch !important;
    letter-spacing:-.052em !important;
  }
  body[data-public-chamber-shell="soft-active"] .hero__lede{
    font-size:clamp(.96rem,1.16vw,1.08rem) !important;
    line-height:1.45 !important;
    margin-top:.85rem !important;
  }
  body[data-public-chamber-shell="soft-active"] .hero__chips{ margin:.9rem 0 1rem !important; gap:.42rem !important; }
  body[data-public-chamber-shell="soft-active"] .hero__actions{ margin-top:.9rem !important; gap:.45rem !important; }
  body[data-public-chamber-shell="soft-active"] .access-card{
    margin-top:0 !important;
    justify-content:flex-start !important;
    padding:clamp(1rem,1.65vw,1.35rem) !important;
    transform:none !important;
  }
  body[data-public-chamber-shell="soft-active"] .access-card h2{ font-size:clamp(1.02rem,1.45vw,1.32rem) !important; }
  body[data-public-chamber-shell="soft-active"] .access-card p{ font-size:.88rem !important; line-height:1.38 !important; }
  body[data-public-chamber-shell="soft-active"] .page-media-card{ margin-top:.85rem !important; }
  body[data-public-chamber-shell="soft-active"] .surface-diagram-card{ margin-top:.75rem !important; }
}

@media (min-width: 1320px){
  body[data-public-chamber-shell="soft-active"] .hero h1{ font-size:clamp(2.5rem,3vw,3.6rem) !important; }
}

/* Keep app acquisition coherent but not floating. */
.app-page-shell{ width:min(1080px,calc(100% - 1.5rem)) !important; }
.app-install-chamber{ margin-inline:auto !important; }
.app-install-chamber__identity{ min-height:0 !important; }
.app-install-chamber h1{ font-size:clamp(2rem,3.6vw,3.35rem) !important; max-width:12ch !important; }
