/* AusSci · Where does the mass go? (Year 9): the balance, atom models, equations and explanation boxes.
   Diagrams are drawn on a paper-coloured plate with fixed ink colours, in light and dark mode alike. */

.section-title { font-size: 1.333rem; font-weight: 800; margin: 0; }
.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; }
.d-lab { font-size: 15px; fill: #34423c; }
.d-small { font-size: 13px; fill: #34423c; }
.d-strong { font-weight: 800; fill: #15231d; }
.ctl .label { margin-bottom: 0.3rem; }
.done-mark { color: var(--ok); font-weight: 800; }
.seg .btn[aria-pressed="true"] .done-mark { color: inherit; }
.status.is-right { color: var(--ok); }
.tbl-scroll { overflow-x: auto; }
.goals-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; font-size: 0.944rem; }
.goals-list li { display: grid; grid-template-columns: 1.4rem minmax(0, 1fr); gap: 0.4rem; align-items: start; }
.tick { width: 1.1rem; height: 1.1rem; border-radius: 50%; border: 2px solid var(--ink-3); margin-top: 0.2rem; }
.goals-list li.is-done .tick { background: var(--ok); border-color: var(--ok); box-shadow: inset 0 0 0 2px var(--box); }

/* ---------- atoms ---------- */
.at { stroke-width: 1.2; }
.at-h { fill: #ffffff; stroke: #5c6b76; }
.at-c { fill: #3a4046; stroke: #1d2226; }
.at-n { fill: #2f5fc0; stroke: #1f418a; }
.at-o { fill: #c8372b; stroke: #8f241b; }
.at-mg { fill: #bfe3c9; stroke: #3f7d55; }
.at-fe { fill: #f2bd8c; stroke: #a85c1f; }
.at-t { font-size: 12px; font-weight: 800; pointer-events: none; }
.at-t.sm { font-size: 9.5px; }
.dia .at-t-c, .dia .at-t-n, .dia .at-t-o { fill: #ffffff; }
.dia .at-t-h, .dia .at-t-mg, .dia .at-t-fe { fill: #15231d; }
.band-rule { stroke: #d8ded9; stroke-width: 1; }
.arrow { stroke: #34423c; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- the balance ---------- */
.lab-stage { max-width: 30rem; }
.lab-run { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.bal-pan { fill: #b9c2c6; stroke: #6f7b80; stroke-width: 1; }
.bal-base { fill: #dfe4e2; stroke: #6f7b80; stroke-width: 1.5; }
.bal-screen { fill: #18261f; }
.dia .bal-read { fill: #c9f5d6; font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.glass { fill: rgba(196, 222, 232, 0.28); stroke: #5d6f77; stroke-width: 2; stroke-linejoin: round; }
.liq { fill: rgba(150, 200, 226, 0.55); }
.liq-yellow { fill: #f0cf2e; }
.liq-tube { fill: rgba(150, 200, 226, 0.75); }
.ppt { fill: #e8b90c; stroke: #a37e00; stroke-width: 1; }
.tube { fill: rgba(255, 255, 255, 0.35); stroke: #5d6f77; stroke-width: 1.5; }
.powder { fill: #ffffff; stroke: #8a9499; stroke-width: 0.8; }
.cap { fill: #c8372b; stroke: #8f241b; stroke-width: 1.5; }
.stopper { fill: #9a6a3c; stroke: #5f3f20; stroke-width: 1.5; }
.bubble { fill: #ffffff; stroke: #5d86a0; stroke-width: 1; }
.foam { fill: none; stroke: #ffffff; stroke-width: 5; stroke-linecap: round; }
.gas { fill: #8d99a1; stroke: #56636b; stroke-width: 0.8; }
.gas-o2 circle { fill: #c8372b; stroke: #8f241b; stroke-width: 0.8; }
.dish { fill: #c9d0d2; stroke: #6f7b80; stroke-width: 1.5; }
.wax { fill: #f3ead2; stroke: #a89868; stroke-width: 1.5; }
.wick { stroke: #2b2b2b; stroke-width: 2; }
.flame { fill: #f5a623; stroke: #c9730a; stroke-width: 1; }
.flame-in { fill: #fff3b0; }
.cruc { fill: #e9e6df; stroke: #6f6a60; stroke-width: 2; stroke-linejoin: round; }
.lid { stroke: #6f6a60; stroke-width: 5; stroke-linecap: round; }
.ribbon { fill: none; stroke: #7c8790; stroke-width: 3.5; stroke-linecap: round; }
.mgo { fill: #ffffff; stroke: #8a9499; stroke-width: 1.2; }
.mg-glow { fill: #fff6c2; }
.mg-core { fill: #ffffff; stroke: #e8c94a; stroke-width: 2; }
.jar-base { fill: #b9c2c6; stroke: #6f7b80; stroke-width: 1; }
.wool { fill: none; stroke-width: 1.6; }

table.runs, table.tally { border-collapse: collapse; width: 100%; font-size: 0.889rem; }
table.runs td { font-variant-numeric: tabular-nums; }
.run-how { display: block; font-weight: 400; color: var(--ink-2); }
table.runs tr.run-head th { background: var(--soft); border-bottom: 0; }
table.runs tr.run-head .run-how { display: inline; }
table.runs tr.run-head .run-how::before { content: ', '; }
table.runs caption, table.tally caption { text-align: left; font-weight: 800; padding-bottom: 0.3rem; }
table.runs th, table.runs td, table.tally th, table.tally td { border: 1px solid var(--rule); padding: 0.35rem 0.5rem; text-align: left; }
table.runs thead th, table.tally thead th { font-size: 0.778rem; background: var(--soft); }
table.runs td.chg { font-weight: 800; color: var(--y-deep); }
table.runs td.same { font-weight: 700; }
table.tally { max-width: 30rem; }
table.tally tr.is-right td:last-child { color: var(--ok); font-weight: 800; }
table.tally tr.is-wrong td:last-child { color: var(--bad); font-weight: 800; }

/* ---------- predictions ---------- */
.preds { display: grid; gap: 0.7rem; max-width: 44rem; }
.preds fieldset { border: 1px solid var(--rule); border-radius: 3px; padding: 0.55rem 0.9rem 0.7rem; margin: 0; background: var(--box); }
.preds legend { font-weight: 700; padding: 0 0.3rem; }
.preds label { display: inline-flex; align-items: center; gap: 0.35rem; margin-right: 1.1rem; }
.preds input { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }

/* ---------- explain it to yourself ---------- */
.explain { max-width: 44rem; border-left: 0.35rem solid var(--y-stripe); }
.ex-said { display: flex; align-items: center; gap: 0.45rem; margin-top: 0.5rem; font-size: 0.944rem; }
.ex-said input, .ex-ideas input { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); flex: none; }
.ex-gate { margin-top: 0.8rem; }
.ex-need { margin: 0.4rem 0 0; color: var(--bad); font-weight: 700; }
.ex-model { margin-top: 0.9rem; padding-top: 0.8rem; border-top: 1px solid var(--rule); }
.ex-model .label { margin-bottom: 0.3rem; }
.ex-text { margin: 0 0 0.8rem; }
.ex-ideas { border: 0; padding: 0; margin: 0; display: grid; gap: 0.4rem; }
.ex-ideas legend { font-weight: 700; padding: 0; margin-bottom: 0.4rem; }
.ex-ideas label { display: flex; gap: 0.5rem; align-items: start; }
.ex-ideas input { margin-top: 0.2rem; }
.ex-next, .ex-saved { margin: 0.6rem 0 0; font-weight: 700; }
.ex-quote { margin: 0 0 0.8rem; padding: 0.5rem 0.8rem; border-left: 0.25rem solid var(--ink-3); background: var(--box); white-space: pre-wrap; }
.tn-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; }
.tn { margin: 0; }
.tn .ex-quote { margin: 0.3rem 0 0; }

/* ---------- builder, reader, balancer ---------- */
.eq-word { margin: 0; font-weight: 700; }
.eq-big { margin: 0; font-size: 1.444rem; font-weight: 800; letter-spacing: 0.01em; }
.eq-big .coef { color: var(--y-deep); }
.bld-stage, .rd-stage, .bal-stage { max-width: 37.5rem; }
.bld-ctl { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.stepper-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.9rem; }
.stepper-row .label { margin: 0; }
.stepper { display: inline-flex; align-items: center; gap: 0.25rem; }
.stepper .btn { min-width: 2.4rem; min-height: 2.4rem; padding: 0; font-size: 1.2rem; font-weight: 800; line-height: 1; }
.stepper output { min-width: 1.6rem; text-align: center; font-weight: 800; font-size: 1.111rem; font-variant-numeric: tabular-nums; }
.eq-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.6rem; }
.eq-term { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.5rem; border: 1px solid var(--rule); border-radius: 4px; background: var(--soft); }
.eq-f { font-size: 1.222rem; font-weight: 800; }
.eq-op { font-size: 1.222rem; font-weight: 800; color: var(--ink-2); }
.pick { margin: 0; padding: 0.3rem 0.4rem; max-width: 33rem; }
.pick + .pick { margin-top: 0.5rem; }

/* ---------- scales ---------- */
.sc-stage { max-width: 30rem; }
.sc-post { stroke: #6f7b80; stroke-width: 5; stroke-linecap: round; fill: none; }
.sc-beam { stroke: #3d4a50; stroke-width: 6; stroke-linecap: round; }
.sc-pivot { fill: #fbfbf6; stroke: #3d4a50; stroke-width: 2.5; }
.sc-string { stroke: #8a9499; stroke-width: 1.2; fill: none; }
.sc-pan { fill: #b9c2c6; stroke: #6f7b80; stroke-width: 1; }
.blk { fill: #e3ebe6; stroke: #51615a; stroke-width: 1.4; }
.blk.gas { fill: #edf3f7; stroke: #5d7786; stroke-dasharray: 5 3; }
.blk.ghost { fill: none; stroke: #9aa7ad; }
.blk.wanted { fill: #dcefdf; stroke: #2f7a46; }
.blk.waste { fill: #f6e4dc; stroke: #a5522d; }
.dia .blk-n { font-size: 13px; font-weight: 800; }
.dia .blk-m { font-size: 12.5px; fill: #34423c; }
.dia .blk-n.ghost, .dia .blk-m.ghost { fill: #6b777c; }
.dia .blk-tag { font-size: 11.5px; font-weight: 800; fill: #34423c; text-transform: uppercase; letter-spacing: 0.04em; }

@media (max-width: 640px) {
  .tn-grid { grid-template-columns: minmax(0, 1fr); }
  table.runs, table.tally { font-size: 0.833rem; }
  table.runs th, table.runs td, table.tally th, table.tally td { padding: 0.3rem 0.35rem; }
  .eq-term { padding: 0.25rem 0.35rem; }
}
