/* AusSci · What are living things made of? (Year 8): the microscope, drawing pad and diagrams.
   Diagrams sit 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; }
.section-sub { font-size: 1.111rem; font-weight: 800; }
.dia { display: block; width: 100%; height: auto; font-family: 'Atkinson Next', system-ui, sans-serif; }
.plate, .zoom-stage, .crit-art, .scale-stage, .depth-side, .venn-holder, .cx-stage, .tl-pic, .bld-art {
  background: #fbfbf6; border: 1px solid #d8ded9; border-radius: 4px; color: #15231d;
}
.dia text { fill: #15231d; }
.dia.is-narrow .d-lab { font-size: 24px; }
.venn-dia.is-narrow .d-lab { font-size: 18px; }
.venn-dia.is-narrow .d-small { font-size: 14px; }
.bld-svg.is-narrow .md-tag { display: none; }
.bld-legend { margin: 0; padding: 0.5rem 0.8rem 0.6rem 1.8rem; font-size: 0.889rem; color: #15231d; }
.d-lab { font-size: 15px; fill: #34423c; }
.d-small { font-size: 13px; fill: #34423c; }
.d-strong { font-weight: 800; fill: #15231d; }
.d-line { stroke: #56645e; stroke-width: 1.5; fill: none; }
.slider-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.slider-row input[type="range"] { flex: 1 1 12rem; accent-color: var(--accent); }
.slider-row output { font-weight: 700; font-size: 0.889rem; min-width: 4rem; }

/* ---------- zoom ---------- */
.zoom-stage { max-width: 40rem; }
.on-skin { fill: #ead7ae; }
.on-outer { fill: none; stroke: #8b5a1e; stroke-width: 3; }
.on-root { fill: #a8835a; stroke: #6e5130; stroke-width: 1.5; }
.on-layer { fill: none; stroke: #c49a5a; stroke-width: 2; }
.on-cut { stroke: #8b5a1e; stroke-width: 2; stroke-dasharray: 6 5; }
.on-layer-fill { fill: #f0dfbb; stroke: #b5853f; stroke-width: 2; }
.on-inner { fill: none; stroke: #9a6a24; stroke-width: 4; }
.on-peel { fill: rgba(245, 236, 210, 0.75); stroke: #b5853f; stroke-width: 1.5; }
.tweez { stroke: #5c6b65; stroke-width: 5; stroke-linecap: round; fill: none; }
.slide-glass { fill: rgba(190, 220, 232, 0.4); stroke: #6f7f79; stroke-width: 2; }
.slide-spec { fill: rgba(205, 155, 60, 0.55); stroke: #9a6a24; stroke-width: 1; }
.slide-cover { fill: rgba(255, 255, 255, 0.3); stroke: #6f7f79; stroke-width: 1.5; stroke-dasharray: 5 4; }

/* ---------- microscope ---------- */
.scope-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 15rem); gap: 1rem 1.4rem; align-items: start; }
.scope-body > * + * { margin-top: 0; }
.scope-view, .goals-list, .scope-status, .scope-info { grid-column: 1; }
.scope-ctl { grid-column: 2; grid-row: 1 / span 4; display: grid; gap: 0.9rem; }
.scope-eye { background: #0d1110; border-radius: 50%; padding: 6px; width: min(100%, 472px); aspect-ratio: 1; display: grid; place-items: center; touch-action: none; }
.scope-eye canvas { display: block; border-radius: 50%; clip-path: circle(50%); cursor: grab; }
.scope-eye canvas:active { cursor: grabbing; }
.scope-eye canvas:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.scope-mag { margin: 0.3rem 0 0; font-weight: 800; font-size: 0.889rem; color: var(--ink-2); }
.ctl .label { margin-bottom: 0.3rem; }
.ctl input[type="range"] { width: 100%; accent-color: var(--accent); }
.scope-total { margin: 0.35rem 0 0; }
.focus-grid { display: grid; grid-template-columns: auto auto auto; gap: 0.35rem 0.5rem; align-items: center; justify-content: start; }
.move-grid { display: grid; grid-template-columns: repeat(3, 2.6rem); grid-template-areas: ". up ." "left . right" ". down ."; gap: 0.3rem; }
.move-grid [data-mv="0,-1"] { grid-area: up; } .move-grid [data-mv="-1,0"] { grid-area: left; }
.move-grid [data-mv="1,0"] { grid-area: right; } .move-grid [data-mv="0,1"] { grid-area: down; }
.move-grid .btn { padding: 0; min-width: 0; }
.goals-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; font-size: 0.889rem; }
.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.15rem; }
.goals-list li.is-done .tick { background: var(--ok); border-color: var(--ok); box-shadow: inset 0 0 0 2px var(--box); }
.goals-list li.is-done { color: var(--ink-2); }
.scope-info { margin: 0; padding: 0.6rem 0.8rem; background: var(--soft); border-left: 0.25rem solid var(--y-stripe); border-radius: 0 3px 3px 0; font-size: 0.944rem; }

/* ---------- drawing pad ---------- */
.pad-wrap { max-width: 40rem; }
.pad-canvas { display: block; width: 100%; height: auto; border: 1px solid #c3ccc6; border-radius: 4px; touch-action: none; cursor: crosshair; background: #fdfdfa; }
.pad-tools { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; }
.pad-help { margin: 0; }
.pad-label { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.pad-label label { font-weight: 700; }
.pad-label .field { width: auto; flex: 1 1 12rem; max-width: 20rem; }
.pad-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0; }
.pad-fields { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 0.6rem; max-width: 40rem; }
.pad-fields label { display: block; font-weight: 700; font-size: 0.889rem; margin-bottom: 0.2rem; }
.first-try { margin: 0; display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; }
.first-try canvas { border: 1px solid #c3ccc6; border-radius: 4px; }
.first-try figcaption { flex: 1 1 14rem; font-size: 0.889rem; color: var(--ink-2); }

/* ---------- judging the drawings ---------- */
.crit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.crit { margin: 0; border: 1px solid var(--rule); border-radius: 4px; padding: 0.7rem; }
.crit figcaption { margin: 0.4rem 0; }
.crit-svg { max-width: 22rem; }
.pencil .pl { fill: none; stroke: #26302b; stroke-width: 1.6; }
.pencil .pl-l { fill: none; stroke: #26302b; stroke-width: 1; }
.pencil .pl-shade { fill: #c9c6bb; stroke: #4b4f49; stroke-width: 1.4; }
.pencil .pl-dark { fill: #3f423c; }
.pencil .pl-hatch { stroke: #6b6d66; stroke-width: 3; opacity: 0.5; }
.pencil .pl-sk { fill: none; stroke: #3a423e; stroke-width: 1; opacity: 0.85; }
.pl-fill { fill: #26302b; }
.d-fov { fill: #fdfdfa; stroke: #c3ccc6; stroke-width: 1.2; stroke-dasharray: 5 4; }
.crit-rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.crit-rules li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.2rem 0.5rem; align-items: center; font-size: 0.889rem; padding: 0.25rem 0.4rem; border-radius: 3px; }
.crit-rules .seg .btn { min-height: 2rem; padding: 0.2rem 0.65rem; }
.crit-why { grid-column: 1 / -1; font-size: 0.833rem; color: var(--ink-2); }
.crit-rules li.is-right { background: var(--ok-bg); }
.crit-rules li.is-wrong { background: var(--bad-bg); }
.crit-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; }
.crit-foot .status { flex: 1 1 18rem; }
.rules-box { border: 1px solid var(--rule); border-left: 0.35rem solid var(--y-stripe); border-radius: 3px; padding: 0.9rem 1.1rem; background: var(--box); }
.rules-box ul { margin: 0 0 0.6rem; padding-left: 1.2rem; }
.rules-box li + li { margin-top: 0.3rem; }

/* ---------- size ---------- */
.measure-eye { max-width: 472px; }
.measure-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.scale-stage { max-width: 40rem; }
.sc-pin { fill: #c9ccc8; stroke: #5c6360; stroke-width: 2; }
.sc-onion { fill: rgba(214, 178, 92, 0.45); stroke: #7a5618; stroke-width: 1.2; }
.sc-nuc { fill: #7a5618; }
.sc-rbc { fill: #d9534a; stroke: #8f2a22; stroke-width: 1.2; }
.sc-rbc-in { fill: #ec8a82; }
.sc-bar { stroke: #15231d; stroke-width: 2.5; fill: none; }
.depth-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1rem; align-items: center; }
.depth-eye { width: auto; max-width: 372px; }
.depth-side { max-width: 20rem; }
.dp-top { fill: #efe2c1; stroke: #8b5a1e; stroke-width: 1.5; }
.dp-front { fill: #f5ead0; stroke: #8b5a1e; stroke-width: 1.5; }
.dp-side { fill: #e6d4a8; stroke: #8b5a1e; stroke-width: 1.5; }
.dp-nuc { fill: #8b5a1e; opacity: 0.7; }
.dp-plane { fill: rgba(27, 94, 70, 0.25); stroke: #1b5e46; stroke-width: 2; }

/* ---------- plant and animal diagram ---------- */
.venn-holder { max-width: 40rem; }
.vn-plant { fill: rgba(70, 150, 70, 0.12); stroke: #3f7d3f; stroke-width: 2.5; }
.vn-animal { fill: rgba(60, 110, 180, 0.12); stroke: #3b67a8; stroke-width: 2.5; }
.vn-some { fill: rgba(70, 150, 70, 0.22); stroke: #3f7d3f; stroke-width: 2; stroke-dasharray: 6 4; }
.vn-chip { fill: #ffffff; stroke: #56645e; stroke-width: 1.2; }
.vn-chip.vn-wrong { stroke: #b3261e; stroke-width: 2.5; }
.venn2-card { max-width: 40rem; }

/* ---------- cell explorer ---------- */
.cx-bar { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; }
.cx-stage { max-width: 40rem; }
.cx-wall { fill: #d4e6c3; stroke: #4f7f3a; stroke-width: 7; }
.cx-membrane { fill: none; stroke: #7a5aa8; stroke-width: 2.2; }
.cx-membrane-a { fill: none; stroke-width: 3; }
.cx-cyto { fill: rgba(241, 232, 196, 0.65); }
.cx-vac { fill: rgba(166, 207, 234, 0.75); stroke: #4f86ab; stroke-width: 2; }
.cx-nuc { fill: #c3b0e0; stroke: #6c4f99; stroke-width: 2; }
.cx-nucleolus { fill: #6c4f99; }
.cx-chloro { fill: #5aa84b; stroke: #2f6b2a; stroke-width: 1.5; }
.cx-grana { stroke: #1f4a1c; stroke-width: 1.4; }
.cx-mito { fill: #f2b77e; stroke: #b0662a; stroke-width: 1.5; }
.cx-cristae { fill: none; stroke: #b0662a; stroke-width: 1.3; }
.cx-grain { fill: rgba(120, 118, 90, 0.45); }
[data-part] { cursor: pointer; }
[data-part]:focus { outline: none; }
[data-part]:focus-visible > *, [data-part]:focus-visible { stroke: #0b57d0 !important; stroke-width: 4 !important; }
[data-part].is-on > *, [data-part].is-on { stroke: #c2410c !important; stroke-width: 4 !important; }
.cx-light .cx-wall { fill: #eef1e4; stroke: #7d8a62; stroke-width: 4; }
.cx-light .cx-cyto { fill: rgba(225, 222, 196, 0.6); }
.cx-light .cx-vac { fill: rgba(246, 247, 240, 0.85); stroke: none; }
.cx-light .cx-membrane { stroke: #9a9a80; stroke-width: 1; }
.cx-light .cx-nuc { fill: #cfc4a6; stroke: #8f846a; }
.cx-light .cx-chloro { fill: #5e9b4c; stroke: none; }
.cx-electron .cx-wall { fill: #dcdcdc; stroke: #3a3a3a; stroke-width: 6; }
.cx-electron .cx-membrane { stroke: #1e1e1e; stroke-width: 2.5; }
.cx-electron .cx-cyto { fill: #ededed; }
.cx-electron .cx-vac { fill: #fafafa; stroke: #4a4a4a; stroke-width: 1.5; }
.cx-electron .cx-nuc { fill: #c4c4c4; stroke: #1e1e1e; stroke-width: 3.5; }
.cx-electron .cx-nucleolus { fill: #4a4a4a; }
.cx-electron .cx-chloro { fill: #a8a8a8; stroke: #1e1e1e; }
.cx-electron .cx-grana { stroke: #1e1e1e; }
.cx-electron .cx-mito { fill: #cfcfcf; stroke: #1e1e1e; }
.cx-electron .cx-cristae { stroke: #1e1e1e; }
.cx-view-note { margin: 0; }
.cx-parts { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.cx-info { border-left: 0.3rem solid var(--y-stripe); padding: 0.5rem 0.9rem; background: var(--soft); border-radius: 0 3px 3px 0; min-height: 3rem; }
.cx-info h4 { margin: 0 0 0.3rem; font-size: 1rem; }
.cx-info p { margin: 0 0 0.4rem; }
.cx-info p:last-child { margin-bottom: 0; }

/* ---------- matching ---------- */
.match-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.match-list li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(11rem, auto) 6.5rem; gap: 0.3rem 0.7rem; align-items: center; padding: 0.4rem 0.5rem; border-radius: 3px; border: 1px solid var(--rule); }
.match-list li.is-right { background: var(--ok-bg); border-color: var(--ok); }
.match-list li.is-wrong { background: var(--bad-bg); border-color: var(--bad); }
.match-fb { font-size: 0.833rem; font-weight: 700; }
.match-list li.is-right .match-fb { color: var(--ok); }
.match-list li.is-wrong .match-fb { color: var(--bad); }

/* ---------- table, timeline ---------- */
.tbl-scroll { overflow-x: auto; }
table.feat { border-collapse: collapse; width: 100%; min-width: 34rem; font-size: 0.889rem; }
table.feat th, table.feat td { border: 1px solid var(--rule); padding: 0.4rem 0.5rem; text-align: center; }
table.feat th[scope="row"] { text-align: left; font-weight: 700; }
table.feat thead th { font-size: 0.778rem; background: var(--soft); }
.yn { font: inherit; font-weight: 800; min-width: 3.2rem; min-height: 2.2rem; border: 1px solid var(--ink-3); border-radius: 999px; background: var(--box); color: var(--ink); cursor: pointer; }
td.is-right .yn { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
td.is-wrong .yn { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.tl { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.4rem; position: relative; }
.tl-btn { width: 100%; height: 100%; font: inherit; text-align: left; border: 1px solid var(--rule); border-top: 0.35rem solid var(--rule); border-radius: 3px; background: var(--box); color: var(--ink); padding: 0.45rem 0.55rem; cursor: pointer; }
.tl-btn b { display: block; font-size: 0.944rem; }
.tl-btn span { display: block; font-size: 0.778rem; color: var(--ink-2); line-height: 1.25; }
.tl-btn.is-past { border-top-color: var(--y-stripe); }
.tl-btn[aria-pressed="true"] { border-color: var(--y-stripe); border-top-color: var(--y-deep); background: var(--y-tint); color: var(--y-deep); }
.tl-btn[aria-pressed="true"] span { color: var(--y-deep); }
.tl-panel { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 1rem; align-items: start; }
.tl-panel h4 { margin: 0 0 0.3rem; font-size: 1rem; }
.tl-panel p { margin: 0; }
.tl-line { fill: none; stroke: #34423c; stroke-width: 1.6; }
.tl-metal { fill: #c9b27a; stroke: #6e5a2a; stroke-width: 1.5; }
.tl-glass { fill: #dff1f7; stroke: #34423c; }
.tl-nuc { fill: #6c4f99; }

/* ---------- model builder, limits, first and last drawings ---------- */
.bld-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.bld-parts { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.bld-parts li { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.2rem; }
.bld-has { font-weight: 700; display: flex; gap: 0.45rem; align-items: center; }
.bld-has input { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
.bld-fb { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; font-size: 0.944rem; }
.bld-fb li { padding: 0.35rem 0.6rem; border-radius: 3px; }
.bld-fb li.is-right { background: var(--ok-bg); border-left: 0.25rem solid var(--ok); }
.bld-fb li.is-wrong { background: var(--bad-bg); border-left: 0.25rem solid var(--bad); }
.bld-fb li.is-todo { background: var(--soft); border-left: 0.25rem solid var(--ink-3); }
.md-wall-top { fill: #e9d6a8; stroke: #8b6a2a; stroke-width: 1.5; }
.md-wall-side { fill: #d9c18a; stroke: #8b6a2a; stroke-width: 1.5; }
.md-wall-back { fill: #f1e3bf; stroke: #8b6a2a; stroke-width: 1.5; }
.md-wall-floor { fill: #e2cd98; stroke: #8b6a2a; stroke-width: 1.5; }
.md-membrane { fill: none; stroke: #7a5aa8; stroke-width: 2; stroke-dasharray: 4 3; }
.md-membrane-a { stroke-dasharray: none; stroke-width: 2.5; }
.md-cyto { fill: rgba(220, 235, 245, 0.55); }
.md-vac { fill: rgba(140, 195, 230, 0.7); stroke: #4f86ab; stroke-width: 1.5; }
.md-nuc { fill: #c3b0e0; stroke: #6c4f99; stroke-width: 1.5; }
.md-chloro { fill: #5aa84b; stroke: #2f6b2a; stroke-width: 1; }
.md-mito { fill: #f2b77e; stroke: #b0662a; stroke-width: 1; }
.md-lead { stroke: #56645e; stroke-width: 1; fill: none; }
.md-wrong { fill: none; stroke: #b3261e; stroke-width: 2.5; stroke-dasharray: 7 5; }
.md-wrong-fill { stroke: #b3261e; stroke-width: 2; }
.lim-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.lim-list label { display: flex; gap: 0.5rem; align-items: start; }
.lim-list input { width: 1.1rem; height: 1.1rem; margin-top: 0.2rem; accent-color: var(--accent); flex: none; }
.lim-list .fb { margin: 0.3rem 0 0 1.6rem; }
.ba-grid { display: flex; flex-wrap: wrap; gap: 1rem; }
.ba-grid figure { margin: 0; }
.ba-grid canvas { display: block; border: 1px solid #c3ccc6; border-radius: 4px; }
.ba-grid figcaption { font-size: 0.889rem; color: var(--ink-2); margin-top: 0.3rem; }

@media (max-width: 860px) {
  .scope-body { grid-template-columns: minmax(0, 1fr); }
  .scope-ctl { grid-column: 1; grid-row: auto; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
  .scope-view, .goals-list, .scope-status, .scope-info { grid-column: 1; }
  .bld-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .crit-grid { grid-template-columns: minmax(0, 1fr); }
  .depth-grid { grid-template-columns: minmax(0, 1fr); }
  .tl { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tl-panel { grid-template-columns: minmax(0, 1fr); }
  .match-list li { grid-template-columns: minmax(0, 1fr); }
  .pad-fields { grid-template-columns: minmax(0, 1fr); }
}
