/* 与临时装片实验保持同一双工作区；右栏内容不参与桌面行高计算。 */
@scope (.daphnia-host, .blood-smear-host) {
  :scope { --gold: #a1cbb9; --dh-eye-size: 270px; }
  .layout.dh-practical {
    --operations-width: 360px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--operations-width);
    height: clamp(640px, calc(100dvh - 160px), 940px);
    min-height: 0;
    overflow: hidden;
  }
  .dh-practical .center { height: 100%; min-height: 0; min-width: 0; overflow: hidden; }
  .dh-practical .right { height: 100%; min-height: 0; min-width: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 18px; }
  .dh-practical h3 { margin: 14px 0 8px; font-size: 15px; }
  .dh-practical p, .dh-practical li { font-size: 13px; line-height: 1.75; }
  .dh-practical button { min-height: 34px; }
  .dh-practical .wide { margin: 8px 0; padding: 11px 8px; font-size: 13px; }
  .dh-practical #perform, #start-count:not(:disabled), #beat:not(:disabled), #save-count { background: #224b40; border-color: #93c8b177; color: #e8f7ef; }
  .dh-group-line { display: flex; justify-content: space-between; gap: 10px; align-items: center; min-height: 48px; border-top: 1px solid #ffffff20; font-size: 12px; }
  .dh-group-line strong { font-weight: 500; color: #c6e3d7; }
  .dh-practical .section-title { align-items: center; font-size: 13px; }
  .dh-practical .section-title small { display: block; font-size: 10px; color: #8caba0; margin-top: 3px; }
  .dh-practical .mag { font-size: 26px; }
  .dh-eye-area { position: relative; padding: 30px 0 8px; }
  .dh-practical .dh-eye-area .ocular-wrap { width: min(var(--dh-eye-size), 100%); height: auto; aspect-ratio: 1; margin: 0 auto; }
  .dh-eye-area canvas { width: 100%; height: 100%; display: block; touch-action: none; border-radius: 50%; }
  #heart-leader { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
  #heart-leader polyline { fill: none; stroke: #fff; stroke-width: 1; opacity: .8; }
  #heart-leader circle { fill: #fff; }
  #heart-label { position: absolute; right: 0; top: 3px; width: 88px; font-size: 12px; color: #ecf7f1; text-shadow: 0 1px 3px #000; }
  :scope.dh-eye-expanded { --dh-eye-size: 310px; }
  .dh-practical .action-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 8px 0; }
  .dh-practical .action-row button:only-child { grid-column: 2; }
  .dh-practical .action-row button { padding: 9px 4px; font-size: 12px; }
  .dh-count { border-block: 1px solid #ffffff18; margin: 12px 0 18px; padding: 14px 0; }
  .dh-readouts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .dh-readouts > div { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 20px 44px 20px; min-width: 0; }
  .dh-readouts small, .dh-readouts span { font-size: 11px; color: #a8bcb3; }
  .dh-readouts strong { font-size: 29px; color: #dbf1e5; line-height: 44px; font-weight: 500; overflow: auto; white-space: nowrap; }
  .dh-select { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 8px; align-items: center; margin: 12px 0; font-size: 12px; }
  .dh-select select, .dh-select input { width: 100%; min-width: 0; color: #e1ebe6; border: 1px solid #ffffff24; background: #1b282a; border-radius: 6px; padding: 8px 6px; }
  #save-panel { border-top: 1px solid #ffffff20; margin-top: 12px; padding-top: 8px; }
  #record-mode { min-height: 24px; color: #b8d9c7; }
  .dh-next { border-top: 1px solid #ffffff20; margin-top: 18px; padding-top: 8px; }
  .solutions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .solutions button { font-size: 12px; padding: 10px 5px; }
  .dh-table { max-width: 100%; overflow-x: auto; }
  .dh-table table { table-layout: fixed; width: 100%; border-collapse: collapse; font-size: 12px; }
  .dh-table th, .dh-table td { padding: 9px 2px; border-bottom: 1px solid #ffffff1a; text-align: center; height: 39px; font-weight: 400; }
  .dh-table th:first-child { width: 28%; text-align: left; }
  .dh-table th:last-child { width: 24%; }
  #record-list { padding-left: 20px; }
  #record-list li { margin: 10px 0; color: #b6c7bf; }
  #conclusion p { margin: 12px 0; }
  .dh-readouts, .dh-table, #operation-status, #sample-number, .ms-tool-label { font-variant-numeric: tabular-nums; }
  .dh-practical .ms-tool-label { min-height: 42px; line-height: 1.5; }
  .error-banner { position: absolute; bottom: 130px; left: 22px; right: 22px; color: #dfc69b; pointer-events: none; }
  [hidden] { display: none !important; }
  @media (max-width: 1000px) {
    .layout.dh-practical { --operations-width: 310px; }
    .dh-practical .right { padding: 14px; }
  }
  @media (max-width: 580px) {
    .layout.dh-practical { display: flex; height: auto; overflow: visible; flex-direction: column; }
    .dh-practical .center { height: 540px; min-height: 540px; flex: none; }
    .dh-practical .right { height: 68dvh; max-height: 68dvh; flex: none; overflow-y: auto; }
  }
}
