/* Mobiel eerst. Geen externe fonts of CDN's. */
:root { --fg: #1c1c1e; --bg: #fafaf8; --accent: #1f5f8b; --line: #d8d8d2; --err: #a4262c; }
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, sans-serif; color: var(--fg); background: var(--bg); }
header { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; padding: .75rem 1rem;
         border-bottom: 1px solid var(--line); background: #fff; }
nav { display: flex; flex: 1; flex-wrap: wrap; align-items: center; gap: .75rem; }
nav .spacer { flex: 1; }
nav form { margin: 0; }
a { color: var(--accent); }
main { max-width: 40rem; margin: 0 auto; padding: 1rem; }
label { display: block; margin: 1rem 0; font-weight: 600; }
input { display: block; width: 100%; margin-top: .25rem; padding: .75rem; font: inherit;
        border: 1px solid var(--line); border-radius: .4rem; }
button { padding: .75rem 1.25rem; font: inherit; color: #fff; background: var(--accent);
         border: 0; border-radius: .4rem; cursor: pointer; }
nav button { padding: .35rem .75rem; }
.error { color: var(--err); font-weight: 600; }

/* --- M1: tabellen, formulieren, meldingen, activatiestrookjes --- */
h1 { font-size: 1.5rem; } h2 { font-size: 1.15rem; margin-top: 2rem; }
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: #fff; }
th, td { padding: .5rem .6rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: .85rem; color: #555; }
form.inline { display: inline; margin: 0; }
textarea, select { display: block; width: 100%; margin-top: .25rem; padding: .6rem; font: inherit;
                   border: 1px solid var(--line); border-radius: .4rem; background: #fff; }
label.check { display: flex; align-items: center; gap: .5rem; font-weight: 400; margin: .4rem 0; }
label.check input { width: auto; margin: 0; }
button.secondary { background: #fff; color: var(--accent); border: 1px solid var(--accent); padding: .35rem .75rem; }
button.danger { background: var(--err); }
.notice { background: #e8f1f7; border-left: 4px solid var(--accent); padding: .6rem .8rem; }
div.error { border-left: 4px solid var(--err); background: #fbeaea; padding: .4rem .8rem; }
div.error ul { margin: 0; padding-left: 1.1rem; }
pre { background: #fff; border: 1px solid var(--line); padding: .6rem; overflow-x: auto; }
main { max-width: 56rem; }
.slips { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: .75rem; margin-top: 1rem; }
.slip { border: 1px dashed #777; padding: .75rem; background: #fff; break-inside: avoid; }
.slip .meta { font-size: .85rem; margin-top: .25rem; }
.slip .code { font: 700 1.6rem/1.4 ui-monospace, monospace; letter-spacing: .1em; margin: .4rem 0; }
@media print {
  header, .noprint, nav { display: none !important; }
  body { background: #fff; }
  main { max-width: none; padding: 0; }
  .slips { grid-template-columns: 1fr 1fr; gap: .5cm; }
}

/* --- M2: projecteditor --- */
fieldset.row { border: 1px solid var(--line); border-radius: .4rem; background: #fff; margin: .75rem 0; padding: .25rem .75rem .75rem; }
fieldset.row label { margin: .5rem 0; }
details { margin: .75rem 0; }
details.phase { background: #fff; border: 1px solid var(--line); border-radius: .4rem; padding: .5rem .9rem; }
details.phase summary { cursor: pointer; }
label small { display: block; font-weight: 400; color: #555; }

/* --- M3: leerlingschermen --- */
.chip { display: inline-block; padding: .05rem .55rem; border-radius: 1rem; font-size: .8rem; background: #eee; }
.chip-working { background: #fff3cd; } .chip-submitted { background: #d4edda; } .chip-locked { background: #e2e3e5; color: #555; }
.cards { list-style: none; padding: 0; } .cards li { background: #fff; border: 1px solid var(--line); border-radius: .4rem; padding: .7rem .9rem; margin: .6rem 0; }
.cards .sub { color: #555; font-size: .9rem; }
.thumbs { display: flex; flex-wrap: wrap; gap: .6rem; margin: .5rem 0; }
.thumbs figure { margin: 0; } .thumbs img { display: block; max-width: 9rem; max-height: 9rem; border-radius: .3rem; border: 1px solid var(--line); }
.field { background: #fff; border: 1px solid var(--line); border-radius: .4rem; padding: .6rem .8rem; margin: .8rem 0; }
.field label { margin: 0; } textarea.answer { min-height: 6rem; }
.attempts a, .attempts b { margin-right: .75rem; }
.share li { list-style: none; margin: .5rem 0; } .share ul { padding: 0; }
.share .text { white-space: pre-wrap; background: #fafaf8; border-left: 3px solid var(--line); padding: .3rem .6rem; }
#save-status { color: #555; font-size: .9rem; margin-left: .5rem; }
button[disabled] { background: #9aa7b0; cursor: not-allowed; }
.banner { background: #e8f1f7; border-left: 4px solid var(--accent); padding: .7rem .9rem; font-weight: 600; }

/* coach panel (M4) */
#coach-log .msg { margin: .5rem 0; padding: .5rem .75rem; border-radius: 8px; background: #f1f3f5; }
#coach-log .msg.student { background: #e7f0fb; }
#coach-form textarea { width: 100%; }
#coach-status.busy::before { content: ""; display: inline-block; width: .9em; height: .9em; margin-right: .4em;
  border: 2px solid #888; border-top-color: transparent; border-radius: 50%; animation: spin 1s linear infinite; vertical-align: -.1em; }
@keyframes spin { to { transform: rotate(360deg); } }

/* assessing (M5) */
.chip-met { background: #d4edda; color: #155724; } .chip-not_met { background: #f8d7da; color: #721c24; }
.chip-new { background: #0b5cad; color: #fff; }
.status { font-size: 1.2rem; } .status-met { color: #1e7e34; } .status-not_met { color: #b02a37; }
.status-submitted, .status-resubmitted { color: #0b5cad; } .status-none { color: #888; }

/* lesson brief pages (M6) */
img.page { max-width: 100%; height: auto; border: 1px solid #ccc; margin: .5rem 0; display: block; }
figure { margin: 1rem 0; }

/* --- inline styles replaced (CSP blocks style="") --- */
.pre { white-space: pre-wrap; }
img.thumb-small { max-width: 9rem; max-height: 9rem; }

/* --- collage: infinite poster --- */
.collage-field { max-width: none; }
.collage { position: relative; height: 70vh; min-height: 20rem; border: 1px solid var(--line); border-radius: .4rem;
  background: #fff; background-image: radial-gradient(#d8dde3 1px, transparent 1px); background-size: 24px 24px; overflow: hidden;
  touch-action: none; user-select: none; -webkit-user-select: none; }
.collage.full { position: fixed; inset: 0; z-index: 50; height: auto; border-radius: 0; }
.collage .c-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.collage.anim .c-world { transition: transform .45s ease; }
.collage svg.c-lines { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
.collage svg.c-lines line { stroke: #64748b; stroke-width: 3; stroke-linecap: round; }
.collage .c-node { position: absolute; background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 10px; overflow: hidden;
  padding: 8px; font-size: 18px; line-height: 1.3; white-space: pre-wrap; overflow-wrap: anywhere; cursor: grab;
  transition: box-shadow .2s ease, transform .2s ease; }
.collage .c-node.image { padding: 0; background: #fff; }
.collage .c-node.image img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; -webkit-user-drag: none; }
.collage .c-node .c-cap { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,.9); padding: 3px 8px; font-size: 15px; }
.collage .c-node.sel { outline: 3px solid #0b5cad; outline-offset: 2px; }
.collage .c-node.pick { outline: 3px dashed #0b5cad; outline-offset: 2px; }
/* zoomable: a soft blue glow, stronger on hover and focus */
.collage .c-node.zoomable { border-color: #6ea8e0; box-shadow: 0 0 0 2px rgba(11,92,173,.25), 0 0 14px 2px rgba(11,92,173,.35); }
.collage .c-node.zoomable::after { content: "\1F50D"; position: absolute; right: 6px; top: 4px; font-size: 16px; opacity: .75; pointer-events: none; }
.collage.view .c-node.zoomable { cursor: zoom-in; }
.collage .c-node:focus-visible { outline: 3px solid #0b5cad; outline-offset: 3px; }
@media (hover: hover) {
  .collage .c-node.zoomable:hover { box-shadow: 0 0 0 3px rgba(11,92,173,.55), 0 0 26px 6px rgba(11,92,173,.55); transform: scale(1.02); }
  .collage .c-node:not(.zoomable):hover { box-shadow: 0 2px 10px rgba(0,0,0,.18); }
}
.collage .c-handle { position: absolute; right: 0; bottom: 0; width: 22px; height: 22px; cursor: nwse-resize; background: linear-gradient(135deg, transparent 50%, #0b5cad 50%); }
.collage .c-bar { position: absolute; left: 8px; right: 8px; top: 8px; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center;
  background: rgba(255,255,255,.95); border: 1px solid var(--line); border-radius: .4rem; padding: .3rem .5rem; z-index: 3; }
.collage .c-bar button, .collage .c-sel button { padding: .3rem .6rem; font-size: .9rem; }
.collage .c-bar .c-crumbs { flex: 1; min-width: 8rem; font-size: .9rem; }
.collage .c-bar .c-crumbs a { cursor: pointer; }
.collage .c-sel { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center;
  background: rgba(255,255,255,.95); border: 1px solid var(--line); border-radius: .4rem; padding: .4rem .5rem; z-index: 3; }
.collage .c-sel textarea { flex: 1 1 14rem; margin: 0; min-height: 3rem; }
.collage .c-msg { position: absolute; left: 50%; transform: translateX(-50%); bottom: 4rem; background: #1f2937; color: #fff; padding: .4rem .8rem;
  border-radius: .4rem; z-index: 4; max-width: 90%; }
@media (prefers-reduced-motion: reduce) { .collage.anim .c-world, .collage .c-node { transition: none; } .collage .c-node:hover { transform: none; } }
