/* Classroom-friendly: big text, strong contrast, big click targets. */
:root {
  --ink: #111; --paper: #fff; --soft: #f3f5f8; --line: #9aa4b2;
  --brand: #0b3d91; --brand-ink: #fff; --ok: #0a6b2d; --bad: #a3141b; --note: #fff7d6;
}
* { box-sizing: border-box; }
html { font-size: 20px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: system-ui, "Segoe UI", Arial, sans-serif; line-height: 1.5; }
header { background: var(--brand); color: var(--brand-ink); }
.bar { max-width: 1000px; margin: 0 auto; padding: .6rem 1rem; display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; align-items: center; }
body.wide .bar, body.wide main { max-width: 1300px; }
.brand { color: #fff; font-weight: 800; font-size: 1.15rem; text-decoration: none; margin-right: auto; }
nav { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; align-items: center; }
nav a, nav .who, nav button.link { color: #fff; font-size: 1rem; }
nav .who { opacity: .9; }
main { max-width: 1000px; margin: 0 auto; padding: 1rem 1rem 4rem; }
h1 { font-size: 1.9rem; line-height: 1.2; margin: .8rem 0 .8rem; }
h2 { font-size: 1.4rem; margin: 1.6rem 0 .6rem; }
h3 { font-size: 1.15rem; margin: 0 0 .5rem; }
a { color: var(--brand); }
p.lead { font-size: 1.1rem; }
.muted { color: #4a5260; }
.card { border: 2px solid var(--line); border-radius: 10px; padding: 1rem 1.2rem; margin: 1rem 0; background: #fff; }
.card.ex { border-color: var(--brand); }
.card.note { background: var(--soft); }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 1.2rem; }
.narrow { max-width: 520px; }
label { display: block; font-weight: 600; margin: .8rem 0 .25rem; }
input[type=text], input[type=email], input[type=password], input:not([type]), select, textarea {
  width: 100%; font: inherit; font-size: 1rem; padding: .55rem .7rem; border: 2px solid #5b6472; border-radius: 6px; background: #fff; color: var(--ink);
}
textarea.code { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }
input:focus, textarea:focus, select:focus, button:focus, a:focus { outline: 3px solid #f0a500; outline-offset: 2px; }
button, .button {
  display: inline-block; font: inherit; font-size: 1rem; font-weight: 700; padding: .55rem 1.1rem; margin: .6rem .3rem .2rem 0;
  border-radius: 8px; border: 2px solid var(--brand); background: #fff; color: var(--brand); cursor: pointer; text-decoration: none; line-height: 1.3;
}
button.primary, .button.primary { background: var(--brand); color: #fff; }
button.secondary { background: var(--soft); }
button.danger { border-color: var(--bad); color: var(--bad); }
button.big, .button.big { font-size: 1.15rem; padding: .8rem 1.4rem; }
button.link { background: none; border: none; padding: 0; margin: 0; text-decoration: underline; font-weight: 400; }
form.inline { display: inline; }
.error { background: #fde8e9; border-left: 6px solid var(--bad); padding: .6rem .9rem; font-weight: 600; }
.flash, .done { background: #e6f4ea; border-left: 6px solid var(--ok); padding: .6rem .9rem; }
.tag { display: inline-block; font-size: .8rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; border: 2px solid #5b6472; color: #333; vertical-align: middle; }
.tag.ok { border-color: var(--ok); color: var(--ok); }
.tag.bad { border-color: var(--bad); color: var(--bad); }

/* lessons list */
ul.lessons { list-style: none; padding: 0; margin: 0; }
.lesson-row { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; border: 2px solid var(--line); border-radius: 10px; padding: .6rem 1rem; margin: .6rem 0; }
.lesson-row.closed { background: var(--soft); color: #4a5260; }
.lesson-row .num { font-size: 1.5rem; font-weight: 800; width: 2rem; text-align: center; }
.lesson-row .t { flex: 1 1 260px; font-weight: 600; }
.lesson-row .act .button { margin: .2rem .3rem .2rem 0; }

/* quizzes */
fieldset { border: 2px solid var(--line); border-radius: 10px; }
fieldset.q legend { font-weight: 700; font-size: 1.1rem; padding: 0 .3rem; }
.qn { color: var(--brand); }
label.opt { display: flex; gap: .7rem; align-items: flex-start; font-weight: 400; padding: .55rem .7rem; margin: .35rem 0; border: 2px solid #d4d9e0; border-radius: 8px; cursor: pointer; }
label.opt:hover { border-color: var(--brand); }
label.opt input, label.pick input, .check input { width: 1.4rem; height: 1.4rem; margin-top: .15rem; flex: none; accent-color: var(--brand); }
h2.qsec { border-bottom: 3px solid var(--brand); padding-bottom: .2rem; }
.scorebox { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; background: var(--soft); border-radius: 10px; padding: 1rem 1.4rem; }
.scorebox div { display: flex; flex-direction: column; }
.scorebox .big { font-size: 2rem; font-weight: 800; }
.scorebox .arrow { font-size: 2rem; }
p.right { color: var(--ok); }
p.wrong { color: var(--bad); }
.mark { font-weight: 800; white-space: nowrap; }
p.answer { background: #e6f4ea; padding: .4rem .7rem; border-radius: 6px; }
.expl { font-style: italic; }

/* workbook */
.workbook .field { margin: .8rem 0; }
.workbook .field.check label { display: flex; gap: .6rem; align-items: center; font-weight: 600; }
fieldset.picks { border: none; padding: 0; margin: .9rem 0; }
fieldset.picks legend { font-weight: 600; padding: 0; }
.pickrow { display: flex; flex-wrap: wrap; gap: .4rem .6rem; margin-top: .3rem; }
label.pick { display: inline-flex; gap: .4rem; align-items: center; font-weight: 400; margin: 0; padding: .3rem .7rem; border: 2px solid #d4d9e0; border-radius: 8px; cursor: pointer; }
pre.prompt { white-space: pre-wrap; background: var(--soft); border: 2px dashed #5b6472; padding: .8rem 1rem; border-radius: 8px; font-family: inherit; font-size: 1rem; }
p.callout { background: var(--note); border-left: 6px solid #c79200; padding: .5rem .9rem; }
.savebar { position: sticky; bottom: 0; background: #fff; border-top: 2px solid var(--line); padding: .3rem 0 .4rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.savestatus { font-weight: 600; }
.savestatus.ok { color: var(--ok); }
.savestatus.bad { color: var(--bad); }
.endbtn { text-align: center; margin: 2rem 0; }
.preview { border: 3px dashed var(--line); padding: 0 1rem; border-radius: 10px; }
details.help summary { cursor: pointer; font-weight: 600; color: var(--brand); }
details.help pre { background: var(--soft); padding: .6rem; font-size: .8rem; overflow-x: auto; }

/* tables */
table { border-collapse: collapse; width: 100%; margin: .6rem 0; }
th, td { border: 1px solid var(--line); padding: .45rem .6rem; text-align: left; vertical-align: top; }
thead th { background: var(--soft); }
td.num { white-space: nowrap; }
td.acts .button, td.acts button { margin: .1rem .3rem .1rem 0; }
progress { width: 6rem; height: .9rem; vertical-align: middle; accent-color: var(--brand); }
.scroll { overflow-x: auto; }
table.answers th { width: 40%; font-weight: 600; background: var(--soft); }
td.pre { white-space: pre-wrap; }
details.card summary { cursor: pointer; list-style: revert; }
details.card summary h3 { display: inline; }
ul.qlist { list-style: none; padding: 0; }
ul.qlist li.right { color: var(--ok); }
.qt { font-weight: 700; }
.optedit { padding: .2rem 1rem .8rem; margin: .7rem 0; }
.optedit label.pick { margin-top: .5rem; }
.temp-pw { font-size: 2.2rem; font-weight: 800; letter-spacing: .15em; font-family: ui-monospace, Consolas, monospace; background: var(--note); display: inline-block; padding: .4rem 1rem; border-radius: 8px; }
ul.struggle li { margin: .3rem 0; }
.stat { font-size: 1.1rem; margin: .3rem 0; }

@media print { header, .savebar, button { display: none; } }
.card > h2:first-child, .card > h3:first-child { margin-top: .2rem; }

/* teaching guide (teacher-only) */
.guide h2 { border-bottom: 3px solid var(--brand); padding-bottom: .2rem; }
.card.say { background: #fff7d6; border-color: #c99a00; border-left-width: 8px; }
.card.say h3::before { content: "🗣 "; }
.card.do { background: #eaf2ff; border-color: var(--brand); border-left-width: 8px; }
.card.do h3::before { content: "🖥 "; }
.card.tip { background: #e6f4ea; border-color: var(--ok); }
.card.warn { background: #fdf0f0; border-color: var(--bad); }
.card.warn h3::before { content: "⚠ "; }
.card.say p { font-size: 1.05rem; }
figure.shot { margin: 1rem 0 1.4rem; }
figure.shot img { display: block; max-width: 100%; height: auto; border: 2px solid var(--line); border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
figure.shot figcaption { font-size: .9rem; color: #4a5260; margin-top: .35rem; font-style: italic; }
.guidenav { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; border-top: 2px solid var(--line); padding-top: .6rem; margin-top: 2rem; }
@media print {
  header, .noprint, .guidenav { display: none !important; }
  html { font-size: 13pt; }
  main { max-width: none; padding: 0; }
  .card, figure.shot { break-inside: avoid; }
  figure.shot img { max-height: 11cm; width: auto; }
}

/* Live slides (added 19 Nov 2026) */
.slide { background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 1.6rem 2rem; font-size: 1.3rem; line-height: 1.5; min-height: 55vh; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.slide h2 { font-size: 2.1rem; margin-top: 0; }
.slide h3 { font-size: 1.5rem; }
.slide li { margin: .35rem 0; }
.slide figure.shot img { max-height: 58vh; width: auto; max-width: 100%; }
.slide pre.prompt { font-size: 1rem; white-space: pre-wrap; }
.slide .card { font-size: 1.15rem; }
.presentbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .8rem 0 1rem; }
.presentbar .jump select { width: auto; max-width: 22rem; display: inline-block; margin: 0 .3rem; }
button.big { font-size: 1.25rem; padding: .7rem 1.6rem; }
.presenter-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.presenter-grid .slide { font-size: 1.05rem; min-height: 0; }
.presenter-grid .slide h2 { font-size: 1.6rem; }
h2.small { font-size: 1rem; color: #4a5260; margin: 0 0 .4rem; }
.livestatus { font-size: 1.05rem; }
.livebar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; background: #eef6ef; border: 1px solid #b7d8bd; border-radius: 10px; padding: .6rem .9rem; margin-bottom: 1rem; }
.livebar .liveacts { margin-left: auto; display: flex; gap: .4rem; }
.callout.live { background: #eef6ef; border-color: #2e7d32; font-size: 1.1rem; }
.sr { position: absolute; left: -9999px; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.signcard { border: 2px dashed #888; padding: 1rem 1.2rem; break-inside: avoid; }
.signcard h2 { margin: 0 0 .5rem; font-size: 1.2rem; }
.signcard p { margin: .3rem 0; }
.signcard p.big { font-size: 1.15rem; }
@media print { .cards { gap: 0; } .signcard { height: 8.6cm; } }
@media (max-width: 900px) { .presenter-grid { grid-template-columns: 1fr; } .slide { font-size: 1.1rem; padding: 1rem; } }
[hidden] { display: none !important; }
button:disabled { opacity: .45; cursor: default; }
