* { box-sizing: border-box; }
body { margin: 0; }
.lab-tools-shell { width: min(1280px, calc(100% - 40px)); padding: 32px 0 56px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-kicker { color: var(--lab-accent-strong); font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.page-kicker a { color: inherit; text-decoration: none; }
.page-title { margin: 7px 0 0; font-size: clamp(30px, 4vw, 46px); line-height: 1.08; letter-spacing: -.035em; }
.page-subtitle { max-width: 720px; margin: 12px 0 0; color: var(--lab-muted); font-size: 17px; line-height: 1.6; }
.lab-hero { min-height: 220px; align-items: center; padding: 34px 38px; border: 1px solid var(--lab-border); border-radius: var(--lab-radius-lg); background: linear-gradient(135deg, #fff 0%, var(--lab-accent-soft) 100%); box-shadow: var(--lab-shadow-soft); }
.section-heading, .results-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.section-heading.compact { margin-bottom: 18px; }
.section-heading h2, .results-heading h2 { margin: 3px 0 0; font-size: 23px; }
.eyebrow { display: block; margin-bottom: 5px; color: var(--lab-muted); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.status { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.status.ok { color: var(--lab-accent-strong); background: var(--lab-accent-soft); }
.status.info { color: var(--lab-info); background: var(--lab-info-soft); }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.tool-card { display: grid; grid-template-columns: 62px 1fr; gap: 18px; min-height: 230px; padding: 26px; color: var(--lab-text); text-decoration: none; background: var(--lab-surface); border: 1px solid var(--lab-border); border-radius: var(--lab-radius-lg); box-shadow: var(--lab-shadow-soft); transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.tool-card:hover, .tool-card:focus-visible { transform: translateY(-2px); border-color: rgba(47,143,123,.45); box-shadow: var(--lab-shadow); }
.tool-card-icon { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 17px; color: var(--lab-accent-strong); background: var(--lab-accent-soft); font-weight: 900; }
.tool-card h3 { margin: 1px 0 8px; font-size: 22px; }
.tool-card p { margin: 0; color: var(--lab-muted); line-height: 1.55; }
.tool-card-action { grid-column: 2; align-self: end; color: var(--lab-accent-strong); font-weight: 800; }
.calculator-header { padding: 18px 0 4px; }
.formula-chip { flex: 0 0 auto; max-width: 360px; padding: 12px 16px; color: var(--lab-accent-strong); background: var(--lab-accent-soft); border: 1px solid rgba(47,143,123,.22); border-radius: 999px; font-size: 13px; font-weight: 750; }
.calculator-section { display: grid; grid-template-columns: 48px 1fr; gap: 20px; margin-bottom: 18px; padding: 24px; background: var(--lab-surface); border: 1px solid var(--lab-border); border-radius: var(--lab-radius-lg); box-shadow: var(--lab-shadow-soft); }
.section-number { display: grid; place-items: center; width: 42px; height: 42px; color: #fff; background: var(--lab-accent); border-radius: 13px; font-size: 17px; font-weight: 900; }
.section-content { min-width: 0; }
.section-note { margin: -5px 0 18px; color: var(--lab-muted); line-height: 1.55; }
.field-grid { display: grid; gap: 14px; }
.protein-grid { grid-template-columns: repeat(4, minmax(160px, 1fr)); }
.field { display: grid; gap: 7px; min-width: 0; color: var(--lab-text); font-size: 13px; font-weight: 750; }
.field b { color: var(--lab-danger); }
input, select, textarea { width: 100%; color: var(--lab-text); background: #fff; border: 1px solid var(--lab-border-strong); border-radius: 9px; outline: none; }
input, select { min-height: 42px; padding: 8px 11px; }
textarea { padding: 13px; }
input:focus, select:focus, textarea:focus { border-color: var(--lab-accent); box-shadow: 0 0 0 3px rgba(47,143,123,.13); }
.group-list { display: grid; gap: 10px; margin: 18px 0 12px; }
.group-row { display: grid; grid-template-columns: minmax(220px, 1fr) 150px 42px; gap: 12px; align-items: end; padding: 13px; background: var(--lab-surface-soft); border-radius: 11px; }
button { cursor: pointer; }
.primary-button, .secondary-button, .icon-button { min-height: 42px; border-radius: 9px; font-weight: 800; }
.primary-button { padding: 0 18px; color: #fff; background: var(--lab-accent); border: 1px solid var(--lab-accent); }
.primary-button:hover { background: var(--lab-accent-strong); }
.secondary-button { padding: 0 15px; color: var(--lab-accent-strong); background: #fff; border: 1px solid var(--lab-border-strong); }
.secondary-button:hover { background: var(--lab-accent-soft); border-color: rgba(47,143,123,.35); }
.icon-button { width: 42px; padding: 0; color: var(--lab-danger); background: #fff; border: 1px solid var(--lab-border-strong); }
.icon-button:disabled { opacity: .35; cursor: not-allowed; }
.table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--lab-border); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--lab-border); white-space: nowrap; }
th { color: var(--lab-muted); background: var(--lab-surface-soft); font-size: 11px; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
.design-table input { min-width: 160px; }
.sample-batches { display: grid; gap: 10px; }
.sample-batch-block { padding: 11px; background: var(--lab-surface-tint); border: 1px solid var(--lab-border); border-radius: 11px; }
.sample-batch-block h3 { margin: 0 0 8px; color: var(--lab-accent-strong); font-size: 14px; }
.sample-group-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 9px; }
.sample-group-card { min-width: 0; padding: 9px; background: var(--lab-surface-soft); border-radius: 9px; }
.sample-group-card h4 { margin: 0 0 7px; font-size: 13px; }
.sample-id-row { display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: center; gap: 6px; margin-top: 6px; }
.sample-id-row > span { color: var(--lab-muted); font-size: 11px; font-weight: 800; text-align: center; }
.sample-id-row input { min-width: 0; min-height: 34px; padding: 6px 9px; font-size: 12px; }
.order-preview { margin-top: 14px; padding: 13px 15px; color: var(--lab-muted); background: var(--lab-surface-tint); border: 1px dashed var(--lab-border-strong); border-radius: 10px; font-size: 13px; line-height: 1.55; }
.order-preview strong { color: var(--lab-text); }
.paste-area { min-height: 240px; resize: vertical; font-family: "Cascadia Code", Consolas, monospace; font-size: 13px; line-height: 1.5; }
.paste-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.paste-field { padding: 15px; background: var(--lab-surface-tint); border: 1px solid var(--lab-border); border-radius: 12px; }
.compact-paste-section { padding-block: 20px; }
.compact-paste-section .section-heading { margin-bottom: 12px; }
#batch-paste-inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.protein-paste-section { min-width: 0; margin: 0; padding: 13px; background: var(--lab-surface-tint); border: 1px solid var(--lab-border); border-radius: 12px; }
.protein-paste-section h3 { margin: 0 0 10px; font-size: 15px; }
.batch-columns { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(135px, 1fr); gap: 9px; overflow-x: auto; padding-bottom: 3px; }
.batch-paste-field { min-width: 0; }
.batch-paste-field .paste-area { min-height: 145px; padding: 10px; font-size: 12px; }
.form-actions { display: flex; justify-content: flex-end; margin-top: 16px; }
.message { margin-top: 14px; padding: 12px 14px; color: var(--lab-danger); background: var(--lab-danger-soft); border: 1px solid rgba(189,75,69,.25); border-radius: 9px; }
.results-section { scroll-margin-top: 20px; margin-top: 28px; }
.results-heading { align-items: center; }
.results-heading p { margin: 8px 0 0; color: var(--lab-muted); }
.result-actions { display: flex; gap: 9px; }
.result-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(360px, .65fr); gap: 18px; }
.result-card { min-width: 0; padding: 20px; background: #fff; border: 1px solid var(--lab-border); border-radius: var(--lab-radius-lg); box-shadow: var(--lab-shadow-soft); }
.result-card h3 { margin: 0 0 15px; font-size: 17px; }
.detail-card { margin-top: 18px; }
.chart-card canvas { display: block; width: 100%; min-height: 320px; }
.bca-setup-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(180px, .4fr); gap: 14px; }
.bca-sample-config { margin-top: 14px; }
.bca-import-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.bca-paste-field textarea { min-height: 92px; resize: vertical; font-family: "Cascadia Code", Consolas, monospace; font-size: 12px; }
.bca-import-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.bca-assignment-bar { display: grid; gap: 10px; margin: 16px 0 12px; padding: 12px; background: var(--lab-surface-tint); border: 1px solid var(--lab-border); border-radius: 11px; }
.bca-palette { display: flex; flex-wrap: wrap; gap: 7px; }
.assignment-chip { min-height: 34px; padding: 5px 11px; color: var(--lab-text); background: #fff; border: 1px solid var(--lab-border-strong); border-radius: 999px; font-size: 12px; font-weight: 800; }
.assignment-chip:hover { border-color: var(--lab-accent); }
.assignment-chip.selected { color: #fff; background: var(--lab-accent-strong); border-color: var(--lab-accent-strong); box-shadow: 0 0 0 3px rgba(47,143,123,.14); }
.assignment-chip.standard-chip:not(.selected) { background: #fff8df; border-color: #ead790; }
.assignment-chip.sample-chip:not(.selected) { background: var(--lab-accent-soft); border-color: rgba(47,143,123,.25); }
.bca-plate-scroll { max-width: 100%; overflow-x: hidden; padding: 3px 0 8px; }
.bca-plate { display: grid; grid-template-columns: 22px repeat(12, minmax(0, 1fr)); gap: 3px; width: 100%; min-width: 0; }
.plate-corner, .plate-column-label, .plate-row-label { display: grid; place-items: center; min-height: 21px; color: var(--lab-muted); font-size: 9px; font-weight: 850; }
.bca-well { min-width: 0; padding: 3px; background: #fff; border: 1px solid var(--lab-border-strong); border-radius: 7px; cursor: pointer; transition: border-color .12s ease, background .12s ease; }
.bca-well:hover { border-color: var(--lab-accent); }
.bca-well.assigned-standard { background: #fff9e8; border-color: #ddc970; }
.bca-well.assigned-sample { background: #eff9f6; border-color: rgba(47,143,123,.42); }
.well-top { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 2px; min-width: 0; margin-bottom: 2px; }
.well-id { color: var(--lab-muted); font-size: 9px; font-weight: 850; }
.well-assignment { min-width: 0; overflow: hidden; color: var(--lab-text); font-size: 8px; font-weight: 750; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.well-od { min-width: 0; min-height: 26px; padding: 3px 4px; border-radius: 5px; font-size: 10px; text-align: center; appearance: textfield; }
.well-od::-webkit-inner-spin-button, .well-od::-webkit-outer-spin-button { margin: 0; appearance: none; }
.bca-planner-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.bca-planner-heading .field { width: 240px; }
.bca-planner-card { margin-top: 14px; padding: 16px; }
.bca-planner-card h3 { margin-bottom: 10px; }
.bca-sample-table { font-size: 12px; }
.bca-sample-table th, .bca-sample-table td { padding: 7px 8px; }
.bca-sample-table input { min-width: 68px; min-height: 31px; padding: 4px 6px; font-size: 11px; }
.range-badge { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 850; }
.range-badge.range-within { color: var(--lab-accent-strong); background: var(--lab-accent-soft); }
.range-badge.range-above, .range-badge.range-below { color: #8b5b00; background: #fff2c9; }
.cannot-dilute { color: var(--lab-danger); font-weight: 850; }
.bca-fit-note { color: var(--lab-muted); font-size: 13px; }
.status.danger { color: var(--lab-danger); background: var(--lab-danger-soft); }
.qpcr-settings-grid { display: grid; grid-template-columns: repeat(3, minmax(150px, 1fr)); gap: 12px; }
.qpcr-config-block { margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--lab-border); }
.qpcr-config-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.qpcr-config-heading h3 { margin: 0; font-size: 16px; }
.qpcr-config-heading .secondary-button { min-height: 34px; }
.qpcr-gene-list { display: grid; gap: 8px; }
.qpcr-gene-row { display: grid; grid-template-columns: minmax(180px, 1fr) 145px 42px; gap: 10px; align-items: end; padding: 10px; background: var(--lab-surface-soft); border-radius: 10px; }
.qpcr-gene-row input { min-height: 36px; }
.qpcr-radio-label { display: flex; align-items: center; gap: 7px; min-height: 38px; color: var(--lab-text); font-size: 12px; font-weight: 800; white-space: nowrap; }
.qpcr-radio-label input { width: 16px; min-height: 16px; margin: 0; accent-color: var(--lab-accent); }
.qpcr-group-row { grid-template-columns: minmax(210px, 1fr) 120px 130px 42px; }
.qpcr-group-row .qpcr-radio-label { align-self: end; }
.qpcr-design-actions { display: flex; align-items: end; gap: 8px; margin-bottom: 10px; }
.qpcr-selection-mode { width: min(260px, 100%); margin-left: auto; }
.qpcr-selection-mode select { min-height: 36px; }
.qpcr-assignment-panel { display: grid; grid-template-columns: repeat(3, minmax(150px, 1fr)); gap: 9px; padding: 11px; background: var(--lab-surface-tint); border: 1px solid var(--lab-border); border-radius: 11px; }
.qpcr-assignment-panel select { min-height: 36px; }
.qpcr-assignment-panel select[multiple] { min-height: 104px; padding: 4px; }
.qpcr-assignment-panel select[multiple] option { padding: 5px 7px; border-radius: 5px; }
.qpcr-assign-buttons { display: flex; flex-wrap: wrap; grid-column: 1 / -1; gap: 7px; }
.qpcr-assign-buttons button { min-height: 34px; }
.qpcr-plate-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 7px; }
.qpcr-plate-tab { min-height: 32px; padding: 4px 12px; color: var(--lab-muted); background: #fff; border: 1px solid var(--lab-border-strong); border-radius: 999px; font-size: 11px; font-weight: 850; }
.qpcr-plate-tab.active { color: #fff; background: var(--lab-accent-strong); border-color: var(--lab-accent-strong); }
.qpcr-selection-status { margin-bottom: 7px; color: var(--lab-muted); font-size: 11px; font-weight: 750; }
.qpcr-plate-wrap { max-width: 100%; overflow: hidden; }
.qpcr-plate-grid { display: grid; grid-template-columns: 20px repeat(12, minmax(0, 1fr)); gap: 3px; width: 100%; min-width: 0; user-select: none; touch-action: none; }
.qpcr-plate-corner, .qpcr-plate-label { display: grid; place-items: center; min-height: 19px; color: var(--lab-muted); font-size: 9px; font-weight: 850; }
.qpcr-design-well { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "id sample" "gene gene"; gap: 1px 3px; min-width: 0; min-height: 44px; padding: 3px 4px; overflow: hidden; background: #fff; border: 1px solid var(--lab-border-strong); border-radius: 6px; cursor: crosshair; }
.qpcr-design-well.assigned { border-left: 3px solid var(--group-color); background: color-mix(in srgb, var(--group-color) 8%, white); }
.qpcr-design-well.partial { border-style: dashed; background: #fff8e8; }
.qpcr-design-well.selected { outline: 2px solid var(--lab-accent-strong); outline-offset: -1px; box-shadow: 0 0 0 2px rgba(47,143,123,.16); }
.qpcr-well-id { grid-area: id; color: var(--lab-muted); font-size: 8px; font-weight: 900; }
.qpcr-well-sample { grid-area: sample; min-width: 0; overflow: hidden; font-size: 8px; font-weight: 800; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.qpcr-well-gene { grid-area: gene; min-width: 0; overflow: hidden; color: var(--lab-accent-strong); font-size: 8px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.qpcr-ct-panels { display: grid; gap: 14px; }
.qpcr-ct-card { padding: 13px; background: var(--lab-surface-tint); border: 1px solid var(--lab-border); border-radius: 12px; }
.qpcr-ct-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.qpcr-ct-heading h3 { margin: 0; font-size: 15px; }
.qpcr-ct-entry { display: grid; grid-template-columns: minmax(220px, .35fr) auto; gap: 9px; align-items: end; margin-bottom: 10px; }
.qpcr-ct-text { min-height: 138px; resize: vertical; font-family: "Cascadia Code", Consolas, monospace; font-size: 11px; line-height: 1.35; }
.qpcr-heatmap { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 3px; }
.qpcr-heat-well { position: relative; display: grid; align-content: center; gap: 1px; min-width: 0; min-height: 51px; padding: 13px 3px 3px; overflow: hidden; color: var(--lab-text); border: 1px solid var(--lab-border-strong); border-radius: 6px; text-align: center; }
.qpcr-heat-well.assigned { border-color: rgba(47,143,123,.48); }
.qpcr-heat-well span { position: absolute; top: 3px; left: 4px; color: var(--lab-muted); font-size: 8px; font-weight: 850; }
.qpcr-heat-well strong { font-size: 10px; }
.qpcr-heat-well small { overflow: hidden; font-size: 7px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.qpcr-heat-well.excluded { opacity: .42; border-color: var(--lab-danger); }
.qpcr-heat-well.excluded::after { content: "×"; position: absolute; inset: 50% auto auto 50%; color: var(--lab-danger); font-size: 25px; font-weight: 900; line-height: 1; transform: translate(-50%, -50%); }
.qpcr-chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 14px; }
.qpcr-chart-card canvas { display: block; width: 100%; min-height: 330px; }
.qpcr-result-card { margin-top: 14px; padding: 16px; }
.qpcr-result-card h3 { margin-bottom: 10px; }
.qpcr-qc-warning td { background: #fff8e5; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 1080px) {
  .result-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .lab-tools-shell { width: min(100% - 24px, 1280px); padding-top: 20px; }
  .page-header, .results-heading { align-items: flex-start; flex-direction: column; }
  .protein-grid { grid-template-columns: 1fr; }
  .paste-grid { grid-template-columns: 1fr; }
  #batch-paste-inputs { grid-template-columns: 1fr; }
  .calculator-section { grid-template-columns: 1fr; padding: 18px; }
  .group-row { grid-template-columns: 1fr 110px 42px; }
  .group-row .group-name-field { grid-column: 1 / -1; }
  .result-actions { width: 100%; }
  .result-actions button { flex: 1; }
  .bca-setup-grid, .bca-import-row { grid-template-columns: 1fr; }
  .bca-import-actions { width: 100%; }
  .bca-import-actions button { flex: 1; }
  .bca-planner-heading { align-items: stretch; flex-direction: column; }
  .bca-planner-heading .field { width: 100%; }
  .qpcr-settings-grid, .qpcr-assignment-panel, .qpcr-ct-entry { grid-template-columns: 1fr; }
  .qpcr-design-actions { align-items: stretch; flex-wrap: wrap; }
  .qpcr-selection-mode { width: 100%; margin-left: 0; }
  .qpcr-gene-row { grid-template-columns: 1fr 130px 42px; }
  .qpcr-group-row { grid-template-columns: 1fr 100px 120px 42px; }
  .qpcr-group-row .group-name-field { grid-column: 1 / -1; }
  .qpcr-chart-grid { grid-template-columns: 1fr; }
}
