/* Screen-only: no saved panel preferences or printed board layout are changed. */
@media screen {
  .board-wrap.board-viewport-auto {
    height: var(--board-viewport-height, 60vh) !important;
    min-height: 0 !important;
    max-height: none !important;
    flex: 0 0 auto;
  }
  .board-viewport-legacy-controls { display: none !important; }
  .board-native-fullscreen { display: none !important; }
  body.production-board-fullscreen .board-native-fullscreen { display: inline-flex !important; }
  .board-viewport-managed:fullscreen .board-native-fullscreen { display: none !important; }
  .board-viewport-managed > .panel-x-scrollbar {
    position: relative !important; bottom: auto !important; margin: 0 !important;
    flex: 0 0 14px; box-shadow: none;
  }
  .board-row-rail {
    position: relative; display: flex; justify-content: center; align-items: center;
    gap: 7px; height: 36px; min-height: 36px; width: 100%; padding: 2px 8px;
    margin: 0 0 8px; flex: 0 0 36px; border: 1px solid #8298b0; border-top: 0;
    border-radius: 0 0 7px 7px; background: #f7faff; color: #304f70;
    font: 600 11px/1.2 "Segoe UI", Arial, sans-serif;
  }
  .board-row-rail[hidden] { display: none !important; }
  .board-row-rail button {
    display: inline-grid; place-items: center; width: 34px; height: 30px;
    min-width: 34px; min-height: 30px; padding: 0; border: 1px solid #9bb1cb;
    border-radius: 5px; color: #075dcc; background: #fff; font-size: 19px;
    font-weight: 700; cursor: pointer; line-height: 1;
  }
  .board-row-rail button:hover:not(:disabled) { background: #e7f1ff; border-color: #075dcc; }
  .board-row-rail button:focus-visible { outline: 3px solid #0878ef; outline-offset: 1px; }
  .board-row-rail button:disabled { color: #91a1b3; cursor: default; opacity: .55; }
  .board-row-position { min-width: 46px; text-align: center; font-variant-numeric: tabular-nums; }
  @media (max-width: 900px) {
    .board-row-rail { justify-content: flex-start; padding-left: 12px; }
  }
  /* Keep the backing page boxes as large as the fixed board. Otherwise moving
     every visible child out of flow collapses main/shell/body to zero height;
     some external-browser paint paths then retain an undersized clip until a
     real window resize. Preserve DOM, authentication visibility and scroll. */
  body.production-board-fullscreen {
    min-height: 100vh;
    min-height: 100dvh;
  }
  body.production-board-fullscreen .app-shell:not([hidden]) {
    position: fixed; inset: 0; display: block;
    width: 100%; height: 100vh; height: 100dvh;
    min-height: 0; max-width: none; margin: 0; padding: 0;
  }
  /* A native fullscreen element already occupies the browser top layer.
     Keeping either ancestor fixed can leave Edge's zoomed board paint stale
     until the window is resized, so reserve fixed layout for the fallback. */
  body.production-board-native-fullscreen .app-shell:not([hidden]) {
    position: static;
    width: auto;
    height: auto;
  }
  body.production-board-fullscreen .app-shell > main {
    width: 100%; height: 100%; min-width: 0; min-height: 0;
  }
  body.production-board-fullscreen :is(#boardScreen, #activeFloorScreen).board-viewport-managed.active-screen:not([hidden]),
  :is(#boardScreen, #activeFloorScreen).board-viewport-managed.active-screen:not([hidden]):fullscreen {
    position: fixed !important; inset: 0; z-index: 90; margin: 0;
    display: flex !important; flex-direction: column;
    width: 100% !important; height: 100vh; height: 100dvh;
    min-height: 0; box-sizing: border-box; overflow: hidden; padding: 0;
  }
  body.production-board-native-fullscreen :is(#boardScreen, #activeFloorScreen).board-viewport-managed.active-screen:not([hidden]):fullscreen {
    position: static !important;
    inset: auto;
    width: 100% !important;
    height: 100vh;
    height: 100dvh;
  }
  body.production-board-fullscreen .board-viewport-managed.active-screen:not([hidden]) > .board-wrap.board-viewport-auto,
  .board-viewport-managed:fullscreen > .board-wrap.board-viewport-auto {
    /* Flex allocates physical remaining space, including fractional board zoom.
       A zero basis avoids the old measured height becoming a minimum/feedback
       input when the viewport changes or the page was previously scrolled. */
    height: 0 !important; min-height: 0 !important; flex: 1 1 0;
  }
  body.production-board-fullscreen .board-viewport-managed > .board-zoom-controls,
  .board-viewport-managed:fullscreen > .board-zoom-controls {
    flex: 0 0 auto; min-height: 0;
  }
  body.production-board-fullscreen .board-viewport-managed .production-board,
  .board-viewport-managed:fullscreen .production-board {
    min-height: 0 !important;
  }
  body.production-board-fullscreen .board-viewport-managed > .board-row-rail,
  .board-viewport-managed:fullscreen > .board-row-rail { margin-bottom: 0; }
}
@media print { .board-row-rail, .board-native-fullscreen { display: none !important; } }
