/* Structune Hub V17.7.4.515 — Labels & QR SCI01/SCI02 first-paint repair. */

html.labels-qr-first-paint,
html.labels-qr-first-paint body,
html body.v17-labels-constrained{
  width:100%;
  height:100%;
  overflow:hidden!important;
  background:#0B1723!important;
}

/* Direct-route geometry must not wait for the shared shell script. */
@media screen and (min-width:821px){
  html.labels-qr-first-paint body .shell{
    position:fixed!important;
    left:264.207px!important;
    right:264.207px!important;
    top:48px!important;
    bottom:48px!important;
    width:auto!important;
    height:auto!important;
    min-width:0!important;
    min-height:0!important;
    max-width:none!important;
    max-height:none!important;
    overflow:hidden!important;
    background:#0B1723!important;
  }
  html.labels-qr-first-paint body #content,
  html.labels-qr-first-paint body #view-labels-qr{
    position:absolute!important;
    inset:0!important;
    width:100%!important;
    height:100%!important;
    min-width:0!important;
    min-height:0!important;
    margin:0!important;
    padding:0!important;
    overflow:hidden!important;
    background:#0B1723!important;
  }
  html.labels-qr-first-paint body #view-labels-qr{display:flex!important;flex-direction:column!important}
}

/* Only the unstable table region is covered while SBS-165 installs/measures. */
html.labels-sbs-preinit #view-labels-qr .labels-table-panel{
  visibility:hidden!important;
  pointer-events:none!important;
}

/* Preserve the selected AR tab on a hard refresh before the feature controller
   is available. Assembly Tags remains the default when labelsTab is absent. */
html.labels-qr-first-paint.labels-ar-first-paint #labelsContextDrawer [data-labels-tab="tags"]{background:#102536!important;color:#aebdcc!important}
html.labels-qr-first-paint.labels-ar-first-paint #labelsContextDrawer [data-labels-tab="ar"]{background:#1596e5!important;color:#fff!important}
html.labels-qr-first-paint.labels-ar-first-paint #view-labels-qr [data-labels-panel="tags"]{display:none!important}
html.labels-qr-first-paint.labels-ar-first-paint #view-labels-qr [data-labels-panel="ar"]{display:flex!important}

/* Prevent unrelated SPA views and detached portals flashing during a direct
   Labels route refresh. The Labels preview and marker portals are released by
   the existing route lifecycle after startup. */
html.labels-qr-first-paint #content>.view:not(#view-labels-qr),
html.labels-qr-first-paint #arToolsFab,
html.labels-qr-first-paint #arToolsDock,
html.labels-qr-first-paint #arToolMessage,
html.labels-qr-first-paint #labelsPrintModal,
html.labels-qr-first-paint #labelsPrintStage,
html.labels-qr-first-paint #arMarkerModal,
html.labels-qr-first-paint #productionPasteModal,
html.labels-qr-first-paint #productionConfirmModal,
html.labels-qr-first-paint #view-ar-site-setout,
body.v17-labels-constrained #content>.view:not(#view-labels-qr),
body.v17-labels-constrained #arToolsFab,
body.v17-labels-constrained #arToolsDock,
body.v17-labels-constrained #arToolMessage,
body.v17-labels-constrained #productionPasteModal,
body.v17-labels-constrained #productionConfirmModal,
body.v17-labels-constrained #view-ar-site-setout{
  display:none!important;
  visibility:hidden!important;
  pointer-events:none!important;
}

/* The main Labels page has no persistent right context drawer. Remove the old
   empty 360 px reservation so its functional viewport reaches the shell edge.
   The A4 preview keeps its dedicated 264.207 px context drawer unchanged. */
body.v17-labels-constrained{--st-labels-context-reserve:0px!important}
html[data-structune-shell="v432"] body.v432-shell-geometry.v17-labels-constrained #view-labels-qr{
  position:absolute!important;
  inset:0!important;
  width:100%!important;
  height:100%!important;
  right:0!important;
  padding:0!important;
  overflow:hidden!important;
  background:#0B1723!important;
}

body.v17-labels-constrained #view-labels-qr>.labels-tabs{
  flex:none!important;
  margin:0 0 10px!important;
}
body.v17-labels-constrained #view-labels-qr>.labels-tab-panel.active{
  min-width:0!important;
  min-height:0!important;
}

/* Keep scrolling local to the data register and use the unified dark surface
   around it. Table structure, column widths and sticky headers remain owned by
   the existing Labels styles. */
body.v17-labels-constrained #view-labels-qr .labels-table-panel{
  overscroll-behavior:contain!important;
}
body.v17-labels-constrained #view-labels-qr :is(.labels-output-card,.labels-tabs,.labels-toolbar input,.labels-toolbar select){
  box-shadow:none!important;
}

@media(max-width:900px){
  body.v17-labels-constrained #view-labels-qr{padding:0!important}
}
