/* AusSci · Why is nothing 100% efficient? (Year 9): the problem cards, the simulations' drawings and controls, the
   Sankey diagrams and the five-step problem solver. Drawings are on a light plate with fixed colours in light and dark
   mode alike. Each energy form has its own colour, and every arrow and stream of dots 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, .dia text.d-big, .dia text.d-lab-w { 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-big { font-size: 17px; font-weight: 800; }
.dia text.d-lab-w { font-size: 12px; font-weight: 800; fill: #ffffff; stroke: rgba(21, 35, 29, 0.75); stroke-width: 3px; }
.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; }

/* ---------- Sankey diagrams ---------- */
.sk-svg text.sk-n, .dia text.sk-n { font-size: 12.5px; font-weight: 800; paint-order: stroke; stroke: #fbfbf6; stroke-width: 3.2px; stroke-linejoin: round; }
.sk-svg text.sk-v, .dia text.sk-v { font-size: 12px; font-weight: 600; fill: #2c3a34; paint-order: stroke; stroke: #fbfbf6; stroke-width: 3.2px; stroke-linejoin: round; }
.sk-svg .sk-box { fill: #f4f6f4; stroke: #3e4a51; stroke-width: 1.5; }
.sk-flow { fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-dasharray: 2.5 11; animation: sk-flow 1.1s linear infinite; }
@keyframes sk-flow { to { stroke-dashoffset: -27; } }
@media (prefers-reduced-motion: reduce) { .sk-flow { animation: none; } }

/* ---------- the problem card and the method ---------- */
.problem { border: 1px solid var(--rule); border-left: 0.35rem solid var(--y-stripe); border-radius: 4px; background: var(--box); padding: 0.9rem 1.1rem; max-width: 46rem; }
.problem .label { margin-bottom: 0.35rem; }
.problem p { margin: 0; }
.problem p + p { margin-top: 0.55rem; }
.method { border: 1px dashed var(--ink-3); border-radius: 4px; padding: 0.9rem 1.1rem; max-width: 46rem; background: var(--soft); }
.method p { margin: 0; }
.method p + p, .method ol { margin-top: 0.55rem; }
.method ol { padding-left: 1.3rem; display: grid; gap: 0.2rem; }
.formula { font-weight: 800; font-size: 1.056rem; margin: 0.4rem 0; }

/* ---------- 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; }
.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; align-items: flex-end; }
.ctl-row .ctl-range { flex: 1 1 14rem; }

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

/* ---------- the five-step solver ---------- */
.cr-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.9rem; max-width: 46rem; }
.cr-step { border-left: 0.25rem solid var(--y-stripe); padding: 0.15rem 0 0.3rem 0.85rem; }
.cr-step.is-locked { border-left-color: var(--rule); }
.cr-step.is-done { border-left-color: var(--ok); }
.cr-h { display: flex; align-items: center; gap: 0.55rem; margin: 0 0 0.45rem; font-size: 1rem; }
.cr-h:focus { outline: none; }
.cr-h:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.cr-n { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--y-deep); color: #fff; font-size: 0.889rem; font-weight: 800; flex: none; }
.cr-step.is-locked .cr-n { background: var(--rule); color: var(--ink-2); }
.cr-step.is-locked .cr-t { color: var(--ink-3); }
.cr-step.is-done .cr-n { background: var(--ok); }
.cr-step.is-done .cr-tick::after { content: '✓'; color: var(--ok); font-weight: 800; }
.cr-lock { margin: 0; color: var(--ink-3); }
.cr-in { display: grid; gap: 0.9rem; }
.cr-part { display: grid; gap: 0.45rem; }
.cr-ask { margin: 0; font-weight: 700; }
.cr-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.cr-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.cr-chip { font: inherit; font-size: 0.889rem; text-align: left; padding: 0.45rem 0.7rem; border: 1px solid var(--ink-3); border-radius: 999px; background: var(--box); color: var(--ink); cursor: pointer; min-height: 2.4rem; }
.cr-chip::before { content: ''; display: inline-block; width: 0.85rem; height: 0.85rem; margin-right: 0.45rem; border: 1.5px solid var(--ink-3); border-radius: 3px; vertical-align: -0.1rem; }
.cr-chip[aria-pressed="true"] { border-color: var(--y-deep); background: var(--soft); font-weight: 700; }
.cr-chip[aria-pressed="true"]::before { content: '✓'; display: inline-grid; place-items: center; font-size: 0.7rem; line-height: 1; color: #fff; background: var(--y-deep); border-color: var(--y-deep); }
.cr-chip:disabled { cursor: default; }
.cr-chip.is-extra { opacity: 0.55; text-decoration: line-through; }
.cr-slot-row { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; }
.cr-slot { display: grid; gap: 0.2rem; font-size: 0.889rem; font-weight: 700; flex: 1 1 12rem; }
.cr-slot select { width: 100%; min-height: 2.4rem; font-weight: 600; }
.cr-sk { max-width: 30rem; padding: 0.25rem; }
.cr-seq { margin: 0; padding-left: 1.5rem; display: grid; gap: 0.25rem; font-weight: 700; min-height: 1.2rem; }
.cr-pool { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.cr-item { text-align: left; }
.cr-nums { display: grid; gap: 0.7rem; }
.cr-dia { display: grid; gap: 0.4rem; margin-top: 0.3rem; }
.cr-dia-in { padding: 0.25rem; max-width: 40rem; }
.cr-answer { border: 1px solid var(--ok); border-radius: 4px; background: var(--ok-bg); padding: 0.75rem 0.9rem; }
.cr-answer .label { margin-bottom: 0.25rem; }
.cr-answer p { margin: 0; }
.cr-answer .cr-ans-t { font-weight: 700; }

/* ---------- tables ---------- */
.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); }
.data-table td.n { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- the Sankey checker's tabs ---------- */
.sk-fix { display: grid; gap: 0.55rem; }
.sk-fix .cr-row { gap: 0.4rem 0.8rem; }
.sk-step { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 700; font-size: 0.889rem; }
.sk-step output { min-width: 3.4rem; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- phones ---------- */
@media (max-width: 640px) {
  .cr-step { padding-left: 0.6rem; }
  .cr-slot { flex-basis: 100%; }
}
