/* Check PO values, Lens layout (Jon 2026-10-24, picked from five layouts and
   refined in ten review comments). Desktop from 1181px:
   - the PO page fills the height in a container that hugs it, like the side
     panel (its surface, border, shadow and 16px corners, the page 8px inside);
   - the panel takes the rest of the row, the same height, 8px away;
   - a lens under the panel tabs shows the selected PO line close up;
   - the products are full-width rows, the values are tiles three to a row that
     never open on a click; a pencil edits a value in place;
   - the PO line badges are circles.
   review-panel-v3.js sets the widths, requirements.js the tiles and marks,
   po-lens.js the lens. Narrower windows keep the standard step. */

@media (min-width: 1181px) {
  /* No title row, legal links or panel dock and collapse controls on this step. */
  html[data-requirement-stage="confirm"] #appShell > main.workspace > .review-topbar-viewport,
  html[data-requirement-stage="confirm"] .app-legal-footer,
  html[data-layout-v2="float"][data-requirement-stage="confirm"] #layoutV2FloatHost#layoutV2FloatHost #layoutV2Stage-reviewScreen > .panel-visibility-toggle,
  html[data-layout-v2="float"][data-requirement-stage="confirm"] #layoutV2FloatHost#layoutV2FloatHost #layoutV2Stage-reviewScreen #reviewPanel .panel-dock-controls,
  html[data-layout-v2="float"][data-requirement-stage="confirm"] #layoutV2FloatHost#layoutV2FloatHost #layoutV2Stage-reviewScreen #reviewPanel .panel-resize-handle {
    display: none !important;
  }

  /* The PO and the panel start 8px under the top bar and end 18px above the
     window's bottom edge, as the top bar sits 18px inside its top edge. */
  html[data-layout-v2="float"][data-requirement-stage="confirm"][data-has~="review-screen"]:not(#has-pad) #appShell#appShell {
    padding-top: 76px !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
  }

  html[data-layout-v2="float"][data-requirement-stage="confirm"][data-has~="review-screen"]:not(#has-pad) #appShell#appShell > main.workspace {
    height: calc(var(--app-visible-height, 100dvh) - 112px) !important;
  }

  html[data-requirement-stage="confirm"] #reviewScreen#reviewScreen #reviewScaleStage#reviewScaleStage#reviewScaleStage#reviewScaleStage .review-header {
    display: none !important;
  }

  /* A one-page PO has no pages to step through, so its pane has no header bar.
     The file name is in the panel heading instead (po-lens.js). */
  html[data-requirement-stage="confirm"][data-po-single-page] #reviewScreen#reviewScreen .drawing-panes[data-source-kind="po"] .drawing-pane:has(#manufactureSheet) > header {
    display: none !important;
  }

  /* The PO page in a container like the side panel. */
  html[data-layout-v2="float"][data-requirement-stage="confirm"] #reviewScreen#reviewScreen .drawing-panes[data-source-kind="po"] > .drawing-pane:has(#manufactureSheet) {
    padding: 8px !important;
    background: linear-gradient(180deg, rgb(var(--surface-rgb) / .98), rgb(var(--bg-rgb) / .99)) !important;
    border: 1px solid rgb(var(--overlay-rgb) / .1) !important;
    border-radius: 16px !important;
    box-shadow: 0 18px 40px rgb(var(--shadow-rgb) / .45), inset 0 1px 0 rgb(var(--gloss-rgb) / .06) !important;
    overflow: hidden !important;
  }

  html[data-layout-v2="float"][data-requirement-stage="confirm"] #reviewScreen#reviewScreen #manufactureSheet#manufactureSheet {
    border-radius: 8px !important;
  }

  /* The panel: the scroll region takes the free height, so Use and Back stay
     at the bottom, and it has room for a selected tile's ring. */
  html[data-layout-v2="float"][data-requirement-stage="confirm"] #layoutV2FloatHost#layoutV2FloatHost#layoutV2FloatHost #layoutV2Stage-reviewScreen#layoutV2Stage-reviewScreen #reviewPanel#reviewPanel#reviewPanel > #reviewPanelScroll#reviewPanelScroll {
    flex: 1 1 auto !important;
    padding-left: 2px !important;
    margin-left: -2px !important;
  }

  /* The lens: the selected PO line close up, under the tabs. */
  html[data-layout-v2="float"][data-requirement-stage="confirm"] #layoutV2FloatHost#layoutV2FloatHost #layoutV2Stage-reviewScreen #reviewPanel > .po-lens-frame {
    position: relative !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    /* Only the selected line (Jon 2026-10-25): po-lens.js sets the height. */
    height: var(--po-lens-height, 120px) !important;
    min-height: 0 !important;
    max-height: none !important;
    aspect-ratio: auto !important;
    margin: 0 !important;
    overflow: hidden !important;
    border-radius: 8px !important;
    pointer-events: none;
  }

  html[data-layout-v2="float"][data-requirement-stage="confirm"] #layoutV2FloatHost#layoutV2FloatHost #layoutV2Stage-reviewScreen #reviewPanel > .po-lens-frame[hidden] {
    display: none !important;
  }

  html[data-layout-v2="float"][data-requirement-stage="confirm"] #layoutV2FloatHost#layoutV2FloatHost #layoutV2Stage-reviewScreen #reviewPanel > .po-lens-frame .review-sheet-scroll {
    position: absolute !important;
    overflow: visible !important;
    max-width: none !important;
    max-height: none !important;
    transform: none !important;
  }

  html[data-layout-v2="float"][data-requirement-stage="confirm"] #layoutV2FloatHost#layoutV2FloatHost #layoutV2Stage-reviewScreen #reviewPanel > .po-lens-frame .sheet-viewport {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
  }

  html[data-layout-v2="float"][data-requirement-stage="confirm"] #layoutV2FloatHost#layoutV2FloatHost #layoutV2Stage-reviewScreen #reviewPanel > .po-lens-frame .overlay-layer {
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
  }

  html[data-layout-v2="float"][data-requirement-stage="confirm"] #layoutV2FloatHost#layoutV2FloatHost #layoutV2Stage-reviewScreen #reviewPanel > .po-lens-frame :is(.review-zoom-control, .sheet-fullscreen-button, .review-sheet-tools) {
    display: none !important;
  }

  /* Products: one full-width row each. Values: tiles, three to a row; a row is
     as tall as its tallest tile. */
  html[data-layout-v2="float"][data-requirement-stage="confirm"] #layoutV2Stage-reviewScreen #reviewPanel #reviewPanelScroll #drawingDetailsPanel #overallDimsPanel .requirement-stage-products {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px !important;
    align-items: start !important;
  }

  html[data-layout-v2="float"][data-requirement-stage="confirm"] #layoutV2Stage-reviewScreen #reviewPanel #reviewPanelScroll #drawingDetailsPanel #overallDimsPanel .requirement-stage-values {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
    align-items: stretch !important;
  }

  /* The four value actions share one row so every tile fits on the panel. */
  html[data-layout-v2="float"][data-requirement-stage="confirm"] #layoutV2Stage-reviewScreen #reviewPanel #reviewPanelScroll #drawingDetailsPanel #overallDimsPanel .requirement-stage-actions {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  html[data-layout-v2="float"][data-requirement-stage="confirm"] #layoutV2Stage-reviewScreen #reviewPanel #reviewPanelScroll #drawingDetailsPanel #overallDimsPanel .requirement-stage-actions > * {
    grid-column: auto !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }
}

/* The value tiles at every width: they do not open on a click, so the head is
   not a button; the long values wrap and the row grows down. */
html[data-layout-v2="float"] #layoutV2Stage-reviewScreen #reviewPanel #reviewPanelScroll #drawingDetailsPanel #overallDimsPanel .requirement-stage-values > .requirement-stage-value-card {
  height: auto !important;
  align-self: stretch !important;
  justify-content: flex-start !important;
  align-content: start !important;
  cursor: pointer;
}

html[data-layout-v2="float"] #layoutV2Stage-reviewScreen #reviewPanel #reviewPanelScroll #drawingDetailsPanel #overallDimsPanel .requirement-stage-values .oa-material-card-head {
  align-self: start !important;
  align-items: start !important;
  cursor: pointer !important;
}

html[data-layout-v2="float"] #layoutV2Stage-reviewScreen #reviewPanel #reviewPanelScroll #drawingDetailsPanel #overallDimsPanel .requirement-stage-values .oa-card-glance,
html[data-layout-v2="float"] #layoutV2Stage-reviewScreen #reviewPanel #reviewPanelScroll #drawingDetailsPanel #overallDimsPanel .requirement-stage-values .oa-card-glance-side {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  overflow-wrap: break-word;
  align-items: baseline !important;
}

html[data-layout-v2="float"] #layoutV2Stage-reviewScreen #reviewPanel #reviewPanelScroll #drawingDetailsPanel #overallDimsPanel .requirement-stage-values .oa-card-glance-label {
  flex: 0 0 auto !important;
  white-space: nowrap !important;
  overflow-wrap: normal !important;
}

/* The pencil: the app's own edit pencil (.shortcuts-edit in styles.css), after
   the value's name. */
html[data-layout-v2="float"] #layoutV2Stage-reviewScreen #reviewPanel #reviewPanelScroll #drawingDetailsPanel #overallDimsPanel .requirement-stage-values .oa-material-card-title > span.oa-material-name {
  flex: 0 1 auto !important;
}

html[data-layout-v2="float"] #layoutV2Stage-reviewScreen #reviewPanel #reviewPanelScroll #drawingDetailsPanel #overallDimsPanel .requirement-stage-edit {
  flex: 0 0 auto;
  margin-left: 4px;
  vertical-align: middle;
}

html[data-layout-v2="float"] #layoutV2Stage-reviewScreen #reviewPanel #reviewPanelScroll #drawingDetailsPanel #overallDimsPanel .requirement-stage-value-card:hover .requirement-stage-edit,
html[data-layout-v2="float"] #layoutV2Stage-reviewScreen #reviewPanel #reviewPanelScroll #drawingDetailsPanel #overallDimsPanel .requirement-stage-edit[aria-pressed="true"] {
  opacity: 1;
}

/* Editing: the value's box takes the place of the value, in the tile. */
html[data-layout-v2="float"] #layoutV2Stage-reviewScreen #reviewPanel #reviewPanelScroll #drawingDetailsPanel #overallDimsPanel .requirement-stage-values > .requirement-stage-value-card.is-open .oa-card-glance,
html[data-layout-v2="float"] #layoutV2Stage-reviewScreen #reviewPanel #reviewPanelScroll #drawingDetailsPanel #overallDimsPanel .requirement-stage-values > .requirement-stage-value-card.is-open .requirement-stage-field > .oa-material-side-label,
html[data-layout-v2="float"] #layoutV2Stage-reviewScreen #reviewPanel #reviewPanelScroll #drawingDetailsPanel #overallDimsPanel .requirement-stage-values > .requirement-stage-value-card.is-open .oa-material-card-body > .requirement-result-source {
  display: none !important;
}

/* The PO line badges are circles, on the page and in the lens. */
html body #reviewScreen#reviewScreen#reviewScreen #manufactureSheet#manufactureSheet .diff-badge.is-po-line.is-po-line.is-po-line,
html body #layoutV2FloatHost#layoutV2FloatHost #reviewPanel#reviewPanel#reviewPanel .po-lens-frame .diff-badge.is-po-line.is-po-line.is-po-line {
  width: 18px !important;
  min-width: 18px !important;
  height: 18px !important;
  min-height: 18px !important;
  max-height: none !important;
  aspect-ratio: 1 / 1 !important;
  padding: 0 !important;
  border-radius: 999px !important;
  display: grid !important;
  place-items: center !important;
}

html body #reviewScreen#reviewScreen#reviewScreen #manufactureSheet#manufactureSheet .diff-badge.is-po-line.is-po-line.is-po-line b,
html body #layoutV2FloatHost#layoutV2FloatHost #reviewPanel#reviewPanel#reviewPanel .po-lens-frame .diff-badge.is-po-line.is-po-line.is-po-line b {
  width: 18px !important;
  min-width: 18px !important;
  height: 18px !important;
  min-height: 18px !important;
  max-height: none !important;
  padding: 0 !important;
  border-radius: 999px !important;
  display: grid !important;
  place-items: center !important;
  font-size: 10px !important;
  line-height: 1 !important;
}
