/* NEVIRO 1.0.46.1 · WORLD HUD SAFE LAYOUT
   Purpose: keep Hero / Presence Roster / Nearby / HUD / Controls in separate safe zones. */

/* Large / desktop */
.nw-hud{
  max-height:calc(100vh - 228px);
  overflow:auto;
  overscroll-behavior:contain;
  scrollbar-width:thin;
}
#neviro-presence-diag{
  top:auto!important;
  right:24px!important;
  bottom:94px!important;
  left:auto!important;
  min-width:218px!important;
  max-width:320px!important;
  transform:none!important;
}
.nw-nearby{
  left:230px;
  top:104px;
  bottom:auto;
  width:min(300px,calc(100vw - 460px));
  max-height:188px;
}
.nw-nearby-list{
  max-height:154px;
  overflow:auto;
  overscroll-behavior:contain;
  scrollbar-width:thin;
}

/* Mid-size desktop / tablet landscape:
   hero owns left content lane; diagnostics own right lane. */
@media (max-width:1100px){
  .nw-nearby{
    left:220px;
    width:min(270px,calc(100vw - 460px));
  }
  #neviro-presence-diag{
    right:18px!important;
    bottom:92px!important;
    max-width:280px!important;
  }
}

@media (max-width:860px){
  /* Free the left lane: keyboard/touch movement remains available. */
  .nw-avatar-panel{display:none!important}

  /* Right diagnostics stack, never overlap each other. */
  #neviro-presence-diag{
    top:80px!important;
    right:10px!important;
    bottom:auto!important;
    left:auto!important;
    width:184px!important;
    min-width:0!important;
    max-width:184px!important;
    padding:9px 10px!important;
  }
  .nw-hud{
    display:block;
    top:160px;
    right:10px;
    width:184px!important;
    max-height:calc(100vh - 174px);
    overflow:auto;
  }

  /* Hero becomes a bounded left column instead of bottom-floating content. */
  .nw-guide{
    left:24px!important;
    right:auto!important;
    top:88px!important;
    bottom:auto!important;
    width:min(360px,calc(100vw - 232px))!important;
  }
  .nw-guide h1{
    margin:10px 0 8px;
    font-size:clamp(30px,7vw,48px);
  }
  .nw-guide p{
    max-width:none!important;
    font-size:11px;
    line-height:1.55;
  }
  .nw-guide-row{display:none!important}

  /* Nearby owns lower-left safe zone. */
  .nw-nearby{
    left:18px!important;
    right:auto!important;
    top:auto!important;
    bottom:14px!important;
    width:min(300px,calc(100vw - 230px))!important;
    max-height:118px;
  }
  .nw-nearby-list{max-height:84px}

  /* Camera buttons stay in lower-right safe zone. */
  .nw-controls{
    right:10px!important;
    bottom:12px!important;
  }
}

/* Phone / narrow portrait */
@media (max-width:520px){
  .nw-hud,
  .nw-avatar-panel,
  .nw-stage-label{
    display:none!important;
  }

  #neviro-presence-diag{
    top:74px!important;
    left:10px!important;
    right:10px!important;
    bottom:auto!important;
    width:auto!important;
    min-width:0!important;
    max-width:none!important;
    padding:8px 10px!important;
    border-radius:11px!important;
  }
  #neviro-presence-diag b{
    display:inline!important;
    margin:0 8px 0 0!important;
  }
  #neviro-presence-diag [data-pr-line]{
    display:inline!important;
    font-size:9px!important;
  }
  #neviro-presence-diag [data-pr-sub]{
    margin-top:2px!important;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }

  .nw-guide{
    top:154px!important;
    left:16px!important;
    right:16px!important;
    bottom:auto!important;
    width:auto!important;
  }
  .nw-guide-badge{
    padding:5px 8px;
    font-size:8px;
  }
  .nw-guide h1{
    margin:8px 0 7px;
    font-size:clamp(27px,9.2vw,38px)!important;
    line-height:1;
  }
  .nw-guide p{
    max-width:none!important;
    font-size:10px!important;
    line-height:1.45!important;
    display:-webkit-box;
    -webkit-line-clamp:4;
    -webkit-box-orient:vertical;
    overflow:hidden;
  }

  .nw-nearby{
    left:10px!important;
    right:10px!important;
    top:auto!important;
    bottom:10px!important;
    width:auto!important;
    max-height:92px!important;
    border-radius:12px;
  }
  .nw-nearby-head{padding:7px 9px}
  .nw-nearby-list{max-height:61px!important}
  .nw-nearby-item{padding:6px 9px}

  /* The touch canvas already handles camera drag. Hide the old button slab so
     it cannot cover Hero/Nearby on a 360–520 px viewport. */
  .nw-controls{display:none!important}

  /* Active social/chat overlays sit above the nearby safe zone. */
  .nw-social-card{
    left:10px!important;
    right:10px!important;
    bottom:112px!important;
    width:auto!important;
    max-height:calc(100vh - 132px);
    overflow:auto;
  }
  .nwc-shell{
    bottom:108px!important;
    width:calc(100vw - 20px)!important;
  }
}

/* Very short browser windows (desktop dev-tools / split-screen). */
@media (max-height:560px) and (min-width:521px){
  .nw-guide{
    top:82px!important;
  }
  .nw-guide h1{
    font-size:clamp(28px,5.6vw,42px)!important;
  }
  .nw-guide p{
    display:-webkit-box;
    -webkit-line-clamp:3;
    -webkit-box-orient:vertical;
    overflow:hidden;
  }
  .nw-nearby{
    max-height:92px!important;
  }
  .nw-nearby-list{
    max-height:60px!important;
  }
  .nw-hud{
    max-height:calc(100vh - 170px)!important;
  }
}


/* 1.0.45.2 · RIGHT DOCK POLISH
   Merge the floating REFERENCE badge into Presence Roster and align the
   bottom-right control dock. */
:root{
  --nw-right-dock-width:250px;
  --nw-right-dock-edge:18px;
  --nw-right-dock-gap:10px;
}

/* Presence becomes the single compact realtime/status card. */
#neviro-presence-diag[data-layout-docked="1"]{
  width:var(--nw-right-dock-width)!important;
  min-width:var(--nw-right-dock-width)!important;
  max-width:var(--nw-right-dock-width)!important;
  right:var(--nw-right-dock-edge)!important;
  bottom:82px!important;
  padding:9px 11px!important;
  border-radius:13px!important;
  line-height:1.35!important;
  box-shadow:0 12px 32px rgba(0,0,0,.26)!important;
}
#neviro-presence-diag[data-layout-docked="1"] > b{
  margin-bottom:3px!important;
}
#neviro-presence-diag[data-layout-docked="1"] [data-pr-sub]{
  margin-top:2px!important;
  font-size:8px!important;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* Reference asset warning is no longer a second floating pill. */
#neviro-presence-diag .nw-reference-inline{
  display:block!important;
  position:static!important;
  width:auto!important;
  min-width:0!important;
  max-width:none!important;
  margin:7px -2px -1px!important;
  padding:6px 3px 1px!important;
  transform:none!important;
  border:0!important;
  border-top:1px solid rgba(255,208,112,.22)!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  backdrop-filter:none!important;
  color:#f1c978!important;
  font:800 8px/1.3 Consolas,monospace!important;
  letter-spacing:.035em!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  pointer-events:none!important;
}

/* Camera controls align to the same dock width. */
.nw-controls[data-layout-docked="1"]{
  right:var(--nw-right-dock-edge)!important;
  bottom:18px!important;
  width:var(--nw-right-dock-width)!important;
  display:grid!important;
  grid-template-columns:38px 38px minmax(0,1fr) 52px!important;
  gap:6px!important;
  padding:7px!important;
  border-radius:14px!important;
}
.nw-controls[data-layout-docked="1"] button{
  min-width:0!important;
  width:100%!important;
}
.nw-controls[data-layout-docked="1"] .wide{
  padding:0 7px!important;
  white-space:nowrap;
}

/* Keep the debug HUD visually aligned with the right rail on wide screens. */
@media (min-width:861px){
  .nw-hud[data-layout-docked="1"]{
    right:var(--nw-right-dock-edge)!important;
  }
}

/* Mid-size: narrower right rail. */
@media (max-width:860px) and (min-width:521px){
  :root{
    --nw-right-dock-width:184px;
    --nw-right-dock-edge:10px;
  }
  #neviro-presence-diag[data-layout-docked="1"]{
    top:80px!important;
    bottom:auto!important;
    min-width:184px!important;
    max-width:184px!important;
    width:184px!important;
  }
  .nw-controls[data-layout-docked="1"]{
    width:230px!important;
    right:10px!important;
    bottom:12px!important;
    grid-template-columns:36px 36px minmax(0,1fr) 48px!important;
  }
}

/* Phone keeps Presence as a full-width top strip; no floating reference pill. */
@media (max-width:520px){
  #neviro-presence-diag[data-layout-docked="1"]{
    top:74px!important;
    left:10px!important;
    right:10px!important;
    bottom:auto!important;
    width:auto!important;
    min-width:0!important;
    max-width:none!important;
    padding:8px 10px!important;
  }
  #neviro-presence-diag .nw-reference-inline{
    margin-top:5px!important;
    padding-top:5px!important;
    font-size:7.5px!important;
  }
  .nw-controls[data-layout-docked="1"]{
    display:none!important;
  }
}


/* 1.0.46.1 · SOCIAL CARD SAFE DOCK FIX
   Keep the active persona card clear of the right diagnostic dock. */
@media (min-width:861px){
  .nw-social-card{
    right:calc(var(--nw-right-dock-edge) + var(--nw-right-dock-width) + 16px)!important;
    bottom:18px!important;
    width:min(360px,calc(100vw - var(--nw-right-dock-width) - 52px))!important;
    max-height:calc(100vh - 150px)!important;
  }
}
@media (max-width:860px) and (min-width:521px){
  .nw-social-card{
    left:18px!important;
    right:206px!important;
    bottom:142px!important;
    width:auto!important;
    max-width:none!important;
    max-height:calc(100vh - 298px)!important;
  }
}
@media (max-height:560px) and (min-width:861px){
  .nw-social-card{
    max-height:calc(100vh - 118px)!important;
  }
}
