/* AusSci · How do force and mass change an object’s motion? (Year 10): the ranking tasks, the simulations' drawings
   and controls, the charts and the crash chart. Drawings sit on a light plate with fixed colours in light and dark mode
   alike, and every force arrow has a label. Charts follow the page's colours: the speed-time graph draws the latest run
   in the first categorical colour (blue) and earlier runs in grey; the stopping-distance graph draws dry roads in the
   first colour (blue) and wet roads in the second (orange), checked with the dataviz palette validator against both
   page surfaces; the acceleration graph shades each mass, 1 to 5 kg, with a step of one sequential blue ramp, the five steps checked with the validator for the ramp on both surfaces, and has a key; the crash chart
   is one series in blue with its values written beside the bars. */

/* ---------- 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-dim { fill: #5f6e67; }
.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; }

/* ---------- chart tokens ---------- */
.lab {
  --viz-ink: var(--ink); --viz-ink-2: var(--ink-2); --viz-muted: var(--ink-3); --viz-grid: #e3e8e4; --viz-old: #a9b3ae;
  --viz-s1: #2a78d6; --viz-s2: #eb6834;
  --viz-m1: #86b6ef; --viz-m2: #5598e7; --viz-m3: #2a78d6; --viz-m4: #1c5cab; --viz-m5: #104281;
}
@media (prefers-color-scheme: dark) {
  .lab {
    --viz-grid: #26332d; --viz-old: #5d6b65; --viz-s1: #3987e5; --viz-s2: #d95926;
    --viz-m1: #184f95; --viz-m2: #256abf; --viz-m3: #3987e5; --viz-m4: #6da7ec; --viz-m5: #9ec5f4;
  }
}
.chart text.ch-axis { fill: var(--viz-ink-2); font-size: 11.5px; }
.chart text.ch-axis-t { fill: var(--viz-ink-2); font-size: 11.5px; font-weight: 700; }
.chart text.ch-lab { fill: var(--viz-ink); font-size: 11.5px; font-weight: 700; }
.chart .ch-grid { stroke: var(--viz-grid); stroke-width: 1; }
.chart .ch-base { stroke: var(--viz-muted); stroke-width: 1.2; }
.chart .ch-line-1, .nl-key .ch-line-1 { fill: none; stroke: var(--viz-s1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .ch-line-2, .nl-key .ch-line-2 { fill: none; stroke: var(--viz-s2); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .ch-line-old { fill: none; stroke: var(--viz-old); stroke-width: 1.6; stroke-linejoin: round; }
.chart .ch-ref { stroke: var(--viz-muted); stroke-width: 1.2; stroke-dasharray: 5 4; }
.chart .ch-now { stroke: var(--viz-muted); stroke-width: 1; stroke-dasharray: 2 3; }
.ch-pt { stroke: var(--paper); stroke-width: 1.5; }
.ch-pt-1 { fill: var(--viz-s1); }
.ch-pt-2 { fill: var(--viz-s2); }
.ch-pt-k { fill: var(--viz-ink); }
.chart .ch-fit { stroke-width: 1.6; stroke-dasharray: 5 4; fill: none; }
.ch-pt.ch-m1 { fill: var(--viz-m1); } .ch-fit.ch-m1 { stroke: var(--viz-m1); }
.ch-pt.ch-m2 { fill: var(--viz-m2); } .ch-fit.ch-m2 { stroke: var(--viz-m2); }
.ch-pt.ch-m3 { fill: var(--viz-m3); } .ch-fit.ch-m3 { stroke: var(--viz-m3); }
.ch-pt.ch-m4 { fill: var(--viz-m4); } .ch-fit.ch-m4 { stroke: var(--viz-m4); }
.ch-pt.ch-m5 { fill: var(--viz-m5); } .ch-fit.ch-m5 { stroke: var(--viz-m5); }

/* ---------- 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; }
.lab-run { display: flex; flex-wrap: wrap; gap: 0.5rem 0.8rem; align-items: center; }
.nl-opts { display: flex; flex-wrap: wrap; gap: 0.3rem 1.1rem; }
.nl-opt { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.889rem; font-weight: 700; cursor: pointer; min-height: 2.2rem; }
.nl-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); }
.ctl-row { display: flex; flex-wrap: wrap; gap: 0.8rem 1.6rem; }
.ctl-row .ctl-range { flex: 1 1 14rem; }

/* ---------- a simulation: the drawing, with its readings, and a chart or diagram beside it ---------- */
.nl-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: start; }
.nl-wrap:has(.nl-side) { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.nl-box { padding: 0.25rem; }
.nl-read { margin: 0.45rem 0 0; font-size: 0.889rem; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.nl-status { min-height: 2.6em; }
.nl-todo { margin: 0; color: var(--ink-3); }
.nl-side { display: grid; gap: 0.6rem; align-content: start; }
.nl-side .label { margin: 0; }
.nl-side .chart { max-width: 22rem; }
.nl-fbd { max-width: 15rem; }
.nl-sum { margin: 0; font-size: 0.889rem; line-height: 1.55; }
.nl-sum b { color: var(--y-deep); }
.nl-wrap:not(:has(.nl-side)) .nl-main { max-width: 48rem; }
.nl-key { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; font-size: 0.833rem; color: var(--ink-2); max-width: 24rem; }
.nl-key li { display: inline-flex; align-items: center; }
.nl-key svg { width: 1.4rem; height: 0.8rem; margin-right: 0.35rem; flex: none; overflow: visible; }

/* the cart's table and graph */
.nl-two { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1rem 1.4rem; align-items: start; }
.nl-chartbox { display: grid; gap: 0.5rem; max-width: 22rem; }
.table-wrap { overflow-x: auto; max-width: 40rem; }
.data-table { border-collapse: collapse; width: 100%; font-size: 0.889rem; }
.data-table caption { text-align: left; font-weight: 700; font-size: 0.889rem; color: var(--ink-2); padding-bottom: 0.35rem; }
.data-table th, .data-table td { text-align: left; padding: 0.35rem 0.55rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.data-table thead th { font-size: 0.778rem; color: var(--ink-3); }
.nl-table td { font-variant-numeric: tabular-nums; }

/* the crash chart: one bar for each crash, with its value written beside it */
.nl-barbox { max-width: 44rem; }
.nl-barbox .label { margin-bottom: 0.4rem; }
.nl-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.nl-bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.15rem 0.7rem; align-items: center; font-size: 0.833rem; }
.nl-bar-t { grid-column: 1 / -1; color: var(--ink-2); }
.nl-bar { position: relative; height: 0.75rem; border-radius: 0 4px 4px 0; background: var(--viz-grid); }
.nl-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; background: var(--viz-s1); }
.nl-bars b { font-variant-numeric: tabular-nums; min-width: 6.5rem; text-align: right; }
.nl-bars-empty { color: var(--ink-3); }

/* ---------- ranking tasks ---------- */
.rk-ask { font-weight: 700; margin: 0; max-width: 46rem; }
.rk-how { margin: 0; }
.rk-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: 0.6rem; }
.rk-card { border: 1px solid var(--rule); border-radius: 4px; padding: 0.6rem 0.65rem; background: var(--box); display: grid; gap: 0.45rem; align-content: start; }
.rk-card.is-testing { outline: 3px solid var(--y-stripe); outline-offset: 1px; }
.rk-t { margin: 0; font-size: 0.889rem; font-weight: 700; line-height: 1.3; min-height: 2.6em; }
.rk-t b { display: inline-grid; place-items: center; min-width: 1.45rem; height: 1.45rem; margin-right: 0.3rem; border-radius: 50%; background: var(--y-tint); color: var(--y-deep); font-size: 0.833rem; }
.rk-pic { padding: 0.1rem; }
.rk-svg text.d-lab-s { font-size: 13px; }
.rk-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.5rem; }
.rk-sel { font-size: 0.833rem; font-weight: 800; }
.rk-row select { min-height: 2.2rem; min-width: 3.4rem; font-weight: 700; }
.rk-meas { margin: 0; font-size: 0.833rem; color: var(--ink-2); min-height: 0; }
.rk-meas.is-set { color: var(--ink); background: var(--soft); border-left: 0.2rem solid var(--y-stripe); padding: 0.3rem 0.45rem; border-radius: 0 3px 3px 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; }
.rk-lock, .rk-first { margin: 0; }
.rk-why { border-top: 1px solid var(--rule); padding-top: 0.9rem; max-width: 44rem; }
.rk-why-q { font-weight: 800; margin: 0 0 0.6rem; }
.rk-why-q:focus { outline: none; }

/* ---------- phones ---------- */
@media (max-width: 640px) {
  .nl-wrap:has(.nl-side) { grid-template-columns: minmax(0, 1fr); }
  .nl-two { grid-template-columns: minmax(0, 1fr); }
  .nl-side .chart, .nl-chartbox { max-width: 26rem; }
  .chart text.ch-axis, .chart text.ch-axis-t, .chart text.ch-lab { font-size: 12.5px; }
  .rk-cards { grid-template-columns: repeat(auto-fill, minmax(8.2rem, 1fr)); gap: 0.5rem; }
  .rk-card { padding: 0.5rem; }
  .rk-t { font-size: 0.833rem; }
  .rk-svg text.d-lab-s { font-size: 15px; }
}
