:root { --ink:#1d2433; --muted:#5b6475; --bg:#eef1f6; --card:#fff; --accent:#1f4fd8; --line:#d5dae4; --err:#b3261e; --ok:#1b6e3c; }
* { box-sizing: border-box; }
body { margin:0; min-height:100vh; display:grid; place-items:start center; padding:clamp(1rem,6vh,3rem) 1rem;
       background:var(--bg); color:var(--ink); font:16px/1.5 system-ui,-apple-system,"Segoe UI",sans-serif; }
.card { width:100%; max-width:26rem; background:var(--card); padding:2rem; border:1px solid var(--line); border-radius:10px; }
.card.wide { max-width:48rem; }
h1 { font-size:1.5rem; margin:0 0 1.25rem; line-height:1.25; }
h2 { font-size:1.15rem; margin:1.75rem 0 .75rem; }
label { display:block; margin-bottom:1rem; font-weight:600; font-size:.95rem; }
label small { font-weight:400; color:var(--muted); }
input[type=text], input[type=email], input[type=password] { display:block; width:100%; margin-top:.35rem; padding:.65rem .75rem; font:inherit;
        border:1px solid var(--line); border-radius:6px; background:#fff; color:var(--ink); }
input:focus, button:focus-visible, a:focus-visible { outline:3px solid #9db6ff; outline-offset:1px; border-color:var(--accent); }
button, .btn { display:inline-block; width:100%; padding:.75rem; font:inherit; font-weight:600; color:#fff; background:var(--accent);
         border:1px solid var(--accent); border-radius:6px; cursor:pointer; text-align:center; text-decoration:none; }
button:hover, .btn:hover { background:#173fb0; }
button.secondary, .btn.secondary { background:transparent; color:var(--accent); }
button.secondary:hover, .btn.secondary:hover { background:#e8eefc; }
button.danger { background:transparent; color:var(--err); border-color:var(--err); }
button.danger:hover { background:#fde8e6; }
button.small, .btn.small { width:auto; padding:.4rem .8rem; font-size:.9rem; }
.msg { padding:.6rem .8rem; border-radius:6px; margin:0 0 1rem; font-size:.95rem; }
.msg.error { background:#fde8e6; color:var(--err); }
.msg.ok { background:#e3f4ea; color:var(--ok); }
.alt { margin:1.25rem 0 0; text-align:center; color:var(--muted); font-size:.95rem; }
.muted { color:var(--muted); font-size:.95rem; }
a { color:var(--accent); }
.btn { width:auto; color:#fff; }
.btn.secondary { color:var(--accent); }

.list { list-style:none; margin:0; padding:0; }
.list li { display:flex; justify-content:space-between; gap:1rem; align-items:center; padding:.9rem 0; border-top:1px solid var(--line); }
.list li:last-child { border-bottom:1px solid var(--line); }
.actions { display:flex; gap:.6rem; align-items:center; flex-shrink:0; }
.actions form { margin:0; }

.question { border:1px solid var(--line); border-radius:8px; padding:1rem 1.1rem; margin:0 0 1rem; }
.question legend { font-weight:600; padding:0 .4rem; }
.question.right { border-color:#9bd1b0; }
.question.wrong { border-color:#f0b4af; }
.choice { display:flex; gap:.6rem; align-items:center; padding:.45rem .6rem; margin:.25rem 0; border-radius:6px; font-weight:400; }
label.choice { cursor:pointer; margin-bottom:.25rem; }
label.choice:hover { background:#f3f6fc; }
.choice em { margin-left:auto; font-size:.85rem; font-style:normal; font-weight:600; }
.choice.is-correct { background:#e3f4ea; color:var(--ok); }
.choice.is-wrong { background:#fde8e6; color:var(--err); }
.choice-input { display:flex; gap:.6rem; align-items:center; }
.choice-input input[type=text] { margin-top:0; }
.question form { margin-top:.75rem; }
.score { font-size:1.2rem; margin:0 0 1.25rem; }
.inline-form { display:grid; gap:0; }

.table-wrap { overflow-x:auto; }
table { width:100%; border-collapse:collapse; font-size:.95rem; }
th, td { text-align:left; padding:.5rem .6rem; border-bottom:1px solid var(--line); white-space:nowrap; }
th { color:var(--muted); font-weight:600; }
@media (max-width:30rem) { .card { padding:1.25rem; } .list li { flex-direction:column; align-items:flex-start; } }

/* ---- classes, notes, activities, gradebook ---- */
textarea, select { display:block; width:100%; margin-top:.35rem; padding:.65rem .75rem; font:inherit; color:var(--ink);
        border:1px solid var(--line); border-radius:6px; background:#fff; }
textarea { font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size:.92rem; line-height:1.45; resize:vertical; }
textarea:focus, select:focus { outline:3px solid #9db6ff; outline-offset:1px; border-color:var(--accent); }
label.check { display:flex; gap:.5rem; align-items:center; font-weight:400; }
label.check input { width:auto; margin:0; }
pre { background:#f3f5fa; border:1px solid var(--line); border-radius:6px; padding:.75rem; overflow-x:auto; font-size:.9rem; }
code { background:#f3f5fa; padding:.1rem .3rem; border-radius:4px; font-size:.92em; }
.help { margin:0 0 1rem; padding:.6rem .9rem; border:1px solid var(--line); border-radius:8px; background:#fafbfd; }
.help summary { cursor:pointer; font-weight:600; }

.code { font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-weight:700; letter-spacing:.08em; }
.code.big { font-size:2rem; line-height:1.2; margin:.15rem 0; }
.code-box { display:flex; justify-content:space-between; gap:1rem; align-items:center; flex-wrap:wrap;
            padding:1rem 1.2rem; margin-bottom:1rem; border:2px dashed var(--accent); border-radius:10px; background:#f4f7ff; }

.note { line-height:1.65; }
.note h2, .note h3, .note h4 { margin:1.4rem 0 .5rem; }
.note img { max-width:100%; height:auto; border-radius:6px; }
.note ul { padding-left:1.4rem; }
.reveal { margin:.6rem 0; padding:.6rem .9rem; border:1px solid var(--line); border-radius:8px; background:#fafbfd; }
.reveal summary { cursor:pointer; font-weight:600; color:var(--accent); }
.video { position:relative; padding-top:56.25%; margin:1rem 0; }
.video iframe { position:absolute; inset:0; width:100%; height:100%; border:0; border-radius:8px; }

button.flash-card { width:100%; min-height:9rem; margin:.5rem 0 1rem; padding:1.5rem; font-size:1.35rem; font-weight:600;
                    color:var(--ink); background:#fff; border:2px solid var(--accent); border-radius:12px; }
button.flash-card:hover { background:#f4f7ff; }

.fb-line { line-height:2.4; margin:.4rem 0; }
input.blank[type=text] { display:inline-block; width:9rem; margin:0 .3rem; padding:.3rem .5rem; }
input.blank.ok  { border-color:var(--ok);  background:#e3f4ea; }
input.blank.bad { border-color:var(--err); background:#fde8e6; }
.hint { color:var(--ok); font-weight:600; font-size:.9rem; margin-right:.3rem; }
.hint::before { content:"Answer: "; font-weight:400; color:var(--muted); }

table.grades th, table.grades td { text-align:center; }
table.grades th:first-child, table.grades td:first-child { text-align:left; }
th small { font-weight:400; }
