/* AusSci · Do living things evolve because they need to? (Year 10): refutation boxes, the statements to agree or
   disagree with, beetles, plates of bacteria, a river, limbs, DNA and a tree, and the explanation builder.
   Diagrams are drawn on a paper-coloured plate with fixed ink colours, in light and dark mode alike.
   The chart on screen 5 is drawn on the page surface and takes its light and dark colours from the --viz variables. */

.section-title { font-size: 1.333rem; font-weight: 800; margin: 0; }
.section > * + * { margin-top: 0.8rem; }
.dia { display: block; width: 100%; height: auto; font-family: 'Atkinson Next', system-ui, sans-serif; }
.plate { background: #fbfbf6; border: 1px solid #d8ded9; border-radius: 4px; color: #15231d; }
.dia text { fill: #15231d; pointer-events: none; }
.d-lab { font-size: 13px; fill: #34423c; }
.d-small { font-size: 11.5px; fill: #34423c; }
.d-strong { font-weight: 800; }
.halo { paint-order: stroke; stroke: #fbfbf6; stroke-width: 3.5px; stroke-linejoin: round; }
.ctl .label { margin-bottom: 0.3rem; }
.ctl-row { display: flex; flex-wrap: wrap; gap: 0.7rem 1.4rem; align-items: flex-end; }
.stage { max-width: 34rem; }
.stage-wide { max-width: 40rem; }
.tbl-scroll { overflow-x: auto; }
.lab-run { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.model-note { max-width: 40rem; }

/* ---------- refutation boxes: the common idea, why it is wrong, what scientists have found ---------- */
.refute { max-width: 44rem; border: 1px solid var(--rule); border-radius: 4px; background: var(--box); overflow: hidden; box-shadow: var(--shadow); }
.rf { padding: 0.8rem 1rem 0.85rem; border-left: 0.35rem solid var(--ink-3); }
.rf + .rf { border-top: 1px solid var(--rule); }
.rf p { margin: 0; }
.rf p + p { margin-top: 0.4rem; }
.rf .label { margin-bottom: 0.3rem; }
.rf-idea { background: var(--bad-bg); border-left-color: var(--bad); }
.rf-idea .label { color: var(--bad); }
.rf-text { font-size: 1.111rem; font-weight: 800; line-height: 1.35; }
.rf-you { font-size: 0.889rem; color: var(--ink-2); }
.rf-you:empty { display: none; }
.rf-yes { background: var(--ok-bg); border-left-color: var(--ok); }
.rf-yes .label { color: var(--ok); }
.rf-src { margin: 0; padding: 0.5rem 1rem 0.6rem; font-size: 0.833rem; color: var(--ink-3); border-top: 1px solid var(--rule); }

/* ---------- the eight statements ---------- */
.guide { display: grid; gap: 0.55rem; max-width: 44rem; }
.gi { border: 1px solid var(--rule); border-left: 0.35rem solid var(--y-stripe); border-radius: 3px; padding: 0.55rem 0.9rem 0.65rem; margin: 0; background: var(--box); }
.gi legend { font-weight: 700; padding: 0 0.3rem; }
.gi-row { display: flex; flex-wrap: wrap; gap: 0.2rem 1.2rem; align-items: center; }
.gi label { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 2.1rem; }
.gi input { width: 1.15rem; height: 1.15rem; accent-color: var(--accent); }
.gi-then { margin: 0.25rem 0 0.15rem; font-size: 0.889rem; color: var(--ink-2); }
.gi .fb { margin-top: 0.45rem; }
.gi .fb.is-info { background: var(--soft); color: var(--ink); border-left: 0.25rem solid var(--ink-3); }
.guide-count { margin: 0; font-weight: 700; color: var(--ink-2); }
.guide-count.done { color: var(--ok); }

/* ---------- beetles and ground ---------- */
.g-burnt { fill: #4a4038; }
.g-sand { fill: #e6d6ab; }
.g-soil { fill: #57483b; }
.speck-b1 { fill: #5e544b; } .speck-b2 { fill: #3a322b; } .ash { fill: #8a8178; }
.twig { stroke: #2c2621; stroke-width: 2; stroke-linecap: round; fill: none; }
.speck-s1 { fill: #d6c393; } .speck-s2 { fill: #f2e7c8; } .pebble { fill: #cdb98a; stroke: #b49f6c; stroke-width: 1; }
.bt-body.pale { fill: #ece0bb; stroke: #7a6842; }
.bt-body.dark { fill: #2e2925; stroke: #14110f; }
.bt-body { stroke-width: 1.2; }
.bt-line { stroke-width: 1; fill: none; }
.bt-line.pale { stroke: #7a6842; } .bt-line.dark { stroke: #4a423b; }
.bt-leg { stroke-width: 1.4; stroke-linecap: round; fill: none; }
.bt-leg.pale { stroke: #4d3f26; } .bt-leg.dark { stroke: #14110f; }
.bt-head.pale { fill: #4d3f26; } .bt-head.dark { fill: #14110f; }
.bt-mud { fill: #6b5236; opacity: 0.92; }
.bt-stump { stroke: #4d3f26; stroke-width: 1.4; stroke-linecap: round; }
.bt-hit { fill: transparent; cursor: pointer; }
.bt-gone { opacity: 0; transition: opacity 0.35s; }
.caught-mark { fill: none; stroke: #f5d76e; stroke-width: 2; }
.unit { stroke-width: 1; }
.unit.pale { fill: #ece0bb; stroke: #7a6842; }
.unit.dark { fill: #2e2925; stroke: #14110f; }
.panel { fill: #ffffff; stroke: #c6cec9; stroke-width: 1; }
.arrow-line { stroke: #34423c; stroke-width: 2; fill: none; }
.arrow-head { fill: #34423c; }

/* ---------- plates of bacteria ---------- */
.dish { fill: #f4eedb; stroke: #8d99a1; stroke-width: 2; }
.dish-pen { fill: #e9efdc; stroke: #8d99a1; stroke-width: 2; }
.dish-rim { fill: none; stroke: #c9d0d2; stroke-width: 1; }
.dish-mark { fill: #34423c; }
.col { fill: #efe2b8; stroke: #a8925a; stroke-width: 1; }
.col-dead { fill: #e3e1da; stroke: #b7b2a6; stroke-width: 1; stroke-dasharray: 2 2; }
.col-res { fill: #e9a23b; stroke: #9a5a00; stroke-width: 1.2; }
.col-ring { fill: none; stroke: #c75b00; stroke-width: 2; }
.velvet { fill: #7a2e3a; stroke: #4d1a23; stroke-width: 1.5; }
.dashed { stroke: #8d99a1; stroke-width: 1.2; stroke-dasharray: 4 4; fill: none; }
.germ { stroke-width: 1.3; }
.germ-ok { fill: #9cc3a8; stroke: #3f6e4f; }
.germ-res { fill: #e9a23b; stroke: #8a4f00; }
.germ-dead { fill: none; stroke: #a3aea8; stroke-dasharray: 2 2; }
.tissue { fill: #f6e3df; stroke: #d9b3ab; stroke-width: 1.5; }
.germ-key { display: flex; flex-wrap: wrap; gap: 0.2rem 1.2rem; list-style: none; margin: 0; padding: 0; font-size: 0.889rem; color: var(--ink-2); }
.germ-key li { display: inline-flex; align-items: center; gap: 0.4rem; }
.germ-key svg { width: 1.3rem; height: auto; background: #fbfbf6; border-radius: 2px; }

/* ---------- the river and the breeding seasons ---------- */
.river { fill: #6fa6d2; stroke: #3e78a8; stroke-width: 1.5; }
.river-dry { fill: #d9caa3; stroke: #b49f6c; stroke-width: 1.2; stroke-dasharray: 5 4; }
.month-grid { stroke: #dfe4de; stroke-width: 1; }
.season-e { fill: #2a78d6; }
.season-w { fill: #eb6834; }
.season-both { fill: none; stroke: #15231d; stroke-width: 1.5; stroke-dasharray: 3 2; }

/* ---------- limbs ---------- */
.limbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.4rem 0.6rem; padding: 0.6rem; }
.limb { margin: 0; text-align: center; }
.limb svg { display: block; width: 100%; max-width: 9rem; height: auto; margin: 0 auto; }
.limb figcaption { font-size: 0.833rem; line-height: 1.3; color: #34423c; }
.limb figcaption b { display: block; color: #15231d; }
.skin { fill: #efe8d8; stroke: #c4b48e; stroke-width: 1.5; stroke-linejoin: round; }
.feather { fill: #f6f1e4; stroke: #c4b48e; stroke-width: 1; }
.feather-line { stroke: #c4b48e; stroke-width: 1; fill: none; }
.bone { stroke-linecap: round; fill: none; }
.bone-upper { stroke: #c75b00; } .bone-fore { stroke: #1f6fbf; } .bone-hand { stroke: #1b7f5a; }
.knuckle-upper { fill: #c75b00; } .knuckle-fore { fill: #1f6fbf; } .knuckle-hand { fill: #1b7f5a; }
.bone.off { stroke: #c9cfcc; }
.knuckle.off { fill: #c9cfcc; }

/* ---------- DNA and the tree ---------- */
.seqs { display: grid; gap: 0.45rem; max-width: 40rem; }
.seq-row { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); align-items: center; gap: 0.2rem 0.6rem; }
.seq-name { font-weight: 800; font-size: 0.889rem; }
.seq { display: flex; flex-wrap: wrap; gap: 0.25rem 0.4rem; font-family: ui-monospace, Menlo, Consolas, monospace; }
.seq-g { display: inline-flex; gap: 1px; }
.seq-g b { display: inline-grid; place-items: center; width: 1.05rem; height: 1.5rem; font-weight: 700; font-size: 0.889rem; border-radius: 2px; background: var(--soft); color: var(--ink); }
.seq-g b.diff { background: #f3c64f; color: #15231d; outline: 1px solid #a37e00; }
.diff-count { margin: 0; font-weight: 800; }
table.dt { border-collapse: collapse; font-size: 0.889rem; width: 100%; max-width: 24rem; }
table.dt caption { text-align: left; font-weight: 800; font-size: 0.833rem; padding-bottom: 0.3rem; }
table.dt th, table.dt td { border: 1px solid var(--rule); padding: 0.3rem 0.5rem; text-align: left; font-variant-numeric: tabular-nums; }
table.dt thead th { background: var(--soft); font-size: 0.778rem; }
table.dt th[scope="row"] { font-weight: 700; }
table.dt td.todo { color: var(--ink-3); }
.tree-line { stroke: #34423c; stroke-width: 2.5; fill: none; stroke-linecap: round; }
.node { fill: #ffffff; stroke: #34423c; stroke-width: 2; pointer-events: none; }
.node-hit { fill: transparent; cursor: pointer; }
.node-hit:focus { outline: none; }
.node-hit:focus-visible + .node, .node-hit:hover + .node { stroke: #1f6fbf; stroke-width: 3; }
.node.picked { fill: #f3c64f; }
.node.right { fill: #1f6b3a; stroke: #1f6b3a; }
.tip-hit { fill: transparent; cursor: pointer; }
.tip-hit:focus { outline: none; }
.tip-hit:focus-visible + .tip-box, .tip-hit:hover + .tip-box { stroke: #1f6fbf; stroke-width: 2.5; }
.tip-box { fill: #ffffff; stroke: #8d99a1; stroke-width: 1.2; pointer-events: none; }
.time-axis { stroke: #8d99a1; stroke-width: 1.2; }

/* ---------- snakes and toads ---------- */
.snake-body { fill: none; stroke: #1d1d1f; stroke-linecap: round; stroke-linejoin: round; }
.snake-belly { fill: none; stroke: #c8372b; stroke-linecap: round; stroke-linejoin: round; }
.snake-head { fill: #1d1d1f; stroke: #c8372b; stroke-width: 1.5; }
.snake-ghost { fill: none; stroke: #6f7b80; stroke-width: 1.5; stroke-dasharray: 5 4; }
.snake-eye { fill: #e8d7a5; }
.toad { fill: #b8925a; stroke: #6f532b; stroke-width: 1.5; stroke-linejoin: round; }
.toad-spot { fill: #8a6a3c; }
.toad-leg { stroke: #8a6a3c; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.dim { stroke: #34423c; stroke-width: 1; fill: none; }

/* ---------- charts ---------- */
/* the colours are set on the whole simulation box, because the legend and the table keys are outside .viz */
.lab, .viz { --viz-surface: var(--box); --viz-ink: var(--ink); --viz-ink-2: var(--ink-2); --viz-muted: var(--ink-3); --viz-grid: #e3e8e4;
  --viz-s1: #2a78d6; --viz-s2: #eb6834; }
@media (prefers-color-scheme: dark) {
  .lab, .viz { --viz-grid: #26332d; --viz-s1: #3987e5; --viz-s2: #d95926; }
}
.viz { position: relative; max-width: 34rem; }
.viz svg { display: block; width: 100%; height: auto; font-family: 'Atkinson Next', system-ui, sans-serif; overflow: visible; }
.viz-title { margin: 0 0 0.3rem; font-weight: 800; font-size: 0.944rem; }
.viz .v-grid { stroke: var(--viz-grid); stroke-width: 1; }
.viz .v-axis { stroke: var(--viz-muted); stroke-width: 1; }
.viz .v-tick { fill: var(--viz-ink-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.viz .v-name { fill: var(--viz-ink-2); font-size: 12.5px; font-weight: 700; }
.viz .v-note { fill: var(--viz-ink-2); font-size: 12px; }
.viz .v-halo { paint-order: stroke; stroke: var(--viz-surface); stroke-width: 4px; stroke-linejoin: round; }
.viz .v-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz .v-s1 { stroke: var(--viz-s1); } .viz .v-s2 { stroke: var(--viz-s2); }
.viz .v-dot { stroke: var(--viz-surface); stroke-width: 2; }
.viz .v-dot.v-s1 { fill: var(--viz-s1); } .viz .v-dot.v-s2 { fill: var(--viz-s2); }
.viz .v-cross { stroke: var(--viz-muted); stroke-width: 1; }
.viz .v-mark { stroke: var(--viz-muted); stroke-width: 1; stroke-dasharray: 3 3; }
.viz .v-hit { fill: transparent; stroke: none; cursor: default; }
.viz .v-hit:focus { outline: none; }
.viz .v-hit.is-pick { cursor: pointer; }
.viz .v-bar { fill: var(--viz-s1); }
.viz .v-bar.is-sel { stroke: var(--viz-ink); stroke-width: 2; }
.viz .v-row { fill: var(--viz-ink-2); font-size: 12.5px; }
.viz .v-row.is-sel { fill: var(--viz-ink); font-weight: 800; }
.viz .v-val { fill: var(--viz-ink); font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums; }
.viz-bars { max-width: 26rem; }
.viz-tip { position: absolute; z-index: 3; pointer-events: none; background: var(--viz-ink); color: var(--viz-surface); border-radius: 4px; padding: 0.3rem 0.5rem; font-size: 0.778rem; line-height: 1.35; white-space: nowrap; transform: translate(-50%, -100%); }
.viz-tip b { font-weight: 800; }
.viz-tip .tip-key { display: inline-block; width: 0.8rem; height: 0.18rem; vertical-align: middle; margin-right: 0.35rem; border-radius: 1px; }
.viz-legend { display: flex; flex-wrap: wrap; gap: 0.2rem 1rem; margin: 0.4rem 0 0; padding: 0; list-style: none; font-size: 0.833rem; color: var(--viz-ink-2); }
.key-dot { display: inline-block; width: 0.9rem; height: 0.2rem; border-radius: 1px; vertical-align: middle; margin-right: 0.4rem; background: var(--viz-s1); }
.key-dot.s2 { background: var(--viz-s2); }
.lab details > summary { cursor: pointer; font-weight: 700; font-size: 0.889rem; }
.lab details[open] > summary { margin-bottom: 0.4rem; }
.plots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; max-width: 40rem; }
.plot { margin: 0; }
.plot figcaption { font-size: 0.833rem; font-weight: 700; margin-bottom: 0.25rem; }
.plot .seg .btn { font-size: 0.833rem; padding: 0.4rem 0.75rem; min-height: 2.25rem; }

/* ---------- tables ---------- */
table.rec { border-collapse: collapse; width: 100%; max-width: 30rem; font-size: 0.889rem; }
table.rec caption { text-align: left; font-weight: 800; padding-bottom: 0.3rem; }
table.rec th, table.rec td { border: 1px solid var(--rule); padding: 0.35rem 0.5rem; text-align: left; font-variant-numeric: tabular-nums; }
table.rec thead th { font-size: 0.778rem; background: var(--soft); }
table.rec td.none { color: var(--ink-3); }

/* ---------- the explanation builder ---------- */
.chain { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; max-width: 44rem; }
.ch-box { position: relative; border: 1px solid var(--rule); border-left: 0.35rem solid var(--y-stripe); border-radius: 3px; padding: 0.55rem 0.85rem 0.6rem; background: var(--soft); }
.ch-box + .ch-box::before { content: ''; position: absolute; left: 1.6rem; top: -1rem; height: 0.7rem; border-left: 2px solid var(--ink-3); }
.ch-box + .ch-box::after { content: ''; position: absolute; left: calc(1.6rem - 5px); top: -0.38rem; border: 6px solid transparent; border-top: 6px solid var(--ink-3); border-bottom: 0; }
.ch-h { margin: 0; font-weight: 800; }
.ch-cards { margin: 0.3rem 0 0; padding-left: 1.1rem; }
.ch-cards li + li { margin-top: 0.2rem; }
.ch-empty { margin: 0.2rem 0 0; color: var(--ink-3); font-size: 0.889rem; }
.ch-box.is-full { border-left-color: var(--ok); }
.ch-out { margin: 0; }
.cards-count { margin: 0; font-weight: 700; }
.lab-body > .chain { margin-top: 1.4rem; }
[data-units] { max-width: 28rem; }

/* ---------- then and now ---------- */
.tn-first { border: 1px solid var(--rule); border-radius: 3px; padding: 0.6rem 0.85rem; background: var(--soft); max-width: 44rem; }
.tn-first p { margin: 0; }
.tn-first .label { margin-bottom: 0.25rem; }
.tn-text { white-space: pre-wrap; }

@media (max-width: 640px) {
  .dia .d-small { font-size: 15px; }
  .viz-bars .v-row, .viz-bars .v-val { font-size: 14px; }
  .viz-bars .v-tick, .viz-bars .v-note { font-size: 13px; }
  .dia .d-lab { font-size: 16px; }
  .limbs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plots { grid-template-columns: minmax(0, 1fr); }
  .seq-row { grid-template-columns: minmax(0, 1fr); }
  table.rec { font-size: 0.833rem; }
  table.rec th, table.rec td { padding: 0.3rem 0.35rem; }
}
