/* Iron Cross Robotics branding (ironcrossrobotics.org): Barlow type, khaki accent
   #B1AD7D with black text on it, cream page, square corners. Barlow is bundled
   under the SIL Open Font License. Light theme only, even when the device is in dark mode. */
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url(/fonts/barlow-400.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url(/fonts/barlow-500.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600 700; font-display: swap; src: url(/fonts/barlow-600.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url(/fonts/barlow-condensed-600.woff2) format("woff2"); }
:root {
  color-scheme: light;
  --bg: #fff; --card: #fff; --ink: #000; --heading: #363317; --muted: #5d5a44; --line: #dcdacb;
  --accent: #6E6836; --accent-ink: #000; --btn: #B1AD7D; --btn-hover: #C9C69E; --green: #17803d; --green-bg: #e3f5e9;
  --amber: #8a5a00; --amber-bg: #fff2d6; --red: #b3261e; --red-bg: #fde8e6; --blue-bg: #F0EEDC;
  --wire: #000; --radius: 2px;
  --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-heading: "Barlow Condensed", "Barlow", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font-body); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 20px 16px 60px; }
h1 { font: 600 2rem/1.15 var(--font-heading); color: var(--heading); margin: 0 0 4px; }
h2 { font: 600 1.45rem/1.2 var(--font-heading); color: var(--heading); margin: 28px 0 10px; }
h3 { font-size: 1rem; margin: 0 0 6px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.grow { flex: 1; }
a { color: var(--accent); }
.mono, .num { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* brand band: same metrics as the ironcrossrobotics.org header (black, 40px logo,
   16px white links with a khaki underline). Fixed colors, also in dark mode. */
.brand { background: #000; color: #fff; }
.brand-in { max-width: 1500px; margin: 0 auto; padding: 16px clamp(16px,4vw,56px); display: flex; align-items: center; justify-content: space-between; gap: 8px clamp(16px,3vw,40px); flex-wrap: wrap; }
.brand-link { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; flex: 0 0 auto; }
.brand img { height: clamp(32px,3.2vw,40px); width: auto; display: block; }
.orgname { font-weight: 600; letter-spacing: .04em; text-transform: uppercase; font-size: .95rem; }
.brand nav { display: flex; gap: 4px clamp(14px,2.6vw,40px); flex-wrap: wrap; align-items: center; font-size: 16px; }
.brand nav a, .brand nav button { color: #fff; background: none; border: 0; padding: 6px 0; font: inherit; cursor: pointer; text-decoration: none; border-bottom: 1px solid transparent; }
.brand nav a:hover, .brand nav button:hover, .brand nav a.on { border-bottom-color: #B1AD7D; }
.brand nav .account { display: inline-flex; align-items: center; gap: 8px; }
.brand nav .account .who { color: #fff; }
.brand nav .gear { display: inline-flex; color: #B1AD7D; transition: transform .2s; }
.brand nav .account:hover .gear { transform: rotate(45deg); }
.settings-h { margin-top: 12px; }
.intro > :first-child { margin-top: 0; } .intro > :last-child { margin-bottom: 0; }
.intro h3, .intro h4, .intro h5 { font-family: var(--font-heading); color: var(--heading); margin: 14px 0 6px; line-height: 1.2; }
.intro h3 { font-size: 1.5rem; } .intro h4 { font-size: 1.3rem; } .intro h5 { font-size: 1.1rem; }
.labpreview { padding: 10px 0 16px; } .labpreview h3 { margin-top: 10px; }
.attn { margin: 6px 0 0; padding-left: 1.2em; } .attn li { margin: 4px 0; }
.previewqs { margin: 6px 0 0; padding-left: 1.4em; } .previewqs li { margin: 0 0 10px; }
.brand nav .acctwrap { position: relative; }
.brand nav .acctmenu { position: absolute; right: 0; top: calc(100% + 10px); z-index: 50; min-width: 190px; display: flex; flex-direction: column;
  background: #000; border: 1px solid rgba(255,255,255,.2); padding: 6px 0; }
.brand nav .acctmenu[hidden] { display: none; }
.brand nav .acctmenu button { text-align: left; padding: 10px 16px; border-bottom: 0; }
.brand nav .acctmenu button:hover, .brand nav .acctmenu button:focus-visible { background: rgba(255,255,255,.1); }

/* cards, tiles */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 12px 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 16px 0; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.tile .big { font: 600 2.2rem/1.1 var(--font-heading); color: var(--heading); }
.tile .lbl { color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }
.bar { position: relative; height: 10px; background: var(--line); border-radius: 6px; margin: 10px 0 4px; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--btn); border-radius: 6px; }
.bar > b { position: absolute; top: -4px; bottom: -4px; width: 3px; background: var(--ink); border-radius: 2px; }

/* tables */
.tablewrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.c, th.c { text-align: center; }
tr.me td { background: var(--blue-bg); }
.sticky { position: sticky; left: 0; background: var(--card); z-index: 1; }
tr.me .sticky { background: var(--blue-bg); }

/* student main page: each section on its own soft panel for a little variety */
/* Each section is a box with a khaki title strip, so the page reads as a few clear parts. */
.dash-sec { margin: 22px 0; padding: 0 18px 18px; border: 2px solid var(--btn); }
.dash-sec > h2:first-child { margin: 0 -18px 16px; padding: 8px 18px; background: var(--btn); color: #000; font-size: 1.3rem; }
.dash-sec .tiles { margin: 0; }
.sec-summary { background: #F6F5EA; }                   /* cream */
.sec-labs { background: #f3f3f1; }                      /* light grey */
.sec-notes, .sec-workbook { background: #fff; }
.wbtable td:last-child, .wbtable th:last-child { width: 30%; }
.notestable td:first-child a { color: var(--ink); text-decoration: none; }
.notestable td:first-child a:hover { text-decoration: underline; }
.dash-sec .tablewrap, .dash-sec .tile { background: #fff; }
.sec-summary tr.me td, .sec-summary tr.me .sticky { background: #E4E1C4; }
/* Tabs in a box's title strip: the chosen tab takes the box's own color, like a folder tab. */
.tabstrip { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 -18px 16px; padding: 6px 4px 0; background: var(--btn); }
.tabbtn { font: 600 1.3rem/1.2 var(--font-heading); color: #000; background: transparent; border: 0; border-radius: 0; padding: 6px 14px 8px; cursor: pointer; }
.tabbtn:hover:not(.on) { background: var(--btn-hover); }
.tabbtn.on { background: #F6F5EA; }
@media (max-width: 600px) { .dash-sec { padding: 0 10px 12px; margin: 16px -6px; } .dash-sec > h2:first-child { margin: 0 -10px 12px; padding: 8px 10px; } .tabstrip { margin: 0 -10px 12px; padding: 6px 0 0; } .tabbtn { font-size: 1.15rem; padding: 6px 10px 8px; } }

/* student labs table: one lab per row */
.labtable td { vertical-align: middle; }
.labtable .labno { font: 600 1.15rem/1.1 var(--font-heading); color: var(--heading); }
p.labno { font: 600 1.1rem/1 var(--font-heading); color: var(--accent); text-transform: uppercase; letter-spacing: .12em; margin: 8px 0 2px; }
.labrow.passed td:first-child { box-shadow: inset 4px 0 0 var(--green); }
.labrow.in_progress td:first-child { box-shadow: inset 4px 0 0 var(--btn); }
.labrow.waiting td:first-child { box-shadow: inset 4px 0 0 var(--amber); }
.labthumb { padding: 4px; width: 150px; height: 84px; display: flex; align-items: center; justify-content: center; }
.schematic.labthumb svg { width: 100%; height: 76px; max-width: 100%; }
.labthumb text { font-size: 19px; }
.labthumb text.val { font-size: 17px; }

/* chips and ticks */
.chip { display: inline-block; padding: 2px 10px; border-radius: 2px; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.chip.passed { background: var(--green-bg); color: var(--green); }
.chip.waiting { background: var(--amber-bg); color: var(--amber); }
.chip.in_progress, .chip.attempted { background: var(--blue-bg); color: var(--accent); }
.chip.not_started { background: var(--line); color: var(--muted); }
.tick { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--green); color: #fff; font-weight: 700; font-size: .95rem; }
.tick.none { background: transparent; border: 2px dashed var(--line); color: transparent; }
.cellbtn { display: inline-block; min-width: 54px; padding: 3px 6px; border-radius: 2px; text-decoration: none; color: inherit; text-align: center; font-size: .85rem; }
.cellbtn:hover { outline: 2px solid var(--accent); }
.cellbtn.passed { background: var(--green-bg); color: var(--green); font-weight: 700; }
.cellbtn.attempted { background: var(--amber-bg); color: var(--amber); }
.cellbtn.in_progress { background: var(--blue-bg); color: var(--accent); }
.cellbtn.not_started { color: var(--muted); }

/* forms and buttons */
label { display: block; font-weight: 600; margin: 12px 0 4px; }
input[type=text], input[type=email], input[type=number], input[type=datetime-local], select, textarea {
  width: 100%; max-width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 2px; background: var(--card); color: var(--ink); font: inherit; }
textarea { min-height: 120px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9rem; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn { display: inline-block; padding: 10px 22px; border-radius: 0; border: 1px solid var(--btn); background: var(--btn); color: var(--accent-ink); font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; text-align: center; }
.btn:hover:not([disabled]) { background: var(--btn-hover); border-color: var(--btn-hover); }
.btn.secondary { background: transparent; color: var(--ink); }
.btn.secondary:hover:not([disabled]) { background: var(--blue-bg); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.small { padding: 4px 10px; font-size: .85rem; }
/* The student page's row buttons (Start, Continue, Details, View, Open): one look, one width. */
.btn.action { min-width: 96px; padding: 6px 12px; }
.btn[disabled] { opacity: .5; cursor: default; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 14px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; margin: 10px 0; }
.check input { width: auto; }
/* Login: a highlighted box with a khaki title strip, like the student page's boxes. */
.login { max-width: 420px; margin: 48px auto; padding: 0 22px 22px; border: 2px solid var(--btn); background: #fff; }
.login > h1:first-child { margin: 0 -22px 18px; padding: 10px 22px; background: var(--btn); color: #000; font-size: 1.7rem; }
@media (max-width: 600px) { .login { margin: 24px 0; padding: 0 14px 16px; } .login > h1:first-child { margin: 0 -14px 14px; padding: 10px 14px; } }

/* messages */
.banner { border-radius: var(--radius); padding: 12px 16px; margin: 12px 0; border: 1px solid transparent; }
.banner.good { background: var(--green-bg); color: var(--green); border-color: var(--green); }
.banner.warn { background: var(--amber-bg); color: var(--amber); border-color: var(--amber); }
.banner.bad { background: var(--red-bg); color: var(--red); border-color: var(--red); }
.banner.info { background: var(--blue-bg); color: var(--ink); border-color: var(--accent); }
.err { color: var(--red); min-height: 1.4em; margin: 8px 0 0; }

/* the lab */
.schematic { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; overflow-x: auto; }
.schematic svg { display: block; width: 100%; max-width: 640px; height: auto; margin: 0 auto; }
.schematic .wire { fill: none; stroke: var(--wire); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.schematic .plate { stroke: var(--wire); stroke-width: 3; stroke-linecap: round; }
.schematic .dot { fill: var(--wire); }
.schematic .hit { fill: transparent; }
.schematic text { fill: var(--ink); font: 600 13px system-ui, sans-serif; text-anchor: middle; }
.schematic text.val { font-weight: 400; fill: var(--muted); }
.schematic text.bat { text-anchor: end; font-size: 15px; }
.schematic.meter .comp { cursor: pointer; }
.schematic.meter .comp:hover .wire, .schematic .comp.sel .wire { stroke: var(--accent); }
/* Arduino labs: the simulator frame sizes itself to its page; sketches are shown as plain text */
.simframe { display: block; width: 100%; height: 760px; border: 0; background: var(--card); }
pre.sketch { margin: 6px 0 12px; max-height: 420px; overflow: auto; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 2; white-space: pre; }
.readout { min-height: 2.4em; margin-top: 6px; text-align: center; }
.qs { counter-reset: q; padding: 0; list-style: none; }
.q { counter-increment: q; display: grid; grid-template-columns: 2rem 1fr; gap: 4px 8px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.q:last-child { border-bottom: 0; }
.q::before { content: counter(q); font-weight: 700; color: var(--accent); }
.q .ans { grid-column: 2; display: flex; align-items: center; gap: 8px; }
.q input[type=text] { max-width: 180px; }
.q select { max-width: 260px; }
.q .unit { color: var(--muted); }
.q .mark { font-weight: 700; margin-left: 8px; }
.q .mark.ok { color: var(--green); }
.q .mark.no { color: var(--red); }
.score { font-size: 2.4rem; font-weight: 800; line-height: 1; }
.qbar { display: grid; grid-template-columns: 220px 1fr 70px; gap: 10px; align-items: center; margin: 6px 0; font-size: .9rem; }
.qbar .bar { margin: 0; }
@media (max-width: 600px) { .hide-sm { display: none; } .tablewrap td, .tablewrap th { padding: 8px 8px; } .qbar { grid-template-columns: 1fr; } h1 { font-size: 1.35rem; } }
@media print { .brand nav, .btn, .noprint { display: none !important; } body { background: #fff; } }

/* Bench labs (public/bench.js): circuit tabs, schematic with test points, knob and multimeter. */
.bench { border: 2px solid var(--btn); background: #F6F5EA; padding: 0 18px 18px; margin: 12px 0 20px; }
/* The circuit buttons: outlined choices, the open one solid black, so it is plain which circuit is shown. */
.benchhead { margin: 0 -18px; padding: 8px 18px; background: var(--btn); color: #000; font: 600 1.3rem/1.2 var(--font-heading); }
.circuittabs { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 0 6px; }
.ctab { flex: 1 1 140px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 14px; background: #fff; color: #000;
  border: 2px solid var(--btn); border-radius: 0; cursor: pointer; text-align: left; font: inherit; }
.ctab .n { font: 600 .8rem var(--font-body); letter-spacing: .08em; color: var(--accent); }
.ctab .nm { font: 600 1.15rem/1.15 var(--font-heading); }
.ctab:hover:not(.on) { background: var(--blue-bg); border-color: #000; }
.ctab.on { background: #000; border-color: #000; color: #fff; box-shadow: 0 4px 0 var(--btn); }
.ctab.on .n { color: var(--btn); }
.circuittitle { font: 600 1.25rem/1.2 var(--font-heading); color: var(--heading); margin: 12px 0 8px; }
.benchgrid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 760px) { .benchgrid { grid-template-columns: minmax(0, 1fr); } .bench { padding: 0 10px 12px; } .benchhead { margin: 0 -10px; padding: 8px 10px; } .ctab { flex-basis: 40%; } }
.schem { background: #fff; border: 1px solid var(--line); padding: 8px; }
.schem svg { display: block; width: 100%; height: auto; max-height: 340px; }
.schem .w { fill: none; stroke: #000; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.schem .f { fill: #000; }
.schem text { font: 600 14px var(--font-body); fill: #000; }
.schem text.muted { font-weight: 400; fill: var(--muted); }
.schem .tp { fill: #fff; stroke: #000; stroke-width: 2; cursor: pointer; }
.schem .tp:hover { stroke: var(--accent); stroke-width: 3; }
.schem .tp.red { fill: #c62828; stroke: #c62828; }
.schem .tp.black { fill: #000; }
.schem .brk { display: none; cursor: pointer; }
.schem .brk.live { display: inline; }
.schem .brk rect { fill: #fff; stroke: var(--accent); stroke-width: 2; }
.schem .brk text { font-size: 13px; fill: var(--accent); }
.schem .brk.on rect { fill: var(--btn); stroke: #000; }
.schem .brk.on text { fill: #000; }
.schem .led { fill: #fff; stroke: #000; stroke-width: 2.5; }
.schem .glow { fill: #ff3b30; opacity: 0; }
.schem .ring { fill: none; stroke: #000; stroke-width: 2; }
.schem .paper rect { fill: #EDE8D3; stroke: #8f8b5e; stroke-width: 1.5; }
.schem .paper text { font-weight: 400; fill: #5d5a44; }
.benchside { display: grid; gap: 12px; }
.knob, .meter { background: #fff; border: 1px solid var(--line); padding: 12px; }
.knob[hidden] { display: none; }
.knob .lbl, .meter .lbl { margin-bottom: 6px; }
.knob input[type=range] { width: 100%; accent-color: var(--accent); }
.modes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.modes button { flex: 1; padding: 6px 8px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: .9rem; cursor: pointer; white-space: nowrap; }
.modes button.on { background: var(--btn); border-color: var(--btn); font-weight: 600; }
.probes[hidden] { display: none; }
.probes label { margin: 8px 0 4px; font-size: .9rem; }
.pr.red { color: #c62828; } .pr.black { color: #000; }
.lcd { margin-top: 12px; background: #1f2a1f; color: #c8f7c5; font-size: 1.9rem; text-align: right; padding: 10px 14px; letter-spacing: .04em; min-height: 1.6em; }
.meternote { min-height: 1.3em; margin: 6px 0 0; }

/* Math in lab instructions (KaTeX, typeset on the server) */
.intro .katex { font-size: 1.12em; }
.intro .math { overflow-x: auto; overflow-y: hidden; margin: 12px 0; padding: 10px 0; text-align: center; }

/* Multiple choice: lettered options, the picked one outlined */
.q .ans.wide { display: block; }
.choices { display: grid; gap: 6px; max-width: 640px; }
.choice { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 8px 12px; border: 1px solid var(--line); background: #fff; font-weight: 400; cursor: pointer; }
.choice:hover { border-color: var(--accent); }
.choice:has(input:checked) { border: 2px solid #000; padding: 7px 11px; background: var(--blue-bg); }
.choice input { margin: 4px 0 0; flex: 0 0 auto; accent-color: #000; }
.choice .letter { flex: 0 0 auto; width: 1.6em; height: 1.6em; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
  background: var(--btn); color: #000; font-weight: 700; font-size: .9rem; }
.choice:has(input:checked) .letter { background: #000; color: #fff; }
.choice .opt { padding-top: 1px; }
.previewchoices { list-style: none; margin: 4px 0; padding: 0; font-size: .9rem; color: var(--muted); }
.previewchoices li.right { color: var(--green); font-weight: 600; }

/* Lab instructions: each heading in intro.md starts a box with a khaki title strip, tints alternating. */
.intro.card:has(.introsec) { border: 0; padding: 0; background: transparent; }
.introsec { border: 2px solid var(--btn); padding: 0 16px 12px; margin: 0 0 14px; background: #fff; }
.introsec:nth-of-type(3n+1) { background: #F6F5EA; }
.introsec:nth-of-type(3n+2) { background: #fff; }
.introsec:nth-of-type(3n) { background: #f3f3f1; }
.introsec > h3:first-child, .introsec > h4:first-child, .introsec > h5:first-child {
  margin: 0 -16px 10px; padding: 7px 16px; background: var(--btn); color: #000; font: 600 1.25rem/1.2 var(--font-heading); }
.introsec > :last-child { margin-bottom: 0; }
@media (max-width: 600px) { .introsec { padding: 0 10px 10px; } .introsec > h3:first-child, .introsec > h4:first-child, .introsec > h5:first-child { margin: 0 -10px 8px; padding: 7px 10px; } }

/* Pictures in lab instructions */
.intro .figure { margin: 12px auto; text-align: center; }
.intro .figure img { max-width: min(100%, 260px); height: auto; }
