/* STEMGuyana Environmental Science — one stylesheet for every page. */
:root {
  --bg: #f3f8f1; --card: #ffffff; --ink: #0b2533; --muted: #4b6460; --line: #d5e3d6;
  --brand: #0f3d2e; --leaf: #2f8f3a; --lime: #b7e84a; --sun: #ff8d22; --sky: #bfe6f2;
  --good: #1f7a3a; --good-bg: #e3f5e6; --bad: #b42318; --bad-bg: #fdecea; --warn-bg: #fff4dc;
  --radius: 14px; --shadow: 0 6px 20px rgba(15, 61, 46, .10);
  --top: 58px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink); background: var(--bg);
}
body.contrast { --bg: #ffffff; --ink: #000; --muted: #1d1d1d; --line: #000; --leaf: #005a16; --good: #004d12; --bad: #8a0000; --brand: #000; }
body.contrast .btn, body.contrast .chip-btn, body.contrast .box, body.contrast .card { border: 2px solid #000; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); line-height: 1.45; font-size: 16px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; }
h2 { font-size: 1.25rem; } h3 { font-size: 1.02rem; }
p { margin: 0 0 .7em; }
a { color: var(--leaf); }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.tiny { font-size: .82rem; color: var(--muted); }
.lead { font-size: 1.1rem; color: var(--muted); }
.loading { padding: 40px; text-align: center; color: var(--muted); }

/* buttons and chips */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 650; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--leaf); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.btn.primary:hover { background: #267a30; }
.btn.big { padding: 13px 20px; font-size: 1.05rem; }
.btn.small { padding: 5px 10px; font-size: .85rem; }
.btn.go-next { margin-top: 10px; width: 100%; justify-content: center; background: var(--brand); color: #fff; border-color: var(--brand); }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chip-btn { border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.1); color: #fff; padding: 6px 10px; border-radius: 999px; cursor: pointer; font-size: .85rem; }
.chip-btn:hover { background: rgba(255,255,255,.2); }
.chip { display: inline-block; padding: 4px 10px; border-radius: 999px; background: #eef4ee; border: 1px solid var(--line); font-size: .78rem; font-weight: 700; white-space: nowrap; }
.chip.sim { background: #fff1dc; border-color: #f2c48b; color: #8a4b00; }
.chip.warn { background: var(--bad-bg); color: var(--bad); }
.chip.teacher-chip { background: #e8e4ff; border-color: #c5bcff; color: #3a2a9b; }
.notice { background: var(--warn-bg); border: 1px solid #f0d38f; padding: 12px 14px; border-radius: 10px; margin: 10px 0; }
.success { background: var(--good-bg); border: 1px solid #a9dcb3; color: var(--good); padding: 10px 12px; border-radius: 10px; margin: 10px 0; font-weight: 650; }

/* header */
.topbar { position: sticky; top: 0; z-index: 50; height: var(--top); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; background: var(--brand); color: #fff; }
.brand { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; white-space: nowrap; }
.brand .logo { font-size: 1.4rem; }
.top-actions { display: flex; align-items: center; gap: 6px; overflow-x: auto; }
.user { font-size: .85rem; opacity: .85; padding: 0 4px; white-space: nowrap; }

/* sign in */
.signin-page { background: linear-gradient(160deg, #0f3d2e 0%, #2f8f3a 60%, #b7e84a 130%); min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.signin { width: min(420px, 100%); background: #fff; border-radius: 20px; padding: 28px; box-shadow: var(--shadow); }
.signin h1 { font-size: 1.6rem; font-weight: 500; }
.signin-art { font-size: 2rem; display: flex; gap: 14px; margin-bottom: 10px; }
.signin label { display: block; font-weight: 650; margin: 12px 0 4px; }
.signin input { width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); font: inherit; }
.signin .btn { width: 100%; justify-content: center; margin-top: 16px; }
.error { color: var(--bad); min-height: 1.2em; margin-top: 8px; }

/* course home */
.page.narrow, .home { max-width: 1180px; margin: 0 auto; padding: 22px 16px 60px; }
.page.narrow { max-width: 760px; }
.back { display: inline-block; margin-bottom: 8px; font-weight: 650; text-decoration: none; }
.hero { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; background: linear-gradient(135deg, #fff 0%, #eaf7e6 100%); border: 1px solid var(--line); border-radius: 20px; padding: 24px; box-shadow: var(--shadow); }
.hero h1 { font-size: 2.1rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 800; color: var(--leaf); }
.sim-note { margin-top: 14px; }
.station-card { background: var(--brand); color: #fff; border-radius: 16px; padding: 16px 18px; }
.station-card .tiny { color: #cfe5d6; }
.station-parts { list-style: none; padding: 0; margin: 8px 0; }
.station-parts li { padding: 3px 0; opacity: .6; }
.station-parts li.on { opacity: 1; color: var(--lime); font-weight: 700; }
.badges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 18px 0 8px; }
.badge { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: #fff; border: 1px dashed var(--line); color: var(--muted); }
.badge span { grid-row: span 2; font-size: 1.6rem; }
.badge.earned { border: 1px solid #e9c46a; background: #fff8e1; color: var(--ink); }
.badge.earned span { color: #e9a400; }
.unit { margin-top: 22px; }
.unit h2 span { display: inline-block; background: var(--leaf); color: #fff; border-radius: 8px; padding: 2px 8px; font-size: .8rem; margin-right: 6px; vertical-align: middle; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.card-link { display: block; padding: 14px 16px; color: inherit; text-decoration: none; flex: 1; }
a.card-link:hover { background: #f6fbf4; border-radius: var(--radius); }
.card.planned, .card.locked { opacity: .7; }
.card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.num { font-weight: 900; font-size: 1.4rem; color: var(--leaf); }
.status { font-size: .74rem; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: #eef4ee; }
.status.done { background: var(--good-bg); color: var(--good); }
.status.started { background: #e1f3fb; color: #08607a; }
.status.locked, .status.planned { background: #eceff1; color: #546e7a; }
.status.concept_only { background: #fff1dc; color: #8a4b00; }
.status.specified_unverified { background: #e1f3fb; color: #08607a; }
.dq { font-style: italic; color: var(--muted); }
.review-tag { display: inline-block; margin-top: 4px; font-size: .78rem; font-weight: 800; color: #9a6a00; }
.unlock { display: flex; gap: 6px; align-items: center; padding: 8px 16px; border-top: 1px solid var(--line); font-size: .85rem; cursor: pointer; }

/* lesson layout */
.lesson { display: flex; flex-direction: column; height: calc(100vh - var(--top)); }
.lesson-top { padding: 10px 16px 8px; background: #fff; border-bottom: 1px solid var(--line); }
.lesson-title { display: flex; align-items: flex-start; gap: 14px; }
.lesson-title .back { margin: 4px 0 0; white-space: nowrap; }
.lesson-title > div:nth-child(2) { flex: 1; min-width: 0; }
.lesson-title small { color: var(--muted); font-weight: 650; }
.lesson-title h1 { font-size: 1.35rem; margin: 0; }
.lesson-title .dq { margin: 0; }
.top-chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.segbar { display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; padding-bottom: 2px; }
.seg { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: #f7faf6; cursor: pointer; white-space: nowrap; }
.seg-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #dfe9df; font-weight: 800; font-size: .8rem; }
.seg-l { font-weight: 700; }
.seg-m { font-size: .76rem; color: var(--muted); }
.seg.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.seg.active .seg-m { color: #cfe5d6; }
.seg.active .seg-n { background: var(--lime); color: var(--brand); }
.seg.done .seg-n { background: var(--leaf); color: #fff; }
.seg.done .seg-l::after { content: " ✓"; color: var(--leaf); }
.seg.active.done .seg-l::after { color: var(--lime); }
.lesson-body { flex: 1; display: grid; grid-template-columns: minmax(300px, 360px) 1fr minmax(260px, 300px); min-height: 0; }
.panel { overflow-y: auto; padding: 14px 16px 30px; background: #fff; }
.panel.left { border-right: 1px solid var(--line); }
.panel.right { border-left: 1px solid var(--line); background: #fbfdfa; }
.stage { position: relative; min-height: 0; background: var(--sky); overflow: hidden; }
.wb-host { position: absolute; inset: 0; }
.wb-host canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.stage-tools { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: center; z-index: 5; max-width: calc(100% - 20px); }
.toolgroup { display: inline-flex; background: rgba(11, 37, 51, .82); border-radius: 12px; padding: 3px; gap: 3px; }
.tool { border: 0; background: rgba(11, 37, 51, .82); color: #fff; padding: 8px 12px; border-radius: 10px; cursor: pointer; font-weight: 700; font-size: .9rem; }
.toolgroup .tool { background: transparent; }
.tool.on { background: var(--lime) !important; color: var(--brand); }
.tool.run { background: var(--sun); color: #2b1400; }
.stage-help { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); background: rgba(255,255,255,.88); padding: 5px 12px; border-radius: 999px; font-size: .82rem; font-weight: 650; z-index: 5; white-space: nowrap; max-width: calc(100% - 20px); overflow: hidden; text-overflow: ellipsis; }

/* labels drawn over the 3D view */
.wb-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 4; }
.wb-label { position: absolute; left: 0; top: 0; padding: 3px 8px; border-radius: 8px; font-size: .74rem; font-weight: 750; white-space: nowrap; background: rgba(11, 37, 51, .85); color: #fff; }
.wb-zone { background: #2f8f3a; }
.wb-snap { background: var(--sun); color: #2b1400; font-size: .85rem; }
.wb-port { background: #fff; color: var(--ink); border-left: 5px solid var(--kind, #999); }
.wb-port.selected { background: var(--lime); }
.wb-packet { background: #0b6f86; }
.wb-stop { background: #e5383b; }

/* left panel pieces */
.caption { background: #0b2533; color: #fff; border-radius: 14px; padding: 16px 18px; font-size: 1.12rem; min-height: 120px; position: relative; }
.caption p { margin: 0; }
.beat-no { position: absolute; top: 8px; right: 12px; font-size: .74rem; opacity: .7; }
.scene-controls { display: flex; gap: 8px; margin: 10px 0; }
.scene-controls .primary { flex: 1; justify-content: center; }
.dots { display: flex; gap: 6px; margin-bottom: 8px; }
.dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--leaf); background: #fff; padding: 0; cursor: pointer; }
.dot.seen { background: #a9dcb3; }
.dot.on { background: var(--leaf); }
.vocab { display: grid; gap: 8px; }
.word { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.word b { display: block; }
.word span { font-size: .9rem; color: var(--muted); }
.steps { list-style: none; padding: 0; margin: 10px 0; }
.step { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; margin-bottom: 6px; }
.step.open { border-color: var(--leaf); box-shadow: 0 0 0 3px #e3f5e6; }
.step.ok .step-head { color: var(--good); }
.step-head { display: flex; gap: 8px; align-items: center; }
.tick { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #e6efe6; font-weight: 800; font-size: .82rem; flex: none; }
.step.ok .tick { background: var(--leaf); color: #fff; }
.step p { margin: 6px 0; }
.checks { list-style: none; padding: 0; margin: 6px 0; font-size: .9rem; }
.checks li { padding: 2px 0; color: var(--muted); }
.checks li.ok { color: var(--good); font-weight: 650; }
.explore { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.explore .seen { background: var(--good-bg); border-color: var(--good); color: var(--good); }
.hint {background: #fffbe6; border-radius: 8px; padding: 6px 8px; font-size: .9rem; }
.feedback { min-height: 1.2em; font-weight: 650; color: #08607a; }
.fault { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.fault.live { border-color: #e5383b; box-shadow: 0 0 0 3px #fdecea; }
.fault.solved { background: var(--good-bg); border-color: #a9dcb3; }
.fault.waiting { opacity: .55; }
.fault-steps { padding-left: 20px; }
.fault-steps li { margin-bottom: 8px; }
.fault-steps li.ok::marker { color: var(--good); }
.choices { display: grid; gap: 6px; margin-top: 6px; }
.choice { text-align: left; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.choice:hover:not(:disabled) { border-color: var(--leaf); }
.choice.right { background: var(--good-bg); border-color: var(--good); font-weight: 700; }
.choice.wrong { background: var(--bad-bg); border-color: var(--bad); }
.choice.key { box-shadow: inset 4px 0 0 #6c5ce7; }
.q { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.q.right { border-color: #a9dcb3; }
.q .from { color: #9a6a00; font-weight: 700; }
.explain { font-size: .9rem; color: var(--good); margin: 6px 0 0; }
.score { font-size: 1rem; margin-bottom: 10px; }
.jp { display: block; margin-bottom: 12px; }
.jp span { display: block; font-weight: 650; margin-bottom: 4px; }
.jp textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font: inherit; resize: vertical; }
.teacher-notes { margin-top: 18px; background: #f4f2ff; border: 1px solid #d8d2ff; border-radius: 12px; padding: 12px; }
.teacher-notes h3 { color: #3a2a9b; }
.teacher-notes details { margin-top: 6px; }
.teacher-notes summary { cursor: pointer; font-weight: 700; }
.teacher-notes ul { padding-left: 18px; margin: 6px 0; }
.teacher-notes dt { font-weight: 700; margin-top: 6px; }
.teacher-notes dd { margin: 0 0 4px; }
.rubric { border-collapse: collapse; font-size: .78rem; }
.rubric th, .rubric td { border: 1px solid #d8d2ff; padding: 4px; vertical-align: top; }

/* right panel pieces */
.box { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.box.think { background: #fff8e1; }
.inspector .status { display: inline-block; margin-bottom: 6px; }
.ports { list-style: none; padding: 0; margin: 6px 0; font-size: .9rem; }
.ports i, .links i, .legend i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.ports small { color: var(--muted); }
.tray { display: grid; gap: 6px; }
.part { text-align: left; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 8px 10px; cursor: grab; touch-action: none; }
.part b { display: block; }
.part span { font-size: .82rem; color: var(--muted); }
.part:hover { border-color: var(--leaf); }
.part.selected { border-color: var(--sun); box-shadow: 0 0 0 3px #ffe2c4; }
.zone-list { display: flex; flex-wrap: wrap; gap: 6px; }
.links { list-style: none; padding: 0; margin: 4px 0; font-size: .85rem; }
.links li { display: flex; align-items: center; gap: 4px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.links span { flex: 1; }
.x { border: 0; background: none; color: var(--bad); cursor: pointer; font-weight: 800; padding: 2px 6px; }
.kbd-connect { margin: 8px 0; font-size: .85rem; }
.kbd-connect label { display: block; margin: 4px 0; }
.kbd-connect select { width: 100%; padding: 5px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: .74rem; color: var(--muted); margin: 6px 0 0; }
.readings { width: 100%; border-collapse: collapse; font-size: .78rem; }
.readings th, .readings td { border-bottom: 1px solid var(--line); padding: 3px 4px; text-align: left; }
.readings tr.missing td { color: var(--bad); }
.class-progress summary { font-weight: 800; cursor: pointer; }
.progress-table { width: 100%; border-collapse: collapse; font-size: .74rem; margin-top: 6px; }
.progress-table th, .progress-table td { border-bottom: 1px solid var(--line); padding: 3px; text-align: left; }

/* toast and celebration */
#toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; z-index: 100; max-width: min(560px, calc(100% - 32px)); background: #0b2533; color: #fff; padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow); transition: .25s; font-weight: 600; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.good { background: var(--good); }
#toast.bad { background: var(--bad); }
.burst { position: absolute; left: 50%; top: 45%; z-index: 6; pointer-events: none; }
.burst i { position: absolute; width: 10px; height: 10px; border-radius: 2px; background: var(--lime); animation: burst 1.2s ease-out forwards; transform: rotate(var(--a)) translateY(0); }
.burst i:nth-child(3n) { background: var(--sun); }
.burst i:nth-child(3n+1) { background: #26c6e6; }
@keyframes burst { to { transform: rotate(var(--a)) translateY(calc(-1 * var(--d) * 2)); opacity: 0; } }

#printRecord { display: none; }
@media print {
  body > *:not(#printRecord) { display: none !important; }
  #printRecord { display: block; padding: 10px; color: #000; }
  #printRecord h1 { font-size: 18pt; } #printRecord h2 { font-size: 13pt; margin-top: 14px; }
}

/* narrower screens: the 3D view on top, panels below */
@media (max-width: 1100px) {
  .lesson-body { grid-template-columns: minmax(280px, 330px) 1fr; }
  .panel.right { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; align-content: start; }
  .lesson { height: auto; min-height: calc(100vh - var(--top)); }
  .lesson-body { grid-template-rows: minmax(480px, calc(100vh - 210px)) auto; }
}
@media (max-width: 760px) {
  .topbar { height: auto; min-height: var(--top); flex-wrap: wrap; padding: 8px 16px; }
  .brand span:last-child { font-size: .9rem; }
  .top-actions { width: 100%; padding-bottom: 2px; }
  .chip-btn, .tool { white-space: nowrap; }
  .chip-btn { padding: 5px 9px; font-size: .8rem; }
  .tool { padding: 7px 10px; font-size: .84rem; }
  .stage-tools { bottom: 8px; gap: 4px; }
  .hero { grid-template-columns: 1fr; padding: 18px; }
  .hero h1 { font-size: 1.6rem; }
  .badges { grid-template-columns: repeat(2, 1fr); }
  .cards { grid-template-columns: 1fr; }
  .lesson-title { flex-wrap: wrap; }
  .top-chips { justify-content: flex-start; }
  .lesson-body { display: flex; flex-direction: column; }
  .stage { height: 56vh; min-height: 340px; order: 1; }
  .panel.left { order: 2; border-right: 0; }
  .panel.right { order: 3; display: block; }
  .stage-help { display: none; }
}
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } .burst { display: none; } }
.wb-board { background: #1f6f3a; font-size: .8rem; }
.wb-edge { background: rgba(255,255,255,.85); color: #1f6f3a; font-size: .68rem; }
.wb-chip { background: rgba(255,255,255,.92); color: #111; font-size: .66rem; padding: 1px 5px; transform-origin: center; }
.wb-readout { background: #fff; color: #0b2533; border: 2px solid #9b5de5; font-size: .82rem; }

/* sensor lab and review challenge */
.lab { border-color: #c9b2f0; background: #faf7ff; }
.soil-btns { display: flex; gap: 6px; margin: 6px 0 10px; }
.soil-btns .btn { flex: 1; justify-content: center; }
.btn.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.chain { display: flex; align-items: stretch; gap: 4px; margin-bottom: 10px; }
.chain > i { align-self: center; font-style: normal; color: var(--muted); }
.link-step { flex: 1; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px; text-align: center; min-width: 0; }
.link-step small { display: block; font-size: .68rem; font-weight: 800; color: #6a4caf; }
.link-step b { display: block; font-size: 1.15rem; }
.link-step span { display: block; font-size: .68rem; color: var(--muted); line-height: 1.2; }
.link-step.alert { border-color: var(--bad); background: var(--bad-bg); }
.link-step.alert b { color: var(--bad); }
.lab-field { display: block; font-size: .88rem; font-weight: 650; margin: 8px 0 4px; }
.lab-field select, .lab-field input[type=range] { display: block; width: 100%; margin-top: 4px; }
.datasheet { font-size: .82rem; background: #fff; border: 1px dashed #c9b2f0; border-radius: 8px; padding: 6px 8px; }
.challenge { border: 2px solid #e9c46a; background: #fffbea; border-radius: 12px; padding: 10px; margin-bottom: 12px; }
.challenge h2 { font-size: 1.05rem; }

/* safety checkpoint, energy lab, firmware editor */
.safety { display: grid; gap: 8px; margin: 8px 0; }
.safety-item { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.safety-item p { margin: 0 0 4px; }
.safety-item.right { border-color: #a9dcb3; background: var(--good-bg); }
.safety-item.wrong { border-color: var(--bad); background: var(--bad-bg); }
.check { display: flex; gap: 6px; align-items: center; font-size: .88rem; margin: 6px 0; }
.chart { width: 100%; height: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; margin: 8px 0 4px; }
.bad { color: var(--bad); }
.program { list-style: none; counter-reset: blk; padding: 0; margin: 8px 0; }
.program li { counter-increment: blk; display: flex; align-items: center; gap: 2px; background: #1f3b4d; color: #fff; border-radius: 8px; padding: 5px 6px; margin-bottom: 4px; font-size: .84rem; }
.program li::before { content: counter(blk); font-weight: 800; color: var(--lime); width: 18px; }
.program li.once { background: #3a2a9b; }
.program li.empty { background: #eef4ee; color: var(--muted); }
.program li.empty::before { content: ""; }
.program span { flex: 1; }
.program .x { color: #fff; padding: 2px 5px; }
.program .x:disabled { opacity: .3; }
.palette summary { cursor: pointer; font-weight: 700; font-size: .88rem; }
.palette-btns { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 8px; }
.trace { padding-left: 20px; font-size: .8rem; margin: 8px 0 0; }
.trace li.ok { color: var(--good); }
.trace li.warn { color: #9a6a00; }
.trace li.bad { color: var(--bad); font-weight: 700; }
.links li.reversed { color: var(--bad); font-weight: 700; }

/* Unit 3 labs */
.readings.mini { margin: 6px 0; }
.readings tr.dup td { color: #9a6a00; font-weight: 700; }
.fields { display: grid; gap: 2px; margin: 6px 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.burst-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; margin: 8px 0 4px; }
.burst-grid span { text-align: center; font-size: .7rem; font-weight: 800; border-radius: 4px; padding: 3px 0; color: #fff; }
.burst-grid .ok { background: #2f8f3a; }
.burst-grid .lost { background: #e5383b; }
.burst-grid .dup { background: #ffb703; color: #3a2500; }
.dash-edit { width: 100%; font-size: .85rem; }
.dash-edit select { width: 100%; }
.dash-preview { display: grid; gap: 6px; margin-top: 8px; }
.dash-chart { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px; }
.dash-chart figcaption { font-size: .8rem; font-weight: 700; }
.dash-chart figcaption span { color: var(--muted); font-weight: 500; }
.dash-chart svg { width: 100%; height: auto; display: block; }
.wb-zone.small { font-size: .62rem; padding: 1px 5px; }
.lab-field input[type=number] { display: block; width: 100%; margin-top: 4px; padding: 4px; }
.writing { margin: 6px 0; }
.report-sum { padding-left: 18px; font-size: .88rem; }
@media print {
  #printRecord.cert { display: grid; place-items: center; min-height: 90vh; }
  .cert-box { border: 6px double #2f8f3a; padding: 40px 50px; text-align: center; max-width: 700px; }
  .cert-box h1 { font-size: 28pt; margin: 10px 0; } .cert-box h2 { font-size: 22pt; color: #0f3d2e; }
  .cert-top { letter-spacing: .1em; text-transform: uppercase; color: #2f8f3a; font-weight: 700; }
}
.placed summary { cursor: pointer; font-size: .85rem; font-weight: 700; margin-top: 8px; }
