/* ---------- section frame: a ruled heading with its summary beside it ---------- */
.sec { padding-block: clamp(44px, 6vw, 80px); }
.sec .sec-head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 10px clamp(24px, 4vw, 56px); align-items: start; border-top: 2px solid var(--ink); padding-top: 20px; margin-bottom: clamp(24px, 3.4vw, 40px); }
.sec .sec-head > div { display: contents; }
.sec .sec-head h2 { grid-column: 1; }
.sec .sec-sum { grid-column: 2; font-size: 1.08rem; line-height: 1.6; color: var(--ink-2); max-width: 64ch; }
.sec .sec-head.split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.sec .sec-head > a, .sec .sec-head > .row { grid-column: 2; justify-self: start; }
@media (max-width: 860px) {
  .sec .sec-head, .sec .sec-head.split { grid-template-columns: minmax(0, 1fr); }
  .sec .sec-head h2, .sec .sec-sum, .sec .sec-head > a, .sec .sec-head > .row { grid-column: 1; }
}

/* ---------- unit chart ---------- */
.unit { margin: clamp(28px, 4vw, 48px) 0 0; display: grid; }
.unit-canvas { display: block; width: 100%; height: 300px; }
.unit-notes { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 8px; }
.unit-note { font-size: 0.92rem; line-height: 1.35; color: var(--ink-2); }
.unit-note:last-child { text-align: right; }
.unit-note b { font: 600 1.6rem/1 var(--serif); letter-spacing: -0.01em; color: var(--ink-2); margin-right: 8px; font-variant-numeric: tabular-nums; }
.unit-note.on, .unit-note.on b { color: var(--pine-deep); }
.unit-scale { display: flex; gap: 3px; height: 4px; margin-bottom: 7px; }
.unit-scale i { display: block; background: #aab8b2; flex: 95 1 0; }
.unit-scale i:first-child { background: var(--pine); flex: 5 1 0; }
.unit .caption { margin-top: 12px; }
@media (max-width: 640px) { .unit-notes { flex-direction: column; align-items: flex-start; gap: 6px; } .unit-note:last-child { text-align: left; } }

/* ---------- participant flow ---------- */
.flow { display: grid; gap: 14px; max-width: 860px; position: relative; }
.flow::before { content: ""; position: absolute; left: 30px; top: 12px; bottom: 12px; width: 1.5px; background: var(--ink); }
.flow-row { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 4fr); gap: 0 30px; align-items: center; position: relative; }
.flow-box { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 12px 15px; background: #fff; border: 1.5px solid var(--ink); border-radius: 4px; font-size: 0.94rem; line-height: 1.35; }
.flow-box b { font: 600 0.95rem/1.2 var(--mono); white-space: nowrap; }
.flow-box.start { background: var(--wash); }
.flow-box.end { background: var(--pine); border-color: var(--pine); color: #fff; }
.flow-out { position: relative; display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 10px 14px; border: 1px solid #e0b9b4; background: var(--stop-soft); border-radius: 4px; font-size: 0.88rem; color: #7c2f2a; }
.flow-out::before { content: ""; position: absolute; right: 100%; top: 50%; width: 30px; height: 1.5px; background: var(--stop); }
.flow-out b { font: 600 0.88rem/1.2 var(--mono); white-space: nowrap; }
@media (max-width: 640px) {
  .flow-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .flow-out { margin-left: 48px; }
  .flow-out::before { width: 18px; }
}

/* ---------- lab ---------- */
.lab { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); gap: clamp(22px, 3vw, 40px); align-items: start; }
.lab-legend { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center; font-size: 0.88rem; margin-bottom: 14px; }
.key { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); }
.key::before { content: ""; width: 14px; height: 9px; border-radius: 2px; }
.key.up::before { background: var(--pine); }
.key.down::before { background: #9aa9b5; }
.lab-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.lab-tile { background: #fff; border: 1px solid var(--line-strong); border-radius: 5px; padding: 10px 12px 8px; transition: border-color 0.15s, box-shadow 0.15s; }
.lab-tile.on { border-color: var(--pine); box-shadow: 0 0 0 1px var(--pine); }
.lab-tile-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.8rem; color: var(--sub); }
.lab-tile-top b { font: 600 0.92rem/1 var(--mono); color: var(--ink); }
.hist { display: block; width: 100%; height: auto; margin-block: 4px 2px; }
.lab-dir { font-size: 0.74rem; line-height: 1.3; color: var(--sub); min-height: 1.3em; }
.lab-dir.up { color: var(--pine-deep); }
.lab-dir.up::before { content: "\2191\00a0"; }
.lab-dir.down { color: var(--brass-ink); }
.lab-dir.down::before { content: "\2193\00a0"; }
.flow-out.hold { border-color: #ecdcb4; background: var(--brass-soft); color: var(--brass-ink); }
.flow-out.hold::before { background: var(--brass); }
.hist-up { fill: var(--pine); }
.hist-down { fill: #9aa9b5; }
.hist-axis { stroke: var(--line-strong); stroke-width: 1; }
.lab-slider { display: grid; grid-template-columns: minmax(0, 1fr) 34px; gap: 8px; align-items: center; }
.lab-w { font: 600 0.84rem/1 var(--mono); text-align: right; color: var(--ink); }
.lab-slider input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer; }
.lab-slider input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--line-strong) 0 calc(50% - 1px), var(--ink) calc(50% - 1px) calc(50% + 1px), var(--line-strong) calc(50% + 1px) 100%); }
.lab-slider input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--line-strong); }
.lab-slider input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%; background: #fff; border: 2px solid var(--pine); box-shadow: var(--sh); }
.lab-slider input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid var(--pine); }
.lab-slider input[type="range"]:focus-visible { outline: 2px solid var(--pine-2); outline-offset: 2px; border-radius: 6px; }
.lab-panel { position: sticky; top: 86px; display: grid; gap: 14px; background: #fff; border: 1px solid var(--ink); border-radius: var(--r); padding: clamp(16px, 2vw, 22px); box-shadow: var(--sh-2); }
.lab-formula { padding: 10px 12px; background: var(--wash); border-radius: 4px; font-size: 0.82rem; line-height: 1.55; color: var(--ink); overflow-wrap: anywhere; }
.lab-big { display: grid; gap: 2px; }
.lab-big b { font: 600 clamp(2.6rem, 4.6vw, 3.4rem)/1 var(--serif); letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.lab-big span { font-size: 0.86rem; color: var(--sub); }
.lab-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.lab-facts b { display: block; font: 600 1.15rem/1.1 var(--serif); font-variant-numeric: tabular-nums; }
.lab-facts b.ok { color: var(--pine); }
.lab-facts span { display: block; font-size: 0.76rem; line-height: 1.35; color: var(--sub); margin-top: 3px; }
.lab-verdict { font-size: 0.9rem; color: var(--ink-2); }
.lab-roc { width: 100%; max-width: 280px; }
.lab-under { display: grid; grid-template-columns: minmax(0, 280px) minmax(0, 1fr); gap: clamp(18px, 3vw, 36px); align-items: center; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line-strong); }
.lab-under h4 { font: 600 1rem/1.3 var(--sans); }
.key.line::before { height: 3px; background: var(--pine); }
.key.dash::before { height: 0; width: 18px; border-top: 2px dashed var(--ink-2); background: none; border-radius: 0; }
@media (max-width: 620px) { .lab-under { grid-template-columns: minmax(0, 1fr); } }
.scorebar { display: block; width: 100%; height: auto; }
.sb-track { fill: var(--line-2); }
.sb-fill { fill: #9aa9b5; }
.sb-fill.ok { fill: var(--pine); }
.sb-base { stroke: var(--ink); stroke-width: 1.5; }
.sb-gate { stroke: var(--pine); stroke-width: 1.5; stroke-dasharray: 4 3; }
.sb-mark { fill: var(--brass); }
.lab-marks { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 16px; font-size: 0.8rem; color: var(--sub); }
.mk { display: inline-flex; align-items: center; gap: 6px; }
.mk::before { content: ""; width: 3px; height: 13px; background: var(--ink); border-radius: 1px; }
.mk.need::before { width: 0; background: none; border-left: 3px dashed var(--pine-deep); }
.mk.best::before { width: 9px; height: 9px; border-radius: 50%; background: var(--brass); }
.sb-t { font: 400 11px var(--sans); fill: var(--sub); }
.sb-t.gate { fill: var(--pine); font-weight: 600; }
.roc { display: block; width: 100%; height: auto; }
.roc-grid { stroke: var(--line-2); stroke-width: 1; }
.roc-chance { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 2 4; }
.roc-base { fill: none; stroke: var(--ink-2); stroke-width: 1.5; stroke-dasharray: 5 4; }
.roc-mine { fill: none; stroke: var(--pine); stroke-width: 2.5; stroke-linejoin: round; }
.roc-t { font: 400 10px var(--sans); fill: var(--sub); }
.lab-outcome { display: grid; gap: 12px; justify-items: start; padding: 16px; border-radius: 6px; border: 1px solid var(--line); font-size: 0.95rem; }
.lab-outcome.ok { background: var(--pine-wash); border-color: #cfe5d8; }
.lab-outcome.stop { background: var(--stop-soft); border-color: #eccfcb; }
.lab-outcome.wait { background: var(--wash); }
@media (max-width: 1100px) { .lab { grid-template-columns: minmax(0, 1fr); } .lab-panel { position: static; } }
@media (max-width: 760px) { .lab-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 520px) { .lab-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- identity glyph and method fingerprint ---------- */
.glyph { display: block; flex: none; border-radius: 4px; background: var(--pine-wash); box-shadow: inset 0 0 0 1px #cfe1d7; }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who > div { min-width: 0; }
.fingerprint { display: block; width: 100%; height: 34px; }
.fingerprint rect { fill: var(--ink); }

/* ---------- mini results strip on a challenge card ---------- */
.strip { display: block; width: 100%; height: auto; }
.strip-axis { stroke: var(--line-strong); stroke-width: 1; }
.strip-gate { stroke: var(--pine); stroke-width: 1.5; stroke-dasharray: 3 3; }
.strip-pt { fill: var(--pine); }
.strip-t { font: 400 11px var(--sans); fill: var(--sub); }

/* ---------- definition list for the glossary ---------- */
.terms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; margin: 0; }
.terms > div { padding: 14px 0; border-top: 1px solid var(--line); }
.terms dt { font-weight: 600; color: var(--ink); }
.terms dd { margin: 4px 0 0; font-size: 0.93rem; color: var(--ink-2); }
@media (max-width: 700px) { .terms { grid-template-columns: minmax(0, 1fr); } }
