.th-lab {
  --th-edge:#d2ddcf;
  --th-ink:#214639;
  color:var(--th-ink);
}
.th-top,.th-graph-row {display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:clamp(.9rem,2.9vw,2rem);align-items:start}
.th-apparatus {position:relative;border-radius:14px;overflow:hidden;color:#eef7ee;background:radial-gradient(ellipse at 43% 75%,#214f47 0%,#123b35 58%,#102e2b 100%)}
.th-stage-head {padding:clamp(.9rem,2vw,1.4rem);padding-bottom:0;display:flex;gap:.6rem;align-items:start;justify-content:space-between}
.th-stage-head span:first-child {font-size:.925rem;color:#d5e5de}
.th-stage-head strong {display:block;font:500 clamp(1.55rem,3.7vw,2.7rem)/1.22 Georgia,serif;font-variant-numeric:tabular-nums;margin-top:.2em}
.th-state {font-size:.89rem;text-align:end;color:#d2e8d4;max-width:48%;padding-block-start:.2rem}
.th-vessel {display:block;width:100%;height:auto;max-height:300px}
.th-controls,.th-clock {display:grid;gap:.75rem;min-width:0;align-content:start}
.th-controls h2,.th-chart h3 {margin:0}
.th-field {display:grid;grid-template-columns:minmax(0,1fr) minmax(104px,43%);align-items:center;gap:.35rem .5rem}
.th-field label,.th-clock label {font-weight:600;line-height:1.4}
.th-field select,.th-field-input {width:100%;min-width:0;min-height:42px;border:1px solid #bdccbc;border-radius:8px;color:var(--th-ink);background:#fff}
.th-field select {padding:.35rem .5rem;font:inherit}
.th-field-input {display:flex;flex-direction:row;align-items:center;gap:.3rem;padding-inline:.5rem}
.th-field-input:focus-within {outline:2px solid #237b62;outline-offset:1px}
.th-field-input input {width:100%;min-width:0;border:0;outline:none;background:transparent;color:var(--th-ink);font-size:1rem;font-variant-numeric:tabular-nums;text-align:start;line-height:1.5;padding:.27rem 0}
.th-field-input input[aria-invalid=true] {color:#9d382c}
.th-field-input bdi,.th-field-input span {color:#536d60;font-size:.9rem;white-space:nowrap}
.th-field input[type=range],.th-clock input[type=range] {grid-column:1/-1;width:100%;margin:0;min-height:28px;accent-color:#18735b;touch-action:pan-y}
.th-error {font-size:.925rem;line-height:1.5;color:#983728}
.th-graph-row {margin-top:1.4rem;padding-top:1.2rem;border-top:1px solid var(--th-edge)}
.th-chart {min-width:0}
.th-key,.th-axis {display:flex;flex-wrap:wrap;gap:.35rem 1.1rem;color:#4a6658;font-size:.875rem;align-items:center}
.th-key {margin-block:.45rem}
.th-key span {display:flex;align-items:center;gap:.4rem}
.th-key span::before {content:"";width:20px;height:0;border-top:3px solid #147c67}
.th-key span+span::before {border-top:2px dashed #a47638}
.th-plot {width:100%;height:auto;display:block}
.th-clock {grid-template-columns:1fr minmax(90px,40%);align-items:center}
.th-clock .mi-row,.th-clock small,.th-clock button[data-th=record],.th-clock .mi-note {grid-column:1/-1}
.th-clock .mi-row {gap:.45rem}
.th-clock small {font-size:.875rem;color:#546c5f}
.th-clock button[data-th=record] {justify-self:start}
.th-clock .mi-note {margin:0;font-size:.9rem;min-height:1.4em}
.th-lab button:disabled {opacity:.55;cursor:default}
.th-model {margin-top:1rem;border-top:1px solid var(--th-edge);padding-block-start:.75rem;color:#4a6658;font-size:.93rem}
.th-model summary {cursor:pointer;color:var(--th-ink);font-weight:600}
.th-model p {margin:.4rem 0;line-height:1.65}
.th-model a {color:#17654f;text-underline-offset:.16em}
@media(max-width:720px){
  .th-top,.th-graph-row {grid-template-columns:1fr}
  .th-vessel {max-height:225px}
  .th-stage-head {padding-top:.8rem}
  .th-graph-row {margin-top:1rem}
}

.th-field-input select {flex:0 0 auto;width:auto;max-width:45%;min-width:3.25rem;border:0;border-inline-start:1px solid var(--th-edge);border-radius:0;background:transparent;color:var(--th-ink);font:inherit;padding:.3rem .2rem;cursor:pointer}
.th-input-hint {font-size:.875rem;line-height:1.5;color:#4a6658}
.th-field,.th-clock {grid-template-columns:minmax(0,1fr) minmax(9.5rem,46%)}
@media(max-width:440px){.th-field,.th-clock{grid-template-columns:minmax(0,1fr);gap:.25rem}.th-field+.th-field{margin-block-start:.25rem}.th-field-input select{min-height:44px}}

.th-key .th-comparison-key::before {border-top:3px dashed #694b97}
.th-key [hidden] {display:none}
