:root {
  color-scheme: light;
  --wps-bg: #f6f7f9;
  --wps-panel: #ffffff;
  --wps-text: #17202a;
  --wps-muted: #5d6a76;
  --wps-border: #d7dde5;
  --wps-border-strong: #b8c2ce;
  --wps-accent: #1769aa;
  --wps-accent-dark: #0f4d80;
  --wps-ok: #0f7b4a;
  --wps-fail: #b42318;
  --wps-review: #a15c00;
  --wps-pending: #596879;
}

* {
  box-sizing: border-box;
}

.wps-pqr-page {
  min-height: 100vh;
  margin: 0;
  background: var(--wps-bg);
  color: var(--wps-text);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.module-header,
.module-shell {
  width: min(1600px, calc(100% - 32px));
  margin: 0 auto;
}

.module-header {
  display: flex;
  align-items: center;
  min-height: 54px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--wps-text);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
  text-transform: uppercase;
}

.brand-mark__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--wps-accent);
}

.module-shell {
  padding: 8px 0 32px;
}

.intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.wps-pqr-page h1,
.wps-pqr-page h2,
.wps-pqr-page h3,
.wps-pqr-page p {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif !important;
}

.wps-pqr-page h1 {
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: 0;
}

.intro p {
  max-width: 760px;
  margin-top: 8px;
  color: var(--wps-muted);
  font-size: 15px;
  line-height: 1.5;
}

.source-pill {
  flex: 0 0 auto;
  max-width: 340px;
  padding: 9px 11px;
  border: 1px solid var(--wps-border);
  border-radius: 6px;
  background: #eef3f8;
  color: var(--wps-muted);
  font-size: 13px;
  line-height: 1.35;
}

.source-pill.error {
  border-color: #f3b4ad;
  background: #fff1f0;
  color: var(--wps-fail);
}

.review-panel {
  display: grid;
  gap: 10px;
  border: 1px solid var(--wps-border);
  border-radius: 8px;
  background: var(--wps-panel);
  padding: 14px;
  box-shadow: 0 1px 2px rgb(16 24 40 / 8%);
}

.recent-checks {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(170px, 260px) repeat(6, auto) minmax(180px, 1fr);
  gap: 8px;
  align-items: end;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--wps-border);
}

.recent-checks label {
  display: grid;
  gap: 5px;
}

.recent-checks span {
  color: #344252;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  text-transform: uppercase;
}

.recent-checks select,
.recent-checks input {
  min-height: 36px;
  height: 36px;
  padding: 7px 9px;
  font-size: 14px;
}

.recent-checks__status {
  align-self: center;
  color: var(--wps-muted);
  font-size: 12px;
  line-height: 1.3;
}

.recent-checks__status.error {
  color: var(--wps-fail);
  font-weight: 700;
}

.json-import-panel {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(420px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--wps-border);
  border-radius: 8px;
  background: #f8fafc;
}

.json-import-panel[hidden] {
  display: none;
}

.json-import-panel label {
  display: grid;
  gap: 5px;
}

.json-import-panel span {
  color: #344252;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  text-transform: uppercase;
}

.json-import-panel input,
.json-import-panel textarea {
  width: 100%;
  border: 1px solid var(--wps-border-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--wps-text);
  font: inherit;
}

.json-import-panel input {
  min-height: 36px;
  padding: 6px 8px;
}

.json-import-panel textarea {
  min-height: 118px;
  padding: 8px 10px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.35;
}

.json-import-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.ai-prompt-panel label {
  grid-column: 1 / 3;
}

.ai-prompt-panel textarea {
  min-height: 360px;
}

.review-section {
  display: grid;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--wps-border-strong);
}

.review-section:last-of-type {
  padding-bottom: 0;
  border-bottom: 0;
}

.review-section h2 {
  padding: 0 2px 6px;
  border-bottom: 1px solid var(--wps-border);
  color: #1f2a37;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0;
}

.review-grid {
  display: grid;
  grid-template-columns: minmax(560px, 620px) minmax(500px, 1fr) 220px 190px;
  gap: 10px 12px;
  align-items: start;
}

.testing-stack {
  display: grid;
  gap: 12px;
}

.testing-subsection {
  display: grid;
  gap: 8px;
}

.testing-subsection h3 {
  padding: 0 2px 5px;
  border-bottom: 1px solid var(--wps-border);
  color: #253244;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 800;
}

.testing-grid {
  display: grid;
  grid-template-columns: minmax(980px, 1fr) 220px 190px;
  gap: 10px 12px;
  align-items: start;
}

.qw250-grid {
  grid-template-columns: minmax(560px, 620px) minmax(500px, 1fr) 220px 190px;
}

.qw250-main {
  display: grid;
  grid-column: 1 / 3;
  gap: 10px;
}

.qw250-spacer {
  display: none;
}

.qw250-grid #qw250VariablesResult {
  grid-column: 3;
  margin-top: 72px;
}

.qw250-grid > .reference-slot {
  grid-column: 4;
  margin-top: 72px;
}

.section-instruction {
  color: var(--wps-muted);
  font-size: 14px;
  line-height: 1.45;
}

.qw250-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 36px;
}

.qw250-chart-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.qw250-chart-button.active {
  border-color: var(--wps-accent-dark);
  background: var(--wps-accent);
  color: #ffffff;
}

.yes-no-fieldset {
  display: grid;
  gap: 7px;
  margin: 0;
  border: 1px solid var(--wps-border);
  border-radius: 6px;
  padding: 9px 10px;
  background: #fbfcfd;
}

.yes-no-fieldset legend {
  padding: 0 4px;
  color: #344252;
  font-size: 13px;
  font-weight: 800;
}

.essential-variable-check {
  display: grid;
  gap: 8px;
}

.essential-variable-question {
  color: #344252;
  font-size: 13px;
  font-weight: 800;
}

.essential-variable-rows {
  display: grid;
  gap: 7px;
}

.essential-variable-result-row {
  display: grid;
  width: calc(100% + 232px);
  grid-template-columns: minmax(220px, 1fr) 220px;
  gap: 10px;
  align-items: center;
}

.essential-variable-row {
  padding: 8px 10px;
  border: 1px solid var(--wps-border);
  border-radius: 6px;
  background: #fbfcfd;
}

.essential-variable-result-cell .result-control {
  justify-self: start;
}

.essential-variable-process {
  color: #1f2d3d;
  font-size: 13px;
  font-weight: 900;
}

.essential-variable-summary {
  margin-top: 2px;
  color: var(--wps-muted);
  font-size: 12px;
  line-height: 1.25;
}

.manual-variable-panel {
  display: grid;
  gap: 7px;
}

.manual-variable-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(220px, auto);
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--wps-border);
  border-radius: 6px;
  background: #fbfcfd;
}

.manual-variable-label {
  color: #1f2d3d;
  font-size: 13px;
  font-weight: 900;
}

.manual-variable-context,
.manual-variable-note {
  color: var(--wps-muted);
  font-size: 12px;
  line-height: 1.3;
}

.manual-variable-note {
  align-self: start;
  padding-top: 8px;
}

.manual-variable-answer {
  display: grid;
  gap: 5px;
  justify-items: end;
  color: #344252;
  font-size: 12px;
  font-weight: 800;
}

.yes-no-options {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.column-heading {
  color: #465465;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.stacked-fields {
  display: grid;
  gap: 8px;
}

.detail-field-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.process-row-actions {
  display: flex;
  gap: 8px;
  padding: 0 2px;
}

.process-rows {
  display: grid;
  gap: 8px;
}

.supporting-pqr-scroll {
  max-height: min(360px, 54vh);
  overflow-x: hidden;
  overflow-y: scroll;
  padding-right: 7px;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

#pqrProcessRows.supporting-pqr-scroll {
  max-height: none;
  overflow-x: visible;
  overflow-y: visible;
  padding-right: 0;
}

.supporting-pqr-scroll.pqr-paged {
  max-height: none;
  overflow-x: visible;
  overflow-y: visible;
  padding-right: 0;
}

.guided-bend-scroll {
  max-height: min(250px, 42vh);
}

.tensile-test-scroll {
  max-height: min(210px, 38vh);
}

.preheat-scroll {
  max-height: min(190px, 34vh);
}

.supporting-pqr-scroll::-webkit-scrollbar {
  width: 10px;
}

.supporting-pqr-scroll::-webkit-scrollbar-track {
  border-radius: 999px;
  background: #edf1f5;
}

.supporting-pqr-scroll::-webkit-scrollbar-thumb {
  border: 2px solid #edf1f5;
  border-radius: 999px;
  background: #9aa8b7;
}

.supporting-pqr-scroll::-webkit-scrollbar-thumb:hover {
  background: #748395;
}

.process-input-row {
  display: grid;
  gap: 6px;
  border: 1px solid #e1e6ec;
  border-radius: 6px;
  padding: 8px;
  background: #fbfcfe;
}

.process-input-row__title {
  color: #253244;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.process-field-grid {
  display: grid;
  grid-template-columns: minmax(82px, 0.7fr) minmax(0, 1fr);
  gap: 8px;
}

.process-field-grid.wps {
  grid-template-columns: minmax(82px, 0.7fr) minmax(0, 1fr) minmax(0, 1fr);
}

.pqr-process-card,
.wps-filler-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 1px solid #d4dce5;
  border-radius: 6px;
  padding: 8px 10px 10px;
  background: #fbfcfe;
}

.pqr-process-card[hidden] {
  display: none;
}

.process-input-row[hidden],
.bend-test-card[hidden],
.tensile-test-card[hidden] {
  display: none;
}

.pqr-pager-layout,
.pqr-process-pager-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 8px;
  align-items: stretch;
}

.pqr-pager-layout.single {
  grid-template-columns: minmax(0, 1fr);
}

.pqr-pager-cards,
.pqr-process-pager-cards {
  min-width: 0;
}

.pqr-pager,
.pqr-process-pager {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
  align-items: stretch;
  justify-items: stretch;
  padding: 2px 0;
}

.pqr-page-button,
.pqr-page-spacer {
  min-height: 82px;
}

.pqr-page-button {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
  border: 1px solid #c9d3df;
  border-radius: 6px;
  background: #ffffff;
  color: #253244;
  cursor: pointer;
}

.pqr-page-button:hover,
.pqr-page-button:focus {
  border-color: #1971b8;
  background: #eef6ff;
}

.pqr-page-button span {
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.pqr-page-button small {
  max-width: 58px;
  overflow-wrap: anywhere;
  color: #455468;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
}

.filler-matrix {
  --filler-head-row: 42px;
  --filler-row: 44px;
  --filler-thickness-row: 70px;
  --filler-single-pass-row: 46px;
  display: grid;
  grid-template-columns: 154px minmax(0, 1fr);
  max-width: 100%;
  border: 1px solid #d4dce5;
  border-radius: 6px;
  overflow: hidden;
  background: #ffffff;
}

.filler-legend,
.filler-process-column {
  display: grid;
  grid-auto-rows: var(--filler-row);
  gap: 0;
}

.wps-filler-matrix .filler-legend,
.wps-filler-matrix .filler-process-column {
  grid-auto-rows: var(--filler-row);
}

.filler-legend {
  position: sticky;
  left: 0;
  z-index: 2;
  border-right: 1px solid #cfd8e3;
  background: #f8fafc;
}

.filler-legend::after {
  content: "";
  display: block;
  height: 10px;
  background: #f8fafc;
}

.filler-process-scroll {
  min-width: 0;
  overflow-x: scroll;
  overflow-y: hidden;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.filler-process-scroll::-webkit-scrollbar {
  height: 10px;
}

.filler-process-scroll::-webkit-scrollbar-track {
  background: #eef2f7;
}

.filler-process-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #8d99a8;
}

.filler-process-track {
  display: flex;
  min-width: max-content;
}

.filler-process-column {
  width: 182px;
  min-width: 182px;
  border: 0;
  border-right: 1px solid #d4dce5;
  border-radius: 0;
  padding: 0;
  background: #ffffff;
}

.filler-cell {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  height: var(--filler-row);
  min-height: var(--filler-row);
  min-width: 0;
  border-bottom: 1px solid #e1e6ec;
  padding: 5px 7px;
  color: #253244;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
}

.filler-cell.process-head {
  justify-content: center;
  height: var(--filler-head-row);
  min-height: var(--filler-head-row);
  background: #f8fafc;
  text-align: center;
  text-transform: uppercase;
}

.filler-process-column .filler-cell {
  font-weight: 500;
}

.filler-process-column .filler-cell.process-head input {
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.filler-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.compact-control {
  min-height: 30px !important;
  height: 30px !important;
  padding: 4px 8px !important;
  font-size: 12px !important;
}

.filler-process-head-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  gap: 5px;
  align-items: center;
  width: 100%;
}

.icon-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  min-height: 24px;
  border: 1px solid #c9d3df;
  border-radius: 4px;
  background: #ffffff;
  color: #455468;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.icon-control:hover,
.icon-control:focus {
  border-color: #f3b4ad;
  background: #fff1f0;
  color: var(--wps-fail);
}

.filler-cell input {
  box-sizing: border-box;
  height: 30px;
  min-height: 30px;
  padding: 4px 7px;
  font-size: 13px;
}

.weld-range-cell {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 4px;
}

.weld-thickness-cell {
  height: var(--filler-thickness-row);
  min-height: var(--filler-thickness-row);
  align-content: center;
}

.filler-legend .weld-thickness-cell {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.filler-cell-hint {
  display: block;
  margin-top: 4px;
  color: var(--wps-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
}

.weld-range-cell input {
  height: 25px;
  min-height: 25px;
}

.single-pass-cell {
  justify-content: center;
  height: var(--filler-single-pass-row);
  min-height: var(--filler-single-pass-row);
}

.filler-variable-inactive {
  background: #e2e8f0;
  color: #4f5f73;
}

.filler-variable-inactive input {
  border-color: #aeb9c7;
  background: #eef2f7;
  color: #4f5f73;
}

.single-pass-cell:not(:has([data-pqr-single-pass]:checked)) {
  color: var(--wps-fail);
}

.single-pass-na {
  justify-content: center;
}

.pqr-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.coupon-detail-grid label:last-child {
  grid-column: 1 / -1;
}

.base-metal-pair {
  display: grid;
  gap: 7px;
  border-top: 1px solid #e1e6ec;
  padding-top: 8px;
}

.stacked-fields > .base-metal-pair:first-child {
  border-top: 0;
  padding-top: 0;
}

.base-metal-pair__title,
.base-metal-side-label {
  color: #253244;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.base-metal-side-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.base-metal-lookup {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 1px solid #e1e6ec;
  border-radius: 6px;
  padding: 7px;
  background: #ffffff;
}

.base-metal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px;
}

.base-metal-grid input,
.base-metal-lookup select {
  min-height: 34px;
  height: 34px;
  padding: 6px 8px;
  font-size: 13px;
}

.base-metal-lookup select[size] {
  height: auto;
  max-height: 240px;
  overflow-y: auto;
}

.base-metal-search {
  justify-self: start;
}

.base-metal-selected {
  color: var(--wps-muted);
  font-size: 11px;
  line-height: 1.3;
}

.base-metal-lookup.qw422-selection-missing .base-metal-selected {
  color: #b91c1c;
  font-weight: 800;
}

.base-metal-lookup.qw422-selection-missing .base-metal-search {
  border-color: #dc2626;
  color: #b91c1c;
  background: #fff7f7;
}

.qw422-picker {
  position: fixed;
  z-index: 1000;
  border: 1px solid #b8c4d3;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.22);
  overflow: hidden;
}

.qw422-picker__summary,
.qw422-picker__empty {
  padding: 8px 10px;
  border-bottom: 1px solid #d8e0e9;
  color: #344252;
  font-size: 12px;
  font-weight: 750;
}

.qw422-picker__empty {
  border-bottom: 0;
}

.qw422-picker__scroll {
  max-height: 360px;
  overflow: auto;
}

.qw422-picker__table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  font-size: 12px;
  line-height: 1.25;
}

.qw422-picker__table th,
.qw422-picker__table td {
  border-bottom: 1px solid #e1e6ec;
  padding: 7px 8px;
  text-align: left;
  vertical-align: top;
}

.qw422-picker__table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f3f6fa;
  color: #344252;
  font-weight: 800;
}

.qw422-picker__table tbody tr {
  cursor: pointer;
}

.qw422-picker__table th:nth-child(1),
.qw422-picker__table td:nth-child(1) {
  width: 120px;
}

.qw422-picker__table th:nth-child(2),
.qw422-picker__table td:nth-child(2) {
  width: 150px;
}

.qw422-picker__table th:nth-child(3),
.qw422-picker__table td:nth-child(3),
.qw422-picker__table th:nth-child(4),
.qw422-picker__table td:nth-child(4),
.qw422-picker__table th:nth-child(5),
.qw422-picker__table td:nth-child(5) {
  width: 86px;
  white-space: nowrap;
}

.qw422-picker__composition {
  min-width: 300px;
}

.qw422-picker__row-button {
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: #0f5e9c;
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.qw422-picker__table tr:hover td {
  background: #eef6ff;
}

.pqr-process-card {
  display: grid;
  gap: 8px;
  border: 1px solid #d8e0e9;
  border-radius: 6px;
  padding: 8px;
  background: #f8fafc;
}

.bend-test-card {
  display: grid;
  gap: 6px;
  border: 1px solid #d8e0e9;
  border-radius: 6px;
  padding: 7px;
  background: #f8fafc;
}

.tensile-test-card {
  display: grid;
  gap: 6px;
  border: 1px solid #d8e0e9;
  border-radius: 6px;
  padding: 7px;
  background: #f8fafc;
}

.tensile-card-header,
.tensile-set-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 8px;
}

.tensile-set-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #253244;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.tensile-set-toggle input {
  width: 16px;
  height: 16px;
  min-height: 16px;
}

.tensile-set-actions {
  display: flex;
  justify-content: flex-end;
}

.tensile-set-list {
  display: grid;
  gap: 7px;
}

.tensile-set-card {
  display: grid;
  gap: 5px;
  border: 1px solid #e1e6ec;
  border-radius: 6px;
  padding: 6px;
  background: #ffffff;
}

.tensile-set-header label {
  display: grid;
  gap: 2px;
  width: 86px;
}

.tensile-set-header span {
  color: #465465;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.tensile-set-header input {
  height: 30px;
  min-height: 30px;
  padding: 5px 7px;
  font-size: 13px;
}

.tensile-test-grid {
  display: grid;
  gap: 4px;
  overflow-x: auto;
}

.tensile-test-row {
  display: grid;
  grid-template-columns: 70px 82px 82px 88px 112px 116px 104px;
  gap: 6px;
  align-items: center;
  min-width: 696px;
}

.tensile-test-row.head {
  color: #465465;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.tensile-test-row input {
  width: 100%;
  min-height: 34px;
  height: 34px;
  padding: 7px 9px;
  font-size: 14px;
}

.tensile-test-row.fail {
  border-left: 3px solid var(--wps-fail);
  padding-left: 6px;
}

.tensile-test-row.fail input {
  border-color: #f0a29a;
  background: #fff7f6;
}

input.needs-review-field,
select.needs-review-field,
.tensile-test-row input.needs-review-field {
  border-color: #dc2626;
  background: #fff1f1;
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.18);
}

.bend-test-grid {
  display: grid;
  gap: 4px;
}

.bend-test-row,
.bend-test-row.head {
  display: grid;
  grid-template-columns: minmax(90px, 0.8fr) minmax(130px, 1fr) minmax(86px, 0.7fr);
  gap: 6px;
  align-items: center;
}

.bend-test-row.head {
  color: #465465;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.bend-test-row select,
.bend-test-row input {
  min-height: 34px;
  padding: 7px 9px;
  font-size: 14px;
}

.bend-test-row.fail {
  border-left: 3px solid var(--wps-fail);
  padding-left: 6px;
}

.bend-test-row.fail input,
.bend-test-row.fail select {
  border-color: #f0a29a;
  background: #fff7f6;
}

.process-type-group {
  display: grid;
  gap: 7px;
  min-width: 0;
  margin: 0;
  border: 1px solid #d8e0e9;
  border-radius: 6px;
  padding: 8px;
  background: #fbfcfe;
}

.process-type-group legend {
  padding: 0 4px;
  color: #344252;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
}

.process-type-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.radio-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.check-option,
.radio-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: #344252;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.25;
}

.check-option input,
.radio-option input {
  width: 15px;
  height: 15px;
  min-height: 15px;
  margin: 0;
  padding: 0;
}

.signature-field {
  display: grid;
  gap: 7px;
  border-top: 1px solid #e1e6ec;
  padding-top: 8px;
}

.single-pass-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid #e1e6ec;
  padding-top: 8px;
}

.single-pass-question {
  color: #344252;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}

.single-pass-field:not(:has([data-pqr-single-pass]:checked)) .single-pass-question {
  color: var(--wps-fail);
}

.single-pass-options {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 10px;
}

.signature-field > span {
  color: #344252;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
}

label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

label span {
  color: #344252;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
}

input {
  width: 100%;
  height: 38px;
  min-height: 38px;
  border: 1px solid #c8d0da;
  border-radius: 6px;
  padding: 7px 10px;
  color: var(--wps-text);
  font: inherit;
  font-size: 15px;
  background: #ffffff;
  box-shadow: none;
}

select {
  width: 100%;
  height: 38px;
  min-height: 38px;
  border: 1px solid #c8d0da;
  border-radius: 6px;
  padding: 7px 10px;
  color: var(--wps-text);
  font: inherit;
  font-size: 15px;
  background: #ffffff;
  box-shadow: none;
}

input:focus {
  border-color: var(--wps-accent);
  outline: 3px solid rgb(23 105 170 / 18%);
}

select:focus {
  border-color: var(--wps-accent);
  outline: 3px solid rgb(23 105 170 / 18%);
}

.actions {
  display: flex;
  gap: 10px;
  padding-top: 4px;
}

button {
  width: auto;
  min-height: 38px;
  border: 1px solid var(--wps-accent);
  border-radius: 6px;
  padding: 8px 14px;
  background: var(--wps-accent);
  color: #ffffff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  box-shadow: none;
}

button:hover {
  background: var(--wps-accent-dark);
  border-color: var(--wps-accent-dark);
}

button.secondary {
  background: #ffffff;
  color: var(--wps-accent);
}

button.small-control {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 12px;
}

.result-slot {
  position: relative;
  min-height: 38px;
}

.result-stack,
.reference-stack {
  display: grid;
  gap: 8px;
}

.result-control {
  position: relative;
  display: inline-flex;
}

.process-result-slot {
  display: grid;
  gap: 8px;
}

.process-result-group {
  display: grid;
  gap: 8px;
}

.process-result-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 30px;
}

.process-result-label {
  color: #344252;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.process-result-row .result-badge {
  width: 86px;
}

.reference-slot {
  position: relative;
  min-height: 38px;
  font-size: 13px;
  line-height: 38px;
}

.reference-line {
  min-height: 30px;
  padding-top: 5px;
  color: #344252;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.reference-text {
  display: grid;
  gap: 5px;
  color: #344252;
  font-size: 12px;
  line-height: 1.35;
}

.reference-text strong {
  font-size: 12px;
  line-height: 1.25;
}

.reference-button {
  min-height: 30px;
  border-color: #8ba2b8;
  padding: 6px 10px;
  background: #ffffff;
  color: var(--wps-accent-dark);
  font-size: 12px;
  line-height: 1;
}

.reference-button:hover,
.reference-button[aria-expanded="true"] {
  border-color: var(--wps-accent);
  background: #eef6ff;
  color: var(--wps-accent-dark);
}

.reference-popover {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  right: 0;
  display: none;
  width: min(520px, 72vw);
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--wps-border-strong);
  border-radius: 6px;
  padding: 10px 12px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgb(15 23 42 / 18%);
  color: #1f2a37;
  line-height: 1.35;
  scrollbar-gutter: stable;
}

.reference-button:hover + .reference-popover,
.reference-button:focus-visible + .reference-popover,
.reference-slot:hover .reference-popover,
.reference-slot:focus-within .reference-popover,
.reference-popover:hover {
  display: block;
}

.reference-popover pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.35;
}

.result-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  padding: 6px 12px;
  color: #ffffff;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  cursor: help;
}

.result-badge.ok {
  background: var(--wps-ok);
}

.result-badge.fail {
  background: var(--wps-fail);
}

.result-badge.needs-review {
  background: var(--wps-review);
}

.result-badge.pending {
  background: var(--wps-pending);
}

.result-popover {
  position: fixed;
  top: var(--result-popover-top, 0);
  left: var(--result-popover-left, 0);
  z-index: 20;
  display: none;
  width: min(440px, 90vw);
  max-height: 70vh;
  overflow: auto;
  border: 1px solid var(--wps-border-strong);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
  box-shadow: 0 14px 40px rgb(15 23 42 / 18%);
}

.result-control:hover .result-popover,
.result-control:focus-within .result-popover {
  display: grid;
  gap: 10px;
}

.facts {
  display: grid;
  gap: 7px;
}

.fact {
  border: 1px solid #e1e6ec;
  border-radius: 6px;
  padding: 8px;
  background: #fafbfc;
}

.fact strong {
  display: block;
  margin-bottom: 3px;
  color: #465465;
  font-size: 12px;
}

.fact span {
  color: var(--wps-text);
  font-size: 13px;
  line-height: 1.35;
  white-space: pre-line;
}

.messages,
.notes {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: #354153;
  font-size: 13px;
  line-height: 1.4;
}

.note-label {
  font-weight: 800;
}

.review-warning {
  border-left: 3px solid var(--wps-review);
  padding: 8px 9px;
  background: #fff7ed;
  color: #713f12;
  font-size: 13px;
}

.muted {
  color: var(--wps-muted);
}

.reference-panel {
  margin-top: 10px;
  border: 1px solid var(--wps-border-strong);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
  overflow-x: auto;
}

.reference-heading {
  display: grid;
  gap: 2px;
  margin-bottom: 8px;
  text-align: center;
  color: #111827;
}

.reference-heading strong {
  font-size: 13px;
  line-height: 1.2;
}

.reference-heading span {
  font-size: 12px;
  line-height: 1.2;
}

.reference-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
  color: #111827;
  font-size: 11px;
  line-height: 1.15;
}

.reference-table caption {
  caption-side: top;
  padding-bottom: 6px;
  font-size: 12px;
  font-weight: 800;
}

.reference-table th,
.reference-table td {
  border: 1px solid #111827;
  padding: 4px 5px;
  text-align: center;
  vertical-align: middle;
}

.reference-table th {
  background: #f8fafc;
  font-weight: 800;
}

.reference-table td:first-child {
  text-align: left;
}

.reference-table .subhead th {
  border-bottom-width: 2px;
}

.reference-notes {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  color: #111827;
  font-size: 11px;
  line-height: 1.25;
}

.reference-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px;
}

.reference-note strong {
  white-space: nowrap;
}

.qw424-reference-heading {
  margin-top: 14px;
}

.qw424-reference-table th,
.qw424-reference-table td {
  text-align: left;
  vertical-align: top;
}

.qw432-reference-heading {
  margin-top: 0;
}

.qw432-reference-scroll {
  max-height: min(520px, 64vh);
  overflow: auto;
  scrollbar-gutter: stable;
}

.qw432-reference-table {
  min-width: 760px;
}

.qw250-reference-heading {
  margin-top: 0;
}

.qw250-reference-scroll {
  max-height: min(620px, 70vh);
  overflow: auto;
  scrollbar-gutter: stable;
}

.qw250-reference-table {
  min-width: 760px;
}

.qw250-reference-table th,
.qw250-reference-table td {
  padding: 3px 5px;
}

.qw250-reference-table th:nth-child(1),
.qw250-reference-table th:nth-child(2),
.qw250-reference-table td:nth-child(1),
.qw250-reference-table td:nth-child(2) {
  width: 86px;
}

.qw250-reference-table th:nth-child(4),
.qw250-reference-table th:nth-child(5),
.qw250-reference-table th:nth-child(6),
.qw250-reference-table td:nth-child(4),
.qw250-reference-table td:nth-child(5),
.qw250-reference-table td:nth-child(6) {
  width: 96px;
}

.qw250-paragraph-group {
  color: #0048bd;
  font-weight: 700;
  text-align: left !important;
  vertical-align: top !important;
}

.qw250-paragraph {
  text-align: right !important;
  white-space: nowrap;
}

.qw250-variable {
  text-align: left !important;
}

.qw250-legend {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  color: #111827;
  font-size: 11px;
  line-height: 1.25;
}

.qw250-legend-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 4px 12px;
}

@media (max-width: 1180px) {
  .review-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 160px 150px;
  }

  .qw250-grid {
    grid-template-columns: minmax(0, 1fr) 0 160px 150px;
  }

  .testing-grid {
    grid-template-columns: minmax(0, 1fr) 160px minmax(150px, 0.75fr);
  }

  .essential-variable-result-row {
    width: calc(100% + 172px);
    grid-template-columns: minmax(220px, 1fr) 160px;
  }
}

@media (max-width: 760px) {
  .intro,
  .recent-checks,
  .json-import-panel,
  .review-grid,
  .qw250-grid,
  .testing-grid {
    grid-template-columns: 1fr;
  }

  .intro {
    display: grid;
  }

  .source-pill {
    max-width: none;
  }

  .json-import-actions {
    justify-content: flex-start;
  }

  .column-heading {
    display: none;
  }

  .result-popover {
    right: auto;
    left: 0;
  }

  .process-field-grid,
  .process-field-grid.wps,
  .pqr-detail-grid,
  .detail-field-pair,
  .base-metal-side-row,
  .base-metal-grid,
  .bend-test-row,
  .tensile-test-row,
  .bend-type-group {
    grid-template-columns: 1fr;
  }

  .qw250-legend-grid {
    grid-template-columns: 1fr 1fr;
  }

  .qw250-main,
  .qw250-grid #qw250VariablesResult,
  .qw250-grid > .reference-slot {
    grid-column: auto;
    margin-top: 0;
  }

  .essential-variable-result-row {
    width: auto;
    grid-template-columns: 1fr;
  }

  .supporting-pqr-scroll {
    max-height: 320px;
  }

  .coupon-detail-grid label:last-child {
    grid-column: auto;
  }
}
