/* Open Makerspace Kit. Built for a cheap phone in a bright shop: big type, big targets, high contrast. */
:root {
  --bg: #f6f4ee; --surface: #ffffff; --ink: #1b1d1a; --muted: #565b53; --line: #cfccc0;
  --brand: #14532d; --brand-ink: #ffffff;
  --green: #1f7a3d; --yellow: #b07a00; --red: #b3261e;
  --green-bg: #e3f3e7; --yellow-bg: #fff2cc; --red-bg: #fde4e1; --info-bg: #e4ecf7;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141613; --surface: #1e211d; --ink: #f0efe9; --muted: #b3b8ae; --line: #3a3e37;
    --brand: #2f8f57; --brand-ink: #0b0d0a;
    --green: #5fd087; --yellow: #f0c04a; --red: #ff8a80;
    --green-bg: #17301f; --yellow-bg: #3a2f0c; --red-bg: #3d1a17; --info-bg: #1b2738;
  }
}
* { box-sizing: border-box; }
html { font-size: 112.5%; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 1rem/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { max-width: 42rem; margin: 0 auto; padding: 1rem 16px 3rem; outline: none; }
h1 { font-size: 1.7rem; line-height: 1.2; margin: .6rem 0 .5rem; text-wrap: balance; }
h2 { font-size: 1.15rem; margin: 1.6rem 0 .4rem; }
a { color: var(--brand); }
small, .fine { color: var(--muted); font-size: .85rem; }
.lead { font-size: 1.15rem; color: var(--muted); margin-top: 0; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: var(--surface); padding: .5rem; z-index: 9; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

.bar { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; padding: .55rem 16px; background: var(--brand); color: var(--brand-ink); }
.bar a { color: inherit; text-decoration: none; }
.brand { font-weight: 700; margin-right: auto; }
.bar nav { display: flex; gap: 1rem; font-size: .95rem; }
.lang { display: flex; border: 2px solid var(--brand-ink); border-radius: 999px; overflow: hidden; }
.lang button { border: 0; background: transparent; color: inherit; font: inherit; font-size: .9rem; padding: .3rem .8rem; min-height: 40px; cursor: pointer; }
.lang button[aria-pressed="true"] { background: var(--brand-ink); color: var(--brand); font-weight: 700; }

.btn, button.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .5rem 1.1rem; border-radius: var(--radius);
  border: 2px solid var(--brand); background: var(--surface); color: var(--brand); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.danger { border-color: var(--red); color: var(--red); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.link { border: 0; background: none; color: var(--brand); font: inherit; text-decoration: underline; cursor: pointer; padding: 0; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.4rem 0; }

.chip { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .85rem; font-weight: 600; }
.chip.green { background: var(--green-bg); color: var(--green); }
.chip.yellow { background: var(--yellow-bg); color: var(--yellow); }
.chip.red { background: var(--red-bg); color: var(--red); }
.banner { padding: .6rem .8rem; border-radius: var(--radius); margin: .7rem 0; font-size: .95rem; }
.banner.draft { background: var(--yellow-bg); border: 1px solid var(--yellow); }
.banner.ok { background: var(--green-bg); border: 1px solid var(--green); }
.banner.info { background: var(--info-bg); }
.stop { margin-top: 2rem; padding: .8rem; border: 2px solid var(--red); border-radius: var(--radius); font-weight: 600; }

.who { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem; }
.row { display: flex; gap: .5rem; margin-top: .3rem; }
label { display: block; font-weight: 600; margin-top: .9rem; }
input:not([type=radio]):not([type=checkbox]), textarea { width: 100%; min-height: 48px; padding: .5rem .7rem; font: inherit; color: var(--ink);
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); }
.row button { min-height: 48px; padding: 0 1rem; border: 0; border-radius: var(--radius); background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 600; }
.error { color: var(--red); font-weight: 600; min-height: 1.5em; }

.tiles { list-style: none; padding: 0; margin: .5rem 0; display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.tile { display: grid; grid-template-columns: auto 1fr; gap: 0 .8rem; padding: .9rem; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); text-decoration: none; color: var(--ink); }
/* Hazard level shows as a solid colour disc behind the icon, not as a stripe on the card edge. */
.tile .icon { background: var(--green-bg); } .tile.yellow .icon { background: var(--yellow-bg); } .tile.red .icon { background: var(--red-bg); }
.tile .icon { grid-row: span 2; font-size: 1.6rem; align-self: center; width: 3rem; height: 3rem; border-radius: 50%; display: grid; place-items: center; }
.tile small { grid-column: 2; }

.progress { list-style: none; padding: 0; display: grid; gap: .25rem; }
.progress li { color: var(--muted); } .progress li.done { color: var(--ink); } .progress li.done span { color: var(--green); }

.stepcount { color: var(--muted); margin: 0; font-size: .9rem; }
.dots { display: flex; gap: 4px; margin: .3rem 0 1rem; }
.dots span { flex: 1; height: 6px; border-radius: 3px; background: var(--line); } .dots span.on { background: var(--brand); }
.lesson { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .4rem 1rem 1rem; }
.lesson.hazards { border: 2px solid var(--red); } .lesson.trouble { border: 2px solid var(--yellow); }
.lesson.hazards h1 { color: var(--red); }
.lesson li { margin: .5rem 0; }
.lesson ul:has(input) { list-style: none; padding-left: 0; }
.lesson input[type=checkbox], .checklist input { width: 1.5rem; height: 1.5rem; vertical-align: -.3rem; margin-right: .5rem; accent-color: var(--brand); }
.lesson table { border-collapse: collapse; width: 100%; font-size: .92rem; display: block; overflow-x: auto; }
.lesson th, .lesson td { border: 1px solid var(--line); padding: .45rem .5rem; text-align: left; vertical-align: top; }
@media (max-width: 34rem) {
  /* On a phone a three-column table is unreadable: each row becomes its own small card. */
  .lesson table, .lesson tbody, .lesson tr, .lesson td { display: block; width: 100%; }
  .lesson thead { display: none; }
  .lesson tr { border: 1px solid var(--line); border-radius: var(--radius); margin: .7rem 0; padding: .3rem .7rem; }
  .lesson td { border: 0; padding: .25rem 0; }
  .lesson td:first-child { font-weight: 700; }
  .lesson td:nth-child(2) { color: var(--muted); }
}
.local { border: 2px dashed var(--brand); border-radius: var(--radius); padding: 0 1rem .5rem; margin: 1rem 0; }

fieldset { border: 0; padding: 0; margin: 0; }
legend { font-size: 1.2rem; font-weight: 600; margin-bottom: .8rem; }
.opt { display: flex; gap: .7rem; align-items: flex-start; font-weight: 400; padding: .8rem; margin: .5rem 0; background: var(--surface);
  border: 2px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.opt input { width: 1.4rem; height: 1.4rem; flex: none; margin-top: .15rem; accent-color: var(--brand); }
.opt.right { border-color: var(--green); background: var(--green-bg); } .opt.wrongpick { border-color: var(--red); background: var(--red-bg); }
.feedback { padding: .7rem .9rem; border-radius: var(--radius); } .feedback.ok { background: var(--green-bg); } .feedback.bad { background: var(--red-bg); }
.bigscore { font-size: 2rem; font-weight: 700; margin: .5rem 0; }
.checklist { list-style: none; padding: 0; } .checklist li { padding: .55rem 0; border-bottom: 1px solid var(--line); }
.checklist label { font-weight: 400; margin: 0; } .bang { color: var(--red); font-size: 1.15em; }

.cards { display: grid; gap: 1rem; } .cards.both { grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); }
.cardsheet { position: relative; background: #fff; color: #111; border: 3px solid #111; border-top: 22px solid var(--green); border-radius: 0; padding: .6rem 1.1rem .8rem; font-size: 1.05rem; overflow: hidden; }
.cardsheet.yellow { border-top-color: #e0a800; } .cardsheet.red { border-top-color: #b3261e; }
.cardsheet header { display: flex; justify-content: space-between; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.cardsheet footer { border-top: 2px solid #111; margin-top: .6rem; padding-top: .4rem; font-size: .78rem; }
.cardsheet li { margin: .3rem 0; }
.watermark { position: absolute; inset: 40% 0 auto 0; text-align: center; font-size: 3.2rem; font-weight: 900; color: rgba(179, 38, 30, .16); transform: rotate(-18deg); margin: 0; pointer-events: none; }
.cert { background: #fff; color: #111; border: 4px double #111; padding: 2rem 1.5rem; text-align: center; }
.cert p, .cert h1 { text-wrap: balance; }
.cert .name { font-size: 1.8rem; font-weight: 700; margin: .3rem 0; } .cert .what { font-size: 1.2rem; font-weight: 600; }
.cert .site { text-transform: uppercase; letter-spacing: .08em; font-weight: 700; } .cert .fine { color: #444; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 1rem 16px 2rem; }
.print-only { display: none; }

@media print {
  .no-print { display: none !important; } .print-only { display: block; }
  body { background: #fff; color: #000; } main { max-width: none; padding: 0; }
  .cards.both { grid-template-columns: 1fr 1fr; } .cardsheet, .cert { break-inside: avoid; }
  .banner { border: 1px solid #000; background: none; }
}
@media (prefers-reduced-motion: no-preference) { .btn, .opt { transition: background .12s, border-color .12s; } }
