/* R66.270 Stage25 — customer-side UX closure for audited BUG-016..BUG-024. */

/* BUG-016: three-choice Assembly groups use one balanced desktop row. */
@media (min-width:901px){
  body.ps-stage66-pcb-order-page .ps-pcb-order-reference.ps-has-assembly-order
  .ps-pcb-field-grid--assembly>.ps-pcb-choice-field[data-ps-choice-count="3"]>.ps-pcb-inline-choices{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
}

/* BUG-017: Stencil desktop grids choose a track count that avoids an orphan last tile. */
@media (min-width:901px){
  body.ps-stage66-pcb-order-page .ps-pcb-order-reference.ps-is-stencil-order
  .ps-stencil-reference-grid>.ps-pcb-choice-field[data-ps-choice-count="2"]>.ps-pcb-inline-choices{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  body.ps-stage66-pcb-order-page .ps-pcb-order-reference.ps-is-stencil-order
  .ps-stencil-reference-grid>.ps-pcb-choice-field[data-ps-choice-count="3"]>.ps-pcb-inline-choices{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
  body.ps-stage66-pcb-order-page .ps-pcb-order-reference.ps-is-stencil-order
  .ps-stencil-reference-grid>.ps-pcb-choice-field[data-ps-choice-count="4"]>.ps-pcb-inline-choices{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  body.ps-stage66-pcb-order-page .ps-pcb-order-reference.ps-is-stencil-order
  .ps-stencil-reference-grid>.ps-pcb-choice-field[data-ps-choice-count="7"]>.ps-pcb-inline-choices{grid-template-columns:repeat(4,minmax(0,1fr))!important;}
  body.ps-stage66-pcb-order-page .ps-pcb-order-reference.ps-is-stencil-order
  .ps-stencil-reference-grid>.ps-pcb-choice-field .ps-pcb-inline-choice{max-width:none!important;min-width:0!important;width:100%!important;}
}

/* BUG-018: both two-way PCB selectors consume the same control width. */
@media (min-width:901px){
  body.ps-stage66-pcb-order-page .ps-pcb-order-reference:not(.ps-has-assembly-order):not(.ps-is-stencil-order)
  :is([data-ps-field="board_format"],[data-ps-field="panel_mode"])>.ps-pcb-inline-choices{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    width:100%!important;max-width:none!important;
  }
  body.ps-stage66-pcb-order-page .ps-pcb-order-reference:not(.ps-has-assembly-order):not(.ps-is-stencil-order)
  :is([data-ps-field="board_format"],[data-ps-field="panel_mode"]) .ps-pcb-inline-choice{
    width:100%!important;min-width:0!important;max-width:none!important;
  }
}

/* BUG-019: Notes are genuinely multi-line on all three services. */
body.ps-stage66-pcb-order-page .ps-pcb-order-reference :is(
  [data-ps-field="notes"],
  [data-ps-field="stencil_notes"],
  [data-ps-field="panel_notes"]
) textarea,
body.ps-stage66-pcb-order-page .ps-pcb-order-reference textarea[name="notes"],
body.ps-stage66-pcb-order-page .ps-pcb-order-reference textarea[name="stencil_notes"]{
  min-height:120px!important;height:auto!important;line-height:1.85!important;resize:vertical!important;
}

/* BUG-020: 44px minimum help target, still circular and visually consistent. */
body.ps-stage66-pcb-order-page .ps-pcb-order-reference .ps-pcb-help-button,
body.ps-stage66-pcb-order-page .ps-pcb-order-reference.ps-is-stencil-order .ps-stencil-reference-grid .ps-pcb-help-button{
  inline-size:44px!important;block-size:44px!important;width:44px!important;height:44px!important;
  min-width:44px!important;min-height:44px!important;max-width:44px!important;max-height:44px!important;
  flex:0 0 44px!important;border-radius:50%!important;font-size:16px!important;line-height:1!important;
}

/* BUG-021: compact list first; expensive details open only on demand. */
.ps-request-card{gap:.7rem!important;}
.ps-request-compact-meta{display:flex;align-items:center;justify-content:space-between;gap:.75rem;flex-wrap:wrap;color:var(--ps-muted,#657381);font-size:.9rem;}
.ps-request-details{margin:0;border:1px solid rgba(20,75,99,.12);border-radius:14px;background:rgba(255,255,255,.38);overflow:hidden;}
.ps-request-details>summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:.75rem;min-height:46px;padding:.65rem .85rem;cursor:pointer;font-weight:800;}
.ps-request-details>summary::-webkit-details-marker{display:none;}
.ps-request-details>summary i{font-style:normal;transition:transform .18s ease;}
.ps-request-details[open]>summary i{transform:rotate(180deg);}
.ps-request-details-body{display:grid;gap:13px;padding:.85rem;border-top:1px solid rgba(20,75,99,.10);}
.ps-tracking-section-title{margin:.2rem 0 0;font-size:1.2rem;font-weight:850;line-height:1.55;}

/* BUG-022/024: searchable country and explicit no-result feedback. */
.ps-address-form .select2-container,.ps-address-form .selectWoo{width:100%!important;max-width:100%;}
.ps-address-form .select2-selection{min-height:46px;border-radius:11px!important;display:flex!important;align-items:center;}
.ps-order-search-empty{margin-top:.85rem;}

@media (max-width:720px){
  .ps-request-compact-meta{align-items:flex-start;flex-direction:column;gap:.2rem;}
  .ps-request-details>summary{min-height:48px;}
}
/* Stage25 specificity closure: historical audit layer used a runtime-qualified !important owner. */
body.ps-stage66-pcb-order-page .ps-pcb-order-reference[data-ps-pcb-runtime="r66.28"] :is(.ps-pcb-help-button),
body.ps-stage66-pcb-order-page .ps-pcb-order-reference[data-ps-pcb-runtime="r66.28"].ps-is-stencil-order .ps-stencil-reference-grid .ps-pcb-help-button{
  inline-size:44px!important;block-size:44px!important;width:44px!important;height:44px!important;
  min-width:44px!important;min-height:44px!important;max-width:44px!important;max-height:44px!important;
  flex:0 0 44px!important;border-radius:50%!important;font-size:16px!important;line-height:1!important;
}
body.ps-stage66-pcb-order-page .ps-pcb-order-reference[data-ps-pcb-runtime="r66.28"] :is(.ps-pcb-help-button),
body.ps-stage66-pcb-order-page .ps-pcb-order-reference[data-ps-pcb-runtime="r66.28"].ps-is-stencil-order .ps-stencil-reference-grid .ps-pcb-help-button{
  min-inline-size:44px!important;min-block-size:44px!important;max-inline-size:44px!important;max-block-size:44px!important;
}
body.ps-stage66-pcb-order-page .ps-pcb-order-reference[data-ps-pcb-runtime="r66.28"] :is(.ps-pcb-help-button.ps-pcb-help-button){
  display:inline-grid!important;place-items:center!important;
  inline-size:44px!important;block-size:44px!important;width:44px!important;height:44px!important;
  min-inline-size:44px!important;min-block-size:44px!important;max-inline-size:44px!important;max-block-size:44px!important;
  min-width:44px!important;min-height:44px!important;max-width:44px!important;max-height:44px!important;
  flex:0 0 44px!important;aspect-ratio:1/1!important;border-radius:50%!important;font-size:16px!important;line-height:1!important;
}
