/* Section 6: consistent spacing, readable evidence and compact workshop forms. */
.board-shell--qc #main-content { min-width: 0; }
.qc-workspace { min-width: 0; padding: 28px; background: #fff; border: 1px solid #e0e7e4; border-radius: 18px; box-shadow: 0 8px 26px #243f3305; }
.qc-heading { padding-bottom: 24px; }
.qc-heading h2 { margin: 2px 0 10px; color: #213e34; font-size: 28px; }
.qc-heading p { margin: 0; color: #73867d; font-size: 14px; line-height: 1.95; }
.qc-heading .eyebrow { color: #567665; font-size: 12px; }
.qc-route-guide { display: flex; gap: 22px; flex-wrap: wrap; list-style: none; margin: 0 0 28px; padding: 16px 20px; background: #f4f8f5; border: 1px solid #e6ede8; border-radius: 12px; }
.qc-route-guide li { display: flex; align-items: center; gap: 8px; color: #577165; font-size: 12px; }
.qc-route-guide span { display: grid; place-items: center; width: 24px; height: 24px; flex-shrink: 0; border-radius: 50%; background: #e4efe7; color: #427653; }
.qc-tabs { display: flex; gap: 22px; margin: 0; padding: 0; overflow-x: auto; border-bottom: 1px solid #e2e9e4; scrollbar-width: thin; }
.qc-tabs button { flex: 0 0 auto; min-height: 50px; padding: 12px 2px 16px; border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; color: #78897f; font-size: 13px; font-weight: 550; box-shadow: none; }
.qc-tabs button[aria-selected="true"] { color: #2d654b; border-bottom-color: #418464; }
.qc-toolbar { display: flex; align-items: end; gap: 18px; padding: 22px 0; margin: 0; }
.qc-toolbar label { display: grid; gap: 8px; min-width: 0; color: #5b7467; font-size: 12px; }
.qc-toolbar label:first-child { width: min(390px,100%); }
.qc-toolbar :is(input,select) { width: 100%; min-width: 0; min-height: 44px; padding: 9px 12px; border: 1px solid #d9e3dc; border-radius: 9px; background: #fcfdfc; color: #355643; font-size: 13px; }
.qc-workspace .formulation-panel { margin: 0; padding: 24px 0 6px; border: 0; border-top: 1px solid #ecf0ed; border-radius: 0; background: #fff; box-shadow: none; }
.qc-workspace .panel-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin: 0 0 22px; }
.qc-workspace .panel-heading > div { display: flex; flex-wrap: wrap; gap: 10px; }
.qc-workspace h3 { margin: 0; color: #2d4b3b; font-size: 18px; }
.qc-workspace :is(.panel-heading,.record-actions) button, .qc-workspace .record-card > button { min-height: 40px; padding: 8px 15px; border: 1px solid #d4e2d8; border-radius: 9px; background: #fff; color: #36694d; font-size: 12px; font-weight: 600; line-height: 1.7; }
.qc-workspace .panel-heading > button, .qc-workspace .panel-heading > div > button:first-child { background: #306e4e; color: #fff; border-color: #306e4e; }
.qc-workspace .record-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(340px,100%),1fr)); gap: 18px; }
.qc-workspace .record-card { min-width: 0; padding: 22px; background: #fff; border: 1px solid #dfe7e1; border-radius: 13px; font-size: 13px; line-height: 1.95; overflow-wrap: anywhere; }
.qc-workspace .record-card h4 { margin: 0; color: #2d4d3b; font-size: 16px; line-height: 1.9; }
.qc-workspace .record-card p { margin: 8px 0 0; color: #657a6b; }
.qc-workspace .record-card .qc-reference { color: #869489; font-size: 11px; }
.qc-workspace .status-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; color: #507356; background: #edf4ed; font-size: 11px; white-space: normal; }
.qc-next-step { display: grid; gap: 5px; margin: 16px 0; padding: 12px 14px; border-radius: 9px; background: #f5f8f3; color: #66805e; font-size: 12px; }
.qc-next-step strong { color: #436d45; font-size: 11px; }
.qc-workspace .record-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; padding-top: 16px; border-color: #edf1ed; }
.qc-workspace .record-card > details { margin-top: 18px; padding-top: 14px; }
.qc-workspace details summary { cursor: pointer; color: #5f7d66; font-size: 12px; }
.qc-workspace h5 { margin: 18px 0 8px; font-size: 13px; }
.qc-workspace a { color: #387458; text-underline-offset: 4px; }
.qc-workspace .empty-state { margin: 0; padding: 36px 22px; color: #7c8b7d; background: #fafcf8; border: 1px dashed #dae4d5; border-radius: 12px; font-size: 13px; }
.qc-workspace :is(.form-boundary,.qc-boundary) { color: #7b8973; font-size: 12px; line-height: 1.95; }
.qc-workspace .form-boundary { margin: 0 0 22px; }
.qc-boundary { margin-top: 26px; padding-top: 18px; border-top: 1px solid #edf1ed; }
.qc-boundary p { margin: 4px 0 0; }
.qc-workspace .coa-watermark { margin-bottom: 18px; padding: 10px; border-radius: 8px; background: #faf5e8; color: #826d3e; font-size: 12px; }
.qc-table-wrap { max-width: 100%; overflow-x: auto; margin-top: 16px; }
.qc-table-wrap table { width: 100%; font-size: 12px; }
.qc-table-wrap :is(th,td) { padding: 10px; text-align: right; }
.qc-version-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.qc-version-links a[aria-current] { font-weight: 750; }
.qc-workspace .record-card .qc-evidence-note { padding: 10px 12px; border-radius: 8px; background: #f8f7ef; color: #7d754c; }
.board-shell--qc .qc-dialog { width: min(760px,calc(100vw - 28px)); max-width: calc(100vw - 28px); max-height: calc(100dvh - 32px); padding: 0; overflow: hidden; border: 1px solid #dce5da; border-radius: 16px; background: #fff; box-shadow: 0 24px 70px #17352a36; }
.board-shell--qc .qc-dialog::backdrop { background: #17372e80; backdrop-filter: blur(3px); }
.board-shell--qc .qc-dialog > form { display: flex; flex-direction: column; min-width: 0; max-height: calc(100dvh - 34px); gap: 0; padding: 0; }
.qc-dialog header { flex: 0 0 auto; padding: 24px; border-bottom: 1px solid #e5ebdf; background: #fafcf7; }
.qc-dialog :is(h2,h3) { margin: 0; color: #2e5139; font-size: 21px; }
.qc-dialog p { margin: 8px 0 0; color: #697f61; font-size: 13px; line-height: 1.9; }
.qc-dialog .qc-form-body { flex: 1 1 auto; min-height: 0; padding: 24px; overflow-y: auto; scroll-padding-block: 20px; }
.qc-dialog .form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; gap: 22px 20px; }
.qc-dialog .form-full { grid-column: 1 / -1; }
.qc-dialog label { display: grid; align-content: start; gap: 8px; min-width: 0; color: #4b6b4d; font-size: 14px; line-height: 1.8; }
.qc-dialog :is(input,select,textarea) { width: 100%; min-width: 0; min-height: 46px; padding: 9px 12px; border: 1px solid #cddbc7; border-radius: 9px; background: #fcfdfb; color: #2e5237; font: inherit; line-height: 1.75; }
.qc-dialog textarea { min-height: 92px; resize: vertical; }
.qc-dialog input[type="hidden"] { display: none; }
.qc-dialog :is(small,.field-note) { color: #71876a; font-size: 12px; line-height: 1.85; }
.qc-dialog fieldset { margin: 0; min-width: 0; padding: 14px; border: 1px solid #e1e8db; border-radius: 10px; }
.qc-dialog legend { padding-inline: 5px; color: #4b6b4d; font-size: 13px; }
.qc-dialog .dialog-actions { display: flex; flex-direction: row; justify-content: flex-start; gap: 10px; flex: 0 0 auto; padding: 20px 24px; margin: 0; border-top: 1px solid #e2e9da; background: #fff; }
.qc-dialog .dialog-actions button { flex: 0 1 150px; width: 150px; min-width: 0; height: 46px; padding: 10px 16px; border: 1px solid #ccdcbc; border-radius: 10px; background: #fff; color: #446a45; font: inherit; font-size: 14px; font-weight: 650; }
.qc-dialog .dialog-actions button[type="submit"] { background: #306e4e; border-color: #306e4e; color: #fff; }
.qc-dialog .dialog-actions button:disabled { opacity: .45; cursor: not-allowed; }
.qc-dialog .qc-form-notice { margin: 0 0 18px; padding: 12px 14px; border-radius: 9px; background: #f4f7ee; }
.qc-dialog :is(.form-error,[role="alert"]) { margin: 0 0 18px; padding: 12px 14px; border-radius: 9px; color: #914c36; background: #fff3ee; }
@media(max-width:720px) {
  .qc-workspace { padding: 20px; border-radius: 14px; }
  .qc-heading h2 { font-size: 24px; }
  .qc-route-guide { gap: 12px; padding: 14px; }
  .qc-tabs { gap: 18px; }
  .qc-toolbar { flex-wrap: wrap; }
  .qc-toolbar label:first-child { width: 100%; }
  .qc-workspace .record-card { padding: 18px; }
  .qc-workspace .record-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: stretch; }
  .qc-workspace .record-actions > * { width: 100%; min-width: 0; text-align: center; }
  .qc-dialog header { padding: 20px; }
  .qc-dialog .qc-form-body { padding: 20px; }
  .qc-dialog .form-grid { grid-template-columns: minmax(0,1fr); gap: 18px; }
  .qc-dialog .dialog-actions { padding: 16px 20px; }
  .qc-dialog .dialog-actions button { flex: 1 1 0; }
}
@media print {
  .qc-workspace { border: 0; box-shadow: none; padding: 0; }
  .qc-version-links, .qc-next-step { display: none; }
  .qc-workspace .coa-watermark { color: #000; border: 2px solid #000; }
  .qc-table-wrap { overflow: visible; }
}

.qc-dialog .qc-fixed-field { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid #e0e8d9; border-radius: 9px; background: #f8faf4; font-size: 13px; color: #647959; overflow-wrap: anywhere; }
.qc-dialog .qc-fixed-field strong { color: #36573c; font-weight: 550; }
.qc-dialog .form-code-note { color: #87927f; font-size: 12px; margin: 0; }
.qc-workspace .qc-tabs button[aria-selected="true"] { color: #2d654b; background: transparent; border-bottom-color: #418464; }
.qc-workspace .qc-tabs button { background: transparent; }
.qc-dialog .dialog-actions { align-items: stretch; }
.qc-dialog .dialog-actions button { min-height: 46px; height: auto; line-height: 1.75; }
.qc-dialog a { color: #387458; font-size: 12px; text-underline-offset: 4px; }
.qc-dialog .qc-evidence-preview { padding: 14px; background: #f7faf4; border: 1px solid #e2e9db; border-radius: 10px; }
.qc-dialog .qc-evidence-preview h3 { font-size: 15px; }
.qc-dialog .qc-result-evidence + .qc-result-evidence { margin-top: 14px; padding-top: 14px; border-top: 1px solid #e2e9db; }
/* Definition shortcuts sit outside labels, so clicking them never opens a select. */
.qc-dialog .qc-choice-field { display: grid; align-content: start; gap: 8px; min-width: 0; }
.qc-dialog .qc-choice-hint { color: #71876a; font-size: 11px; line-height: 1.85; }
.qc-dialog .qc-choice-missing { padding: 8px 10px; color: #876138; background: #fff7e9; border-radius: 7px; font-size: 12px; }
.qc-dialog .qc-choice-actions { display: flex; align-items: stretch; flex-wrap: wrap; gap: 8px; }
.qc-dialog .qc-choice-actions button { min-height: 34px; padding: 6px 10px; color: #3d7354; background: #f7faf4; border: 1px solid #dae5d3; border-radius: 7px; font: inherit; font-size: 11px; line-height: 1.8; }
.qc-dialog .qc-choice-actions button[data-mode="create"] { background: #edf5e9; border-color: #cddfc3; }
.qc-dialog .qc-selected-criterion { margin: 0; padding: 8px 10px; background: #f4f7ee; border-radius: 7px; font-size: 12px; }
.qc-dialog .qc-return-note { margin: 0; padding: 10px 12px; color: #5e7953; background: #f2f7ed; border-radius: 8px; font-size: 12px; }
.qc-choice-return, .qc-source-return { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 18px; margin: 0 0 22px; color: #4c7051; background: #eef6e9; border: 1px solid #d4e4c9; border-radius: 12px; font-size: 13px; line-height: 1.85; }
.qc-choice-return p, .qc-source-return p { margin: 5px 0 0; font-size: 12px; }
.qc-choice-return button, .qc-source-return button { flex: 0 0 auto; min-height: 40px; padding: 8px 14px; color: #306b47; background: #fff; border: 1px solid #cadaC0; border-radius: 9px; font: inherit; font-size: 12px; font-weight: 650; }
.qc-definition-guide { margin-bottom: 22px; padding: 14px 16px; color: #657b62; background: #f8faf5; border: 1px solid #e7ecdf; border-radius: 10px; font-size: 12px; line-height: 1.9; }
.qc-definition-guide summary { cursor: pointer; color: #4e7252; }
.qc-definition-guide p { margin: 10px 0 0; }
@media(max-width:720px) {
  .qc-choice-return, .qc-source-return { flex-direction: column; align-items: stretch; padding: 14px; }
  .qc-choice-return button, .qc-source-return button { width: 100%; }
  .qc-dialog .qc-choice-actions > button { flex: 1 1 120px; }
}
@media print { .qc-choice-return, .qc-source-return, .qc-definition-guide { display: none; } }
