/* AusSci · How does every cell get what it needs? (Year 8): the level strip, the simulations' drawings and controls,
   the yo-yo chains and the comparison table. Drawings are on a light plate with fixed colours in light and dark mode
   alike. Blood is drawn bright red where it carries more oxygen and darker red where it carries less, and every
   vessel and bar has a label, so colour is never the only key. */

/* ---------- drawings ---------- */
.dia { display: block; width: 100%; height: auto; font-family: 'Atkinson Next', system-ui, sans-serif; touch-action: manipulation; }
.plate { background: #fbfbf6; border: 1px solid #d8ded9; border-radius: 4px; color: #15231d; }
.dia text { fill: #15231d; pointer-events: none; }
.d-small { font-size: 11.5px; fill: #34423c; }
.dia text.d-lab, .dia text.d-lab-s, .dia text.d-lab-b { paint-order: stroke; stroke: #fbfbf6; stroke-width: 3.4px; stroke-linejoin: round; }
.dia text.d-lab { font-size: 13px; font-weight: 700; }
.dia text.d-lab-s { font-size: 11.5px; font-weight: 700; fill: #2c3a34; }
.dia text.d-lab-b { font-size: 13.5px; font-weight: 800; }
.dia text.d-snd { font-size: 22px; font-weight: 800; fill: #9c1419; paint-order: stroke; stroke: #fbfbf6; stroke-width: 4px; stroke-linejoin: round; }
.art { position: relative; width: 100%; }
.art-cv { display: block; width: 100%; height: auto; border-radius: 4px; background: #fbfbf6; }
.art .art-svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; max-width: none; overflow: visible; }

/* ---------- controls ---------- */
.ctl .label { margin-bottom: 0.3rem; }
.ctl-range label { display: block; font-size: 0.889rem; font-weight: 700; margin-bottom: 0.2rem; }
.ctl-range output { font-weight: 800; color: var(--y-deep); margin-left: 0.25rem; }
.ctl-range input[type="range"] { width: 100%; max-width: 36rem; accent-color: var(--accent); min-height: 2rem; }
.ctl-range input[type="range"]:disabled { opacity: 0.4; cursor: not-allowed; }
.lab-run { display: flex; flex-wrap: wrap; gap: 0.5rem 0.8rem; align-items: center; }
.tr-opts { display: flex; flex-wrap: wrap; gap: 0.3rem 1.1rem; align-items: flex-end; }
.tr-opt { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.889rem; font-weight: 700; cursor: pointer; min-height: 2.2rem; }
.tr-opt input { width: 1.15rem; height: 1.15rem; accent-color: var(--accent); }
.seg { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.seg .btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.seg .btn:disabled { opacity: 0.45; cursor: not-allowed; }
.ctl-row { display: flex; flex-wrap: wrap; gap: 0.8rem 1.6rem; }
.ctl-row .ctl-range { flex: 1 1 14rem; }

/* ---------- the level strip: organism to cell, the levels this simulation can't show turned off ---------- */
.lv-strip { border-bottom: 1px solid var(--rule); padding-bottom: 0.7rem; }
.lv-seg { align-items: center; gap: 0.25rem; }
.lv-sep { color: var(--ink-3); font-weight: 800; padding: 0 0.05rem; }
.lv-btn.lv-off { opacity: 0.4; border-style: dashed; }

/* ---------- a simulation: the drawing, with its readings ---------- */
.tr-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: start; }
.tr-main { max-width: 48rem; }
.tr-box { padding: 0.25rem; }
.tr-read { margin: 0.45rem 0 0; font-size: 0.889rem; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tr-status { min-height: 2.6em; }
.tr-todo { margin: 0; color: var(--ink-3); }

/* ---------- the yo-yo chain ---------- */
.yy-q { margin: 0; font-weight: 800; font-size: 1.056rem; max-width: 46rem; }
.yy-q .label { display: block; margin-bottom: 0.2rem; }
.yy-how { margin: 0.3rem 0 0; }
.yy-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 11rem; gap: 1rem 1.4rem; align-items: start; margin-top: 0.8rem; }
.yy-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.8rem; }
.yy-step { border-left: 0.25rem solid var(--y-stripe); padding: 0.1rem 0 0.2rem 0.8rem; }
.yy-step.is-done { border-left-color: var(--rule); }
.yy-lv { margin: 0 0 0.2rem; font-size: 0.778rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--y-deep); }
.yy-ask { margin: 0 0 0.45rem; font-weight: 700; }
.yy-ask:focus { outline: none; }
.yy-step.is-done .yy-ask { color: var(--ink-2); font-weight: 600; }
.yy-step .fb { margin-top: 0.4rem; }
.yy-side { position: sticky; top: 4.5rem; display: grid; gap: 0.4rem; }
.yy-ladder { padding: 0.3rem; }
.yy-svg .yy-rail { stroke: #8a978f; stroke-width: 2.4; }
.yy-svg .yy-rung { stroke: #c4ccc7; stroke-width: 3; }
.yy-svg .yy-rung.is-used { stroke: #4f5d56; }
.yy-svg text.yy-rl { font-size: 12.5px; fill: #6b7a73; font-weight: 600; }
.yy-svg text.yy-rl.is-used { fill: #15231d; font-weight: 800; }
.yy-svg text.yy-rl.is-done { fill: #1d6b45; }
.yy-svg .yy-string { stroke: #15231d; stroke-width: 1.4; }
.yy-svg .yy-axle { stroke: #9c1419; stroke-width: 2; }
.yy-where { margin: 0; }
.yy-done { margin-top: 1rem; border-top: 1px solid var(--rule); padding-top: 0.8rem; max-width: 46rem; }
.yy-recap { margin: 0.3rem 0 0; padding-left: 1.3rem; display: grid; gap: 0.25rem; }

/* ---------- the comparison table on screen 6 ---------- */
.mt-how { margin: 0; font-weight: 700; max-width: 46rem; }
.table-wrap { overflow-x: auto; max-width: 46rem; }
.data-table { border-collapse: collapse; width: 100%; font-size: 0.889rem; }
.data-table th, .data-table td { text-align: left; padding: 0.45rem 0.55rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.data-table thead th { font-size: 0.778rem; color: var(--ink-3); }
.mt-table th[scope="row"] { font-weight: 700; width: 42%; }
.mt-table select { width: 100%; min-height: 2.4rem; font: inherit; font-weight: 700; }
.mt-fb { margin: 0.4rem 0 0; }
.rk-run { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.rk-now { margin: 0; font-weight: 700; font-size: 0.944rem; }

/* ---------- phones ---------- */
@media (max-width: 640px) {
  .yy-wrap { grid-template-columns: minmax(0, 1fr); }
  .yy-side { position: static; order: -1; grid-template-columns: 8.5rem minmax(0, 1fr); align-items: center; }
  .lv-sep { display: none; }
  .mt-table th[scope="row"] { width: auto; }
}
