/* labmate.tools — 2.5 qPCR Relative Quantification */
body.qp-empty .qp-needs { display: none !important; }

/* shared bits (same look as the Doubling Time worksheet) */
.dt-opt { display: flex; flex-direction: column; gap: 0; }
.dt-opt .lm-seg button { min-height: 40px; font-size: 12px; }
.dt-count { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; color: var(--muted); margin-left: 6px; }
.dt-ok { font-family: var(--mono); color: var(--pass-dark); font-weight: 600; }
.pp-flag.is-info { color: var(--teal); background: #E3ECE6; }
.c-x { width: 32px; height: 32px; border: none; background: transparent; font-size: 20px; line-height: 1; color: var(--muted); cursor: pointer; }
.c-x:hover { color: var(--err); }
.dt-actions { margin-top: 18px; }
.dt-actions button:disabled { opacity: .45; cursor: default; }
.dt-work { margin: 16px 0 0; border: 1.5px solid var(--ink); background: #fff; }
.dt-work:empty { display: none; }
.dt-work-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 8px 12px; background: var(--card); border-bottom: 1px solid var(--ink); }
.dt-work-h span:first-child { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--muted); }
.dt-work-h b { font-family: var(--serif); font-size: 18px; font-weight: 600; }
.dt-work-note { font-size: 13px; color: var(--muted); }
.dt-dl { display: grid; grid-template-columns: 170px minmax(0, 1fr); margin: 0; padding: 8px 12px 4px; }
.dt-dl dt { font-family: var(--serif); font-style: italic; color: var(--ink-2); padding: 5px 0; border-bottom: 1px dotted var(--dot); }
.dt-dl dd { margin: 0; padding: 5px 0; font-family: var(--mono); font-size: 14px; border-bottom: 1px dotted var(--dot); overflow-wrap: anywhere; }
.dt-dl dd b { color: var(--pass-dark); }
.dt-dl dt:last-of-type, .dt-dl dd:last-of-type { border-bottom: none; }
.dt-work-flags { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; }
.dt-work-flags:empty { display: none; }
.dt-work-flags li { border-left: 4px solid var(--warn); background: var(--warn-bg); padding: 6px 10px; font-size: 14px; }
.dt-work-flags li.info { border-left-color: var(--teal); background: #E3ECE6; }
.dt-work-flags b { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; margin-right: 6px; }
.dt-work-say { margin: 0; padding: 6px 12px 10px; font-size: 13px; color: var(--muted); }

/* 1 · load */
.qp-load { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 16px; align-items: stretch; }
.qp-drop { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 6px; min-height: 130px; padding: 18px; border: 2px dashed var(--ink); background: #fff; cursor: pointer; text-align: center; }
.qp-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.qp-drop:focus-within { outline: 3px solid var(--pass); outline-offset: 2px; }
.qp-drop.is-over { background: #E3F1E8; border-color: var(--pass-dark); }
.qp-drop b { font-family: var(--mono); font-size: 14px; letter-spacing: .08em; }
.qp-drop span { font-size: 14px; color: var(--muted); }
.qp-drop .qp-inst-list { font-family: var(--mono); font-size: 11px; letter-spacing: .03em; }
.qp-load-side { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.qp-load-side .cs-hint { margin: 0; }
.qp-paste { margin-top: 16px; margin-bottom: 0; }
.qp-paste-body { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; padding: 0 12px 14px; align-items: start; }
.qp-paste-body textarea { width: 100%; font-family: var(--mono); font-size: 13px; border: 1.5px solid var(--ink); padding: 8px; background: #fff; }
.qp-paste-body .cs-hint { margin: 0 0 10px; }
.qp-msg { display: flex; flex-direction: column; gap: 4px; margin: 12px 0 0; font-family: var(--mono); font-size: 12px; letter-spacing: .03em; color: var(--pass-dark); }
.qp-msg:empty { display: none; }
.qp-msg .bad { color: var(--err); }
.qp-file { margin-top: 12px; border: 1.5px solid var(--ink); background: #fff; }
.qp-file-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 6px 4px 6px 12px; background: var(--card); border-bottom: 1px solid var(--ink); }
.qp-file-h b { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.qp-inst { font-size: 13px; color: var(--teal); flex: 1; }
.qp-file-s { padding: 6px 12px; font-size: 14px; color: var(--muted); }
.qp-map { padding: 0 12px 8px; }
.qp-map summary { cursor: pointer; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--muted); padding: 4px 0; }
.qp-map-g { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 12px; }
.qp-map-g label { display: flex; flex-direction: column; font-size: 13px; }
.qp-map-g span { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; color: var(--muted); }
.qp-map-g select, .qp-targets select, .qp-opts select { min-height: 36px; border: 1.5px solid var(--ink); background: #fff; padding: 0 6px; max-width: 100%; }
.qp-ft { display: block; padding: 4px 12px 10px; font-size: 14px; }
.qp-ft input { max-width: 180px; }

/* 2 · design */
.qp-two { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 20px; align-items: start; }
.qp-scroll { max-height: 420px; overflow: auto; }
.qp-samples td.nm { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.qp-samples .u { width: 54px; text-align: center; }
.qp-samples input[type="checkbox"], .qp-check input { width: 18px; height: 18px; accent-color: var(--teal); }
.qp-samples tr.is-off td { color: var(--faint); }
.qp-samples tr.is-off input[type="text"] { opacity: .5; }
.qp-targets td.nm { font-weight: 600; white-space: nowrap; }
.qp-targets td.n { font-size: 12px; white-space: normal; }
.qp-targets td { padding-top: 4px; padding-bottom: 4px; }
.qp-eff { width: 76px; margin-top: 4px; }
.qp-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.qp-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin-top: 16px; }
.qp-opts label { display: flex; flex-direction: column; font-size: 14px; }
.qp-opts label:nth-child(n+3) { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.qp-opts label:nth-child(n+3) .presets-k { width: 100%; }
.qp-num { width: 70px; }
.pp-in.qp-num, .qp-ft .pp-in, .qp-samples .pp-in, .qp-eff { border: none; border-bottom: 1.5px solid var(--ink); background: transparent; min-height: 34px; padding: 0 4px; width: 100%; }
.qp-num { width: 70px !important; }

/* 3 · check */
.qp-plate-k { font-family: var(--mono); font-size: 12px; margin: 8px 0 4px; color: var(--ink-2); }
.qp-plate { border-collapse: separate; border-spacing: 2px; background: #fff; border: 1.5px solid var(--ink); padding: 4px; }
.qp-plate th { font-family: var(--mono); font-size: 10px; color: var(--muted); font-weight: 500; padding: 0 2px; }
.qp-plate td { padding: 0; }
.qp-plate td.e { width: 44px; height: 30px; background: #F4F2EA; border-radius: 3px; }
.qp-w { position: relative; display: block; width: 44px; height: 30px; padding: 0; border: 1px solid #C9C5B8; border-top: 4px solid; border-radius: 3px; background: #fff; font-family: var(--mono); font-size: 11px; cursor: pointer; }
.qp-w i { position: absolute; top: 0; right: 2px; font-style: normal; font-size: 8px; font-weight: 600; color: var(--muted); }
.qp-w.is-und { color: var(--faint); }
.qp-w.is-ex { background: repeating-linear-gradient(135deg, #fff, #fff 4px, #E8E4D8 4px, #E8E4D8 6px); color: var(--faint); text-decoration: line-through; }
.qp-w.is-flag { outline: 2px solid var(--err); outline-offset: -1px; }
.qp-w:hover { background: #F6F3E8; }
.qp-plate.is-384 .qp-w, .qp-plate.is-384 td.e { width: 18px; height: 16px; border-top-width: 3px; }
.qp-plate.is-384 .qp-w i { font-size: 7px; }
.qp-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 18px; font-size: 13px; color: var(--muted); }
.qp-legend b { font-family: var(--mono); font-size: 11px; }
.qp-lg-ex::before, .qp-lg-fl::before { content: ""; display: inline-block; width: 14px; height: 11px; margin-right: 5px; vertical-align: -1px; border: 1px solid #C9C5B8; }
.qp-lg-ex::before { background: repeating-linear-gradient(135deg, #fff, #fff 3px, #DDD8CA 3px, #DDD8CA 5px); }
.qp-lg-fl::before { outline: 2px solid var(--err); outline-offset: -1px; }
.qp-rep-h { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 16px; }
.qp-check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.qp-reps td.nm { white-space: nowrap; font-size: 14px; }
.qp-reps tr.is-warn td { background: #FDF8EC; }
.qp-chips { white-space: normal; }
.qp-chip { min-height: 30px; margin: 2px 4px 2px 0; padding: 0 7px; border: 1px solid var(--ink); background: #fff; font-family: var(--mono); font-size: 13px; cursor: pointer; }
.qp-chip:hover { background: #F6F3E8; }
.qp-chip.is-ex { text-decoration: line-through; color: var(--faint); border-style: dashed; background: #F4F2EA; }
.qp-chip.is-und { color: var(--faint); }
.qp-chip.is-flag { border: 2px solid var(--err); color: var(--err); font-weight: 600; }
.qp-chip:disabled { cursor: default; }
.qp-sug { font-size: 12px; color: var(--err); white-space: nowrap; }
.qp-reps .ck { white-space: normal; min-width: 110px; }
.qp-reps .ck .pp-flag { margin: 1px 0; }
.qp-none { color: var(--muted); font-size: 14px; }
.qp-qc3 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; margin-top: 20px; align-items: start; }
.qp-gap { margin-top: 16px; }
.qp-curve { border: 1.5px solid var(--ink); background: #fff; margin-bottom: 10px; }
.qp-curve-h { padding: 6px 10px; font-size: 13px; border-bottom: 1px dotted var(--dot); }
.qp-curve-f { padding: 4px 10px 8px; }
.qp-cv { display: block; width: 100%; height: auto; max-width: 420px; }
.qp-cv text { font-family: var(--mono); font-size: 10px; fill: var(--muted); }
.qp-cv .g { stroke: #E2DED2; }
.qp-cv .fit { stroke: var(--pass-dark); stroke-width: 1.6; }
.qp-cv .pt { fill: #fff; stroke: var(--ink); stroke-width: 1.3; }
.qp-small { font-size: 14px; }
.qp-small td { height: 36px; }

/* 4 · results */
.qp-warn { margin-bottom: 14px; }
.qp-chart-opts { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 24px; margin-bottom: 12px; }
.qp-chart { border: 1.5px solid var(--ink); background: #fff; padding: 10px; margin-bottom: 16px; overflow-x: auto; }
.qp-chart svg { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.qp-chart .qp-wait { margin: 20px 8px; color: var(--muted); }
body.qp-empty .qp-chart { border-style: dashed; }
.qp-res td.nm { white-space: nowrap; }
.qp-res td.nm small { font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.qp-res td b { font-size: 16px; color: var(--pass-dark); }
.qp-res tr.is-ctl td { background: #F6F3E8; }
.qp-res tr.is-err td, .qp-pert tr.is-err td { color: var(--muted); font-size: 14px; }
.qp-per { margin-top: 18px; }
.qp-per summary { cursor: pointer; padding: 6px 0; }
.qp-pert tbody tr[data-i] { cursor: pointer; }
.qp-pert tbody tr[data-i]:hover td { background: #F6F3E8; }
.qp-pert tbody tr.is-sel td { background: rgba(156, 199, 182, 0.22); }
.qp-pert tbody tr.is-sel td:first-child { box-shadow: inset 4px 0 0 var(--teal); }
.qp-wt { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 13px; }
.qp-wt th { text-align: left; font-size: 10px; letter-spacing: .06em; color: var(--muted); padding: 6px 10px; border-bottom: 1px solid var(--ink); white-space: nowrap; }
.qp-wt td { padding: 5px 10px; border-bottom: 1px dotted var(--dot); white-space: nowrap; }
.qp-wt tr.goi td { background: #F3F8F5; }
.qp-wt b { color: var(--pass-dark); }
.qp-methods { margin-top: 18px; padding: 10px 12px; border: 1.5px solid var(--ink); background: #fff; }
.qp-methods p { margin: 6px 0 0; font-family: var(--serif); font-size: 15px; line-height: 1.55; }
.qp-methods p:empty::before { content: "Mark at least one target and one reference gene."; color: var(--muted); font-family: var(--sans); font-size: 14px; }

@media (max-width: 860px) {
  .qp-two, .qp-qc3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .qp-load, .qp-paste-body { grid-template-columns: minmax(0, 1fr); }
  .dt-dl { grid-template-columns: minmax(0, 1fr); }
  .dt-dl dt { border-bottom: none; padding-bottom: 0; font-size: 14px; }
  .qp-opts { grid-template-columns: minmax(0, 1fr); }
  .qp-w, .qp-plate td.e { width: 30px; height: 26px; font-size: 9px; }
  .qp-reps { min-width: 0; }
  .qp-reps thead { display: none; }
  .qp-reps, .qp-reps tbody { display: block; }
  .qp-reps tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 70px 64px; gap: 2px 8px; padding: 8px 6px; border-bottom: 1px dotted var(--dot); }
  .qp-reps td { display: block; height: auto; border: none; padding: 0 !important; text-align: left !important; }
  .qp-reps td[data-l]::before { content: attr(data-l); display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .08em; color: var(--muted); }
  .qp-reps td.qp-chips, .qp-reps td.ck { grid-column: 1 / -1; }
  .qp-reps td.qp-chips { order: 5; }
  .qp-reps td.ck { order: 6; }
  .qp-res td, .qp-pert td, .qp-res th { white-space: nowrap; }
  .qp-targets { min-width: 520px; }
}

@media print {
  .lm-top, .lm-head, .lm-about, .lm-ref, .lm-more, .lm-foot, .qp-noprint, .qp-chart-opts, .dt-actions, .qp-per, .dt-work { display: none !important; }
  .lm-page { padding: 0 !important; max-width: none !important; }
  .lm-sheet { border: none; padding: 8px 0 0; background: none; }
  .qp-chart { border: none; padding: 0; }
  .qp-chart svg { max-height: 120mm; }
  .qp-res { font-size: 11px; }
  .qp-res td { height: auto; padding: 3px 6px; }
}
