/* Live board (live.php, assets/js/liveboard.js): an endless whiteboard the tutor writes on. Theme tokens from site.css. */
.lb-page { margin: 0; overflow: hidden; background: var(--lb-paper); overscroll-behavior: none; }
.lb-page, .lb { --lb-paper: #0F1626; --lb-ink: #E8EDF8; --lb-soft: #A3B1CE; --lb-blue: #8AB4FF; --lb-red: #FB7185; --lb-green: #4ADE80;
  --lb-mark: rgba(138, 180, 255, .24); --lb-dot: rgba(163, 177, 206, .13); --lb-chip: rgba(20, 29, 49, .86); --lb-chip-line: #27334F;
  --lb-hand: 'Caveat', 'Marhey', 'Patrick Hand', cursive; --lb-mathf: 'Patrick Hand', 'Marhey', cursive; }
body.light.lb-page, body.light .lb { --lb-paper: #FBFAF6; --lb-ink: #1F2A44; --lb-soft: #56627F; --lb-blue: #1D4ED8; --lb-red: #C2410C; --lb-green: #15803D;
  --lb-mark: rgba(250, 204, 21, .45); --lb-dot: rgba(31, 42, 68, .09); --lb-chip: rgba(255, 255, 255, .9); --lb-chip-line: #DCE3F0; }

.lb { position: fixed; inset: 0; color: var(--fg); font-family: 'Atkinson Hyperlegible', system-ui, sans-serif; }
.lb-viewport { position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: default; outline: none;
  background-color: var(--lb-paper); background-image: radial-gradient(var(--lb-dot) 1.3px, transparent 1.4px); }
.lb-viewport::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.lb-viewport.grab { cursor: grab; } .lb-viewport.grabbing { cursor: grabbing; }
.lb-world { position: absolute; left: 0; top: 0; width: 1px; height: 1px; transform-origin: 0 0; will-change: transform; }

/* a part of the board: two columns, the working (main) and the side (points, figures, questions) */
.lb-space { position: absolute; display: grid; grid-template-columns: 700px 400px; column-gap: 72px; align-items: start; padding: 28px 36px 40px; }
.lb-space-tag { position: absolute; inset-inline-start: 0; top: -6px; font: 600 13px/1 Lexend, sans-serif; color: var(--lb-soft); opacity: .7; letter-spacing: .02em; }
.lb-col { display: flex; flex-direction: column; gap: 14px; min-height: 10px; }
.lb-col.side { padding-top: 78px; }
.lb-ink { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.lb-ink .mark { mix-blend-mode: multiply; } body:not(.light) .lb-ink .mark { mix-blend-mode: normal; }
.lb-under { z-index: 0; } .lb-col { position: relative; z-index: 1; } .lb-over { z-index: 2; }

.lb-item { color: var(--lb-ink); position: relative; }
.lb-item.title { font: 700 50px/1.1 var(--lb-hand); margin: 0 0 10px; padding: 2px 4px; width: fit-content; max-width: 100%; }
.lb-item.text { font: 500 32px/1.25 var(--lb-hand); }
.lb-item.point { font: 500 30px/1.25 var(--lb-hand); padding-inline-start: 30px; }
.lb-item.point::before { content: ''; position: absolute; inset-inline-start: 6px; top: .55em; width: 11px; height: 11px; border-radius: 50%;
  background: var(--lb-blue); opacity: var(--dot, 1); transform: scale(var(--dot, 1)); transition: transform .25s, opacity .25s; }
.lb-col.side .lb-item.point { font-size: 27px; color: var(--lb-soft); }
.lb-col.side .lb-item.point::before { background: var(--lb-soft); }
.lb-item sup { font-size: .62em; line-height: 0; }
.lb-w { display: inline; }
.lb-item .note { display: block; font: 500 22px/1.2 var(--lb-hand); color: var(--lb-blue); opacity: 0; transition: opacity .4s; margin-top: 2px; }
.lb-item .note.on { opacity: 1; }

.lb-item.math { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 26px; padding: 2px 0; }
.lb-item.math .m { font: 400 40px/1.25 var(--lb-mathf); white-space: nowrap; direction: ltr; unicode-bidi: isolate; }
.lb-item.math .note { display: inline; margin: 0; font-size: 24px; }
.lb-item .tk.var { font-style: italic; } .lb-item .tk.word { font-family: var(--lb-hand); font-size: .92em; }
.lb-item .tk.ok { color: var(--lb-green); }
.lb-item .tk.sup { font-size: .6em; vertical-align: .85em; margin-inline-start: 1px; }
.lb-item .tk.frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; font-size: .8em; line-height: 1.05; margin: 0 3px; }
.lb-item .tk.frac .nu { border-bottom: 2.5px solid currentColor; padding: 0 4px 2px; }
.lb-item .tk.frac .de { padding: 2px 4px 0; }
.lb-item .tk.sqrt .rt { font-size: 1.1em; } .lb-item .tk.sqrt .rad { border-top: 2.5px solid currentColor; padding: 0 3px; }
.lb-item.latex .m { font-size: 30px; direction: ltr; }
.lb-item.code pre { margin: 0; font: 400 19px/1.5 'JetBrains Mono', monospace; color: var(--lb-ink); background: color-mix(in srgb, var(--lb-ink) 6%, transparent);
  border: 2px solid color-mix(in srgb, var(--lb-ink) 22%, transparent); border-radius: 14px; padding: 16px 20px; white-space: pre-wrap; direction: ltr; text-align: left; }
.lb-item.fig svg { display: block; overflow: visible; }
.lb-item.sketch { width: 400px; max-width: 100%; }
.lb-item.sketch svg { display: block; }
.lb-item.sketch svg text { font-family: var(--lb-hand); }
/* recording a video (board_video.py): only the board, no controls */
.lb.record *, .lb.record *::before, .lb.record *::after { transition: none !important; animation: none !important; }  /* real-time CSS motion would jump between stepped frames */
.lb.record .lb-ui, .lb.record .lb-progress, .lb.record #lb-start, .lb.record #lb-help, .lb.record #lb-end, .lb.record .lb-toast { display: none !important; }
/* Quick tutor: the topic form and the three directions on the start card */
.lb-start-card:has(.lb-topic) { max-width: 760px; width: calc(100vw - 32px); max-height: calc(100vh - 32px); overflow: auto; }
.lb-topic { display: grid; gap: 12px; text-align: start; margin-top: 8px; }
.lb-topic-l { font-family: Lexend, sans-serif; font-weight: 600; }
.lb-topic textarea { width: 100%; font: inherit; padding: 12px; border-radius: 12px; border: 1px solid var(--line, #ccd); background: var(--bg, #fff); color: inherit; resize: vertical; }
.lb-topic-row { display: flex; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.lb-topic-acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.lb-topic-row select { font: inherit; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line, #ccd); background: var(--bg, #fff); color: inherit; }
.lb-topic.busy button[type=submit] { opacity: .6; pointer-events: none; }
.lb-topic-file { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.lb-file-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 6px 4px 12px; border-radius: 999px; background: var(--bg2);
  border: 1px solid var(--line); font-size: .88rem; color: var(--fg); }
.lb-file-chip[hidden] { display: none; }
.lb-file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.lb-file-x { border: 0; background: none; color: var(--muted); font-size: 1.1rem; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 999px; }
.lb-file-x:hover { color: var(--fg); background: var(--line); }
.lb-dirs { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.lb-dirs-note { grid-column: 1 / -1; margin: 4px 0; color: var(--muted, #667); }
.lb-dirs-note.bad { color: var(--bad, #b42318); }
.lb-dir { border: 1px solid var(--line, #ccd); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--card, transparent); }
.lb-dir h3 { margin: 0; font-size: 1.05rem; }
.lb-dir p { margin: 0; font-size: .9rem; color: var(--muted, #667); }
.lb-dir ol { margin: 0; padding-inline-start: 20px; font-size: .9rem; display: grid; gap: 2px; }
.lb-dir .btn { margin-top: auto; }
.lb-dir-own { border-style: dashed; }
.lb-dir-own textarea { width: 100%; box-sizing: border-box; resize: vertical; min-height: 92px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px;
  background: var(--bg2); color: var(--fg); font: 400 15px/1.45 'Atkinson Hyperlegible', sans-serif; }
.lb-dir-own textarea:focus { outline: none; border-color: var(--accent); }
body:not(.light) .lb-item.sketch svg [stroke="#111"], body:not(.light) .lb-item.sketch svg [stroke="#111111"] { stroke: var(--lb-ink); }
.lb-sk-wait { height: 300px; border: 2px dashed color-mix(in srgb, var(--lb-ink) 22%, transparent); border-radius: 18px; display: grid; place-items: center; color: var(--lb-soft); }
.lb-item.fig text { font-family: var(--lb-mathf); }

/* questions on the board */
.lb-ask { background: var(--bg2); border: 2px solid var(--lb-blue); border-radius: 18px; padding: 18px 20px; color: var(--fg); box-shadow: 0 10px 30px rgba(0,0,0,.12);
  font: 400 18px/1.45 'Atkinson Hyperlegible', sans-serif; animation: lb-pop .35s ease-out; }
@keyframes lb-pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.lb-ask .lb-kicker { margin: 0 0 6px; }
.lb-ask .lb-q { font: 600 20px/1.35 Lexend, sans-serif; margin: 0 0 12px; }
.lb-ask .lb-opts { display: grid; gap: 8px; }
.lb-ask .lb-opt { text-align: start; min-height: 46px; border-radius: 12px; border: 1.5px solid var(--line2); background: var(--bg); color: var(--fg); font: inherit; padding: 10px 14px; cursor: pointer; }
.lb-ask .lb-opt:hover:not(:disabled) { border-color: var(--accent); }
.lb-ask .lb-opt.right { border-color: var(--ok); background: var(--ok-bg); color: var(--ok-fg); }
.lb-ask .lb-opt.wrong { border-color: var(--bad); background: var(--bad-bg); color: var(--bad-fg); }
.lb-ask .lb-num { display: flex; gap: 8px; } .lb-ask .lb-num input { flex: 1; min-height: 44px; font-size: 18px; border-radius: 12px; border: 1.5px solid var(--line2); background: var(--bg); color: var(--fg); padding: 0 12px; }
.lb-ask .lb-fb { margin: 12px 0 0; display: flex; gap: 8px; align-items: flex-start; }
.lb-ask .lb-fb.ok { color: var(--ok-fg); } .lb-ask .lb-fb.bad { color: var(--bad-fg); }
.lb-ask .lb-acts { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.lb-ask.done { border-color: var(--line2); }
/* B: an answered card folds to its question and the answers that matter; a tap opens it again */
.lb-ask.done.folded { padding: 10px 14px; cursor: pointer; box-shadow: none; opacity: .92; }
.lb-ask.done.folded .lb-kicker, .lb-ask.done.folded .lb-fb, .lb-ask.done.folded .lb-acts,
.lb-ask.done.folded .lb-opt:not(.right):not(.wrong) { display: none; }
.lb-ask.done.folded .lb-q { font-size: 15px; margin: 0 0 6px; }
.lb-ask.done.folded .lb-opt { min-height: 0; padding: 4px 10px; font-size: 14px; }
.lb-ask.done.folded .lb-opts { gap: 4px; }
.lb-ask.done.folded::after { content: '\25BE'; float: inline-end; color: var(--muted); margin-top: -18px; }
/* A: the open question as a bottom sheet on phones; a slim bar when swiped down */
.lb-sheet { position: fixed; left: 8px; right: 8px; bottom: calc(max(8px, env(safe-area-inset-bottom)) + 64px); z-index: 30; max-height: 58vh;
  display: flex; flex-direction: column; background: var(--bg2); border: 1.5px solid var(--lb-blue); border-radius: 18px;
  box-shadow: 0 12px 34px rgba(0,0,0,.22); overflow: hidden; }
.lb-sheet[hidden] { display: none; }
.lb-sheet-handle { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 14px 4px; border: 0; background: none; color: var(--fg); cursor: pointer; touch-action: none; }
.lb-sheet-grip { width: 42px; height: 5px; border-radius: 3px; background: var(--line2); }
.lb-sheet-bar { display: none; font: 600 14px Lexend, sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.lb-sheet-body { overflow-y: auto; padding: 0 4px 6px; overscroll-behavior: contain; }
.lb-sheet .lb-ask { border: 0; box-shadow: none; padding: 6px 12px 10px; background: none; }
.lb-sheet .lb-ask .lb-q { font-size: 17px; }
.lb-sheet .lb-ask .lb-opt { min-height: 44px; }
.lb-sheet.collapsed .lb-sheet-body { display: none; }
.lb-sheet.collapsed .lb-sheet-bar { display: block; }
.lb-sheet.collapsed .lb-sheet-bar::before { content: '\25B4  '; color: var(--accent); }
.lb-ask-chip { border: 1.5px dashed var(--lb-blue); background: var(--bg2); color: var(--fg); border-radius: 14px; padding: 10px 14px; font: 600 14px Lexend, sans-serif; cursor: pointer; }
/* C: while the question is open the subtitles step back (they return when the sheet is a bar) */
.lb.sheet-on:not(.sheet-low) .lb-captions { display: none !important; }
@media (max-width: 720px), (max-height: 520px) {
  .lb-quick { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; scrollbar-width: none; padding-bottom: 2px; }
  .lb-quick::-webkit-scrollbar { display: none; }
  .lb-quick button { flex: 0 0 auto; }
  /* C: the text box folds into a keyboard button beside the mic until tapped */
  .lb-chat.compact .lb-chat-row { padding: 4px; justify-content: flex-end; gap: 6px; background: none; border-color: transparent; box-shadow: none; }
  .lb-chat.compact #lb-say, .lb-chat.compact .lb-send { display: none; }
  .lb-chat.compact .lb-type { display: inline-flex; }
}
.lb-type { display: none; }
@media (prefers-reduced-motion: no-preference) { .lb-sheet { transition: max-height .2s; } }

/* the pen that writes */
.lb-pen { position: absolute; left: 0; top: 0; width: 30px; height: 30px; pointer-events: none; opacity: 0; transition: opacity .3s; z-index: 5; color: var(--lb-blue);
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.18)); }
.lb-pen.on { opacity: 1; }
.lb-pen svg { width: 30px; height: 30px; transform: translate(-3px, -27px); }

/* chrome: floating, quiet controls */
.lb-ui { position: absolute; z-index: 10; }
.lb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; min-width: 42px; border-radius: 12px; border: 1px solid transparent;
  background: transparent; color: var(--fg); cursor: pointer; font: 600 14px/1 Lexend, sans-serif; text-decoration: none; padding: 0 10px; }
.lb-btn.icon { padding: 0; }
.lb-btn:hover { background: color-mix(in srgb, var(--fg) 8%, transparent); }
.lb-btn:focus-visible, .lb-zlevel:focus-visible, .lb-parts-btn:focus-visible, .lb-follow:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.lb-btn[aria-pressed=false] { color: var(--muted); }
.lb-progress { position: absolute; top: 0; left: 0; right: 0; height: 3px; z-index: 11; background: transparent; }
.lb-progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .6s ease; border-radius: 0 3px 3px 0; }

.lb-top { top: 10px; left: 12px; right: 12px; display: flex; align-items: center; gap: 8px; pointer-events: none; }
.lb-top > * { pointer-events: auto; }
.lb-top > .lb-btn, .lb-titlebox, .lb-top-r { background: var(--lb-chip); border: 1px solid var(--lb-chip-line); border-radius: 14px; backdrop-filter: blur(8px); box-shadow: 0 4px 18px rgba(0,0,0,.08); }
.lb-titlebox { position: relative; min-width: 0; }
.lb-parts-btn { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 12px; background: none; border: 0; color: var(--fg); cursor: pointer; max-width: min(64vw, 620px); border-radius: 14px; }
.lb-title { font: 600 15px/1.2 Lexend, sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-part { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.lb-top-r { margin-inline-start: auto; display: flex; gap: 2px; padding: 0 2px; }
.lb-menu-wrap { position: relative; }
.lb-pop { position: absolute; top: calc(100% + 8px); background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 40px rgba(0,0,0,.18);
  padding: 8px; z-index: 20; min-width: 280px; max-height: 70vh; overflow: auto; }
.lb-menu { inset-inline-end: 0; width: 320px; }
.lb-parts { inset-inline-start: 0; width: min(420px, 86vw); }
.lb-parts button { display: flex; gap: 10px; width: 100%; text-align: start; border: 0; background: none; color: var(--fg); padding: 10px 12px; border-radius: 10px; cursor: pointer; font: 500 15px/1.3 'Atkinson Hyperlegible', sans-serif; }
.lb-parts button:hover, .lb-parts button:focus-visible { background: var(--panel); outline: none; }
.lb-parts button .n { font: 600 13px/1.6 Lexend; color: var(--muted); min-width: 1.6em; }
.lb-parts button.on { background: var(--panel); } .lb-parts button.on .n { color: var(--accent); }
.lb-parts button.later { color: var(--muted); }
.lb-menu-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; font-size: 14.5px; }
.lb-menu-row select { max-width: 170px; min-height: 36px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg); color: var(--fg); font-size: 13.5px; }
.lb-seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 10px; overflow: hidden; }
.lb-seg button { border: 0; background: none; color: var(--fg); padding: 7px 9px; font: 600 13px Lexend; cursor: pointer; }
.lb-seg button[aria-checked=true] { background: var(--accent); color: var(--on-accent); }
.lb-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; color: var(--fg); padding: 10px; border-radius: 10px; cursor: pointer; font: 500 14.5px 'Atkinson Hyperlegible', sans-serif; text-align: start; }
.lb-menu-item:hover { background: var(--panel); }

.lb-bottom { left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; pointer-events: none; }
.lb-bottom > * { pointer-events: auto; }
.lb-dock, .lb-zoom { display: flex; align-items: center; gap: 2px; padding: 4px; background: var(--lb-chip); border: 1px solid var(--lb-chip-line); border-radius: 18px; backdrop-filter: blur(8px); box-shadow: 0 6px 22px rgba(0,0,0,.1); }
.lb-btn.play { background: var(--accent); color: var(--on-accent); border-radius: 14px; min-width: 46px; min-height: 46px; }
.lb-btn.play:hover { background: color-mix(in srgb, var(--accent) 85%, #000); }
.lb-tutor { position: relative; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); margin-inline-end: 4px; flex: none; }
.lb-tutor img { border-radius: 8px; }
.lb-tutor .lb-ring { position: absolute; inset: -3px; border-radius: 50%; border: 3px solid var(--accent); opacity: 0; transform: scale(.9); }
.lb.talking .lb-dock .lb-ring { animation: lb-talk 1.1s ease-in-out infinite; }
@keyframes lb-talk { 0%, 100% { opacity: .2; transform: scale(.94); } 50% { opacity: .9; transform: scale(1.06); } }
.lb-tutor.big { width: 84px; height: 84px; margin: 0 auto 10px; }
.lb-zoom-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.lb-zlevel { min-width: 58px; min-height: 42px; border: 0; background: none; color: var(--fg); font: 600 13.5px Lexend, sans-serif; cursor: pointer; border-radius: 10px; }
.lb-zlevel:hover { background: color-mix(in srgb, var(--fg) 8%, transparent); }
.lb-follow { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--accent); color: var(--on-accent); font: 600 14px Lexend, sans-serif; box-shadow: 0 8px 22px rgba(29, 78, 216, .3); animation: lb-pop .3s ease-out; }

.lb-captions { left: 50%; transform: translateX(-50%); bottom: calc(max(12px, env(safe-area-inset-bottom)) + 70px); width: min(760px, calc(100vw - 32px));
  background: rgba(12, 19, 34, .86); color: #F1F5FF; border-radius: 16px; padding: 12px 18px; font: 500 19px/1.45 'Atkinson Hyperlegible', sans-serif; text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.2); pointer-events: none; }
.lb-captions .w { transition: color .12s; } .lb-captions .w.past { color: #F1F5FF; } .lb-captions .w.future { color: #9AA8C4; }
.lb-captions .w.now { color: #FFE58A; }

.lb-overlay { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px; background: color-mix(in srgb, var(--lb-paper) 55%, transparent); backdrop-filter: blur(3px); }
.lb-overlay[hidden] { display: none; }
.lb-card { position: relative; background: var(--bg2); color: var(--fg); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 30px 70px rgba(0,0,0,.22); padding: 28px; width: min(480px, 100%); max-height: calc(100vh - 32px); overflow: auto; }
.lb-start-card { text-align: center; } .lb-start-card h1 { font-size: 26px; margin: 4px 0 10px; }
.lb-kicker { font: 600 12.5px/1 Lexend, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: 0; }
.lb-go { margin-top: 14px; min-height: 52px; font-size: 17px; padding: 0 26px; }
.lb-start-note { margin: 14px 0 0; }
.lb-close { position: absolute; top: 12px; inset-inline-end: 12px; }
.lb-help-card { width: min(520px, 100%); } .lb-help-card h2 { margin: 0 0 6px; font-size: 22px; }
.lb-help-sec { border-top: 1px solid var(--line); padding: 14px 0; } .lb-help-sec:first-of-type { border-top: 0; }
.lb-help-sec h3 { font-size: 14px; color: var(--muted); margin: 0 0 10px; font-weight: 600; }
.lb-help-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px 18px; }
.lb-help-row > div { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 15px; }
.lb-help-row b { flex-basis: 100%; font-weight: 500; }
.lb-key { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 8px; border: 1.5px solid var(--line2); border-bottom-width: 3px; border-radius: 9px; font: 600 13px Lexend; color: var(--accent); background: var(--bg); }
.lb-key.ic { color: var(--accent); }
.lb-end-card { text-align: center; width: min(520px, 100%); } .lb-end-card h2 { font-size: 28px; margin: 6px 0 14px; }
.lb-score { margin: 0 0 14px; padding: 14px 12px; border-radius: 14px; background: var(--panel); border: 1.5px solid var(--line, var(--panel)); text-align: center; }
.lb-score.good { border-color: var(--ok, var(--accent)); }
.lb-score b { display: block; font: 600 28px Lexend, sans-serif; margin: 4px 0; }
.lb-score-k { display: block; font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.lb-score-sub { display: block; font-size: 14px; color: var(--muted); }
.lb-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 18px; }
.lb-stats div { background: var(--panel); border-radius: 14px; padding: 12px 6px; } .lb-stats b { display: block; font: 600 26px JetBrains Mono, monospace; } .lb-stats span { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.lb-end-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.lb-toast { position: absolute; z-index: 25; left: 50%; top: 66px; transform: translateX(-50%); background: var(--bg2); border: 1px solid var(--line); color: var(--fg); padding: 10px 16px; border-radius: 12px; box-shadow: 0 10px 26px rgba(0,0,0,.14); font-size: 14.5px; }

/* phones: one column per part */
.lb.narrow .lb-space { grid-template-columns: 560px; row-gap: 22px; padding: 24px 24px 36px; }
.lb.narrow .lb-col.side { padding-top: 0; }
.lb.narrow .lb-item.title { font-size: 46px; }
@media (max-width: 720px) {
  .lb-part { display: none; }
  .lb-parts-btn { max-width: 52vw; }
  .lb-captions { font-size: 16px; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 124px); padding: 10px 14px; }
  .lb-bottom { flex-direction: column-reverse; align-items: stretch; }
  .lb-zoom-wrap { flex-direction: row-reverse; justify-content: space-between; align-items: center; }
  .lb-dock { justify-content: center; }
  #lb-prev, #lb-next { display: none; }
  .lb-help-row { grid-template-columns: 1fr 1fr; }
}

/* talking with the tutor (P2): the answer box, quick replies, "thinking" */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lb-chat { flex: 1 1 auto; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.lb-chat[hidden] { display: none; }
.lb-chat-row { display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px 14px; background: var(--bg2); border: 1.5px solid var(--lb-chip-line);
  border-radius: 18px; box-shadow: 0 6px 22px rgba(0,0,0,.1); transition: border-color .2s, box-shadow .2s; }
.lb-chat-row:focus-within { border-color: var(--accent); }
.lb-chat.waiting .lb-chat-row { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent), 0 6px 22px rgba(0,0,0,.1); }
.lb-chat input { flex: 1; min-width: 0; min-height: 44px; border: 0; background: none; color: var(--fg); font: 400 16.5px 'Atkinson Hyperlegible', sans-serif; outline: none; }
.lb-send { background: var(--accent); color: var(--on-accent); border-radius: 14px; }
.lb-mic[hidden] { display: none; }
.lb-mic { color: var(--fg); border-radius: 14px; }
.lb-mic.on { background: var(--bad-bg); color: var(--bad-fg); animation: lb-mic-pulse 1.6s ease-in-out infinite; }
@keyframes lb-mic-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--bad) 45%, transparent); } 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--bad) 0%, transparent); } }
@media (prefers-reduced-motion: reduce) { .lb-mic.on { animation: none; } }
.lb.mic-on .lb-chat-row { border-color: var(--bad); }
.lb-send:hover { background: color-mix(in srgb, var(--accent) 85%, #000); }
.lb-quick { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.lb-quick:empty { display: none; }
.lb-quick button { border: 1.5px solid var(--lb-chip-line); background: var(--lb-chip); color: var(--fg); border-radius: 999px; padding: 7px 13px; font: 600 13.5px Lexend, sans-serif; cursor: pointer; backdrop-filter: blur(8px); }
.lb-quick button:hover { border-color: var(--accent); }
/* P4.2: points of the learner's file covered, in the header */
.lb-cover { align-self: center; margin-inline-start: 8px; padding: 3px 10px; border-radius: 999px; border: 1.5px solid var(--lb-chip-line); background: var(--lb-chip); font: 600 12.5px 'JetBrains Mono', monospace; white-space: nowrap; }
.lb-cover.all { border-color: var(--ok, var(--accent)); }
.lb-file-mode { margin-inline-start: 8px; padding: 2px 10px; border-radius: 999px; border: 1.5px solid var(--accent); background: transparent; color: var(--accent); font: 600 12.5px Lexend, sans-serif; cursor: pointer; }  /* practice mode on / off */
.lb-titlebox { display: flex; align-items: center; } .lb-titlebox > .lb-parts-btn { min-width: 0; }
.lb-quick button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent, #fff); order: -1; }  /* "I understand": the main choice, first */
.lb.tutor .lb-bottom { align-items: flex-end; }
.lb.tutor #lb-prev, .lb.tutor #lb-next { display: none; }
.lb-captions.thinking { color: #C9D4EE; }
.lb-dots { display: inline-flex; gap: 5px; vertical-align: middle; margin-inline-start: 8px; }
.lb-dots i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .3; animation: lb-dot 1s infinite; }
.lb-dots i:nth-child(2) { animation-delay: .15s; } .lb-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes lb-dot { 50% { opacity: 1; transform: translateY(-3px); } }
.lb.thinking .lb-dock .lb-ring { animation: lb-talk 1.6s ease-in-out infinite; border-color: var(--warn); }
.lb-go2 { margin-top: 10px; }
.lb-why { margin: 12px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--panel); color: var(--fg); font-size: 15px; }
.lb-said { position: absolute; z-index: 9; left: 50%; transform: translateX(-50%); bottom: calc(max(12px, env(safe-area-inset-bottom)) + 140px); max-width: min(560px, 90vw);
  background: var(--accent); color: var(--on-accent); padding: 9px 14px; border-radius: 16px 16px 4px 16px; font: 500 15.5px 'Atkinson Hyperlegible', sans-serif;
  box-shadow: 0 8px 22px rgba(0,0,0,.14); animation: lb-pop .3s ease-out; }
.lb.tutor .lb-captions { bottom: calc(max(12px, env(safe-area-inset-bottom)) + 76px); }
.lb.tutor:has(.lb-quick:not(:empty)) .lb-captions { bottom: calc(max(12px, env(safe-area-inset-bottom)) + 120px); }
@media (max-width: 720px) {
  /* phones with the tutor: the answer box along the bottom, one row of quick replies, the controls in one row above */
  .lb.tutor .lb-bottom { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "dock zoom" "chat chat"; align-items: center; gap: 8px; }
  .lb.tutor .lb-dock { grid-area: dock; justify-self: start; }
  .lb.tutor .lb-zoom-wrap { grid-area: zoom; }
  .lb.tutor .lb-zoom { display: none; }
  .lb.tutor .lb-chat { grid-area: chat; max-width: none; width: 100%; }
  .lb.tutor .lb-quick { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; scrollbar-width: none; padding-bottom: 2px; }
  .lb.tutor .lb-quick button { flex: none; }
  .lb.tutor .lb-captions { bottom: calc(max(12px, env(safe-area-inset-bottom)) + 128px); }
  .lb.tutor:has(.lb-quick:not(:empty)) .lb-captions { bottom: calc(max(12px, env(safe-area-inset-bottom)) + 172px); }
  .lb-said { bottom: calc(max(12px, env(safe-area-inset-bottom)) + 230px); }
}
}

@media (prefers-reduced-motion: reduce) { .lb-ask, .lb-follow { animation: none; } .lb.talking .lb-dock .lb-ring { animation: none; opacity: .7; } }

@media print {
  @page { size: A4 landscape; margin: 12mm; }
  .lb-page { overflow: visible; background: #fff; }
  .lb, .lb-viewport { position: static; overflow: visible; background: #fff !important; }
  .lb-viewport::after, .lb-ui, .lb-overlay, .lb-progress, .lb-pen, .lb-toast { display: none !important; }
  .lb-world { position: static; transform: none !important; width: auto; height: auto; zoom: .78; }
  .lb-space { position: relative !important; left: auto !important; top: auto !important; break-inside: avoid; page-break-inside: avoid; margin: 0 0 10mm; }
  .lb, .lb-page { --lb-ink: #1F2A44; --lb-soft: #56627F; --lb-blue: #1D4ED8; --lb-paper: #fff; }
  .lb-item, .lb-item * { clip-path: none !important; }
}

/* "Your turn": every question waits in a box above the chat (with a countdown when Studio settings has one) */
.lb-turn { position: relative; margin: 0 auto 8px; max-width: min(620px, 94vw); background: var(--lb-chip); border: 2px solid var(--accent);
  border-radius: 14px; padding: 10px 14px 12px; text-align: start; box-shadow: 0 6px 24px rgb(0 0 0 / 0.12); backdrop-filter: blur(8px); overflow: hidden;
  animation: lb-turn-in 0.25s ease-out; }
.lb-turn-k { margin: 0; font: 700 12px Lexend, sans-serif; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.lb-turn-q { margin: 2px 0 0; font: 600 16px/1.4 Lexend, sans-serif; color: var(--fg); }
.lb-turn-h { margin: 4px 0 0; font-size: 13.5px; color: var(--muted, var(--fg)); opacity: 0.8; }
.lb-turn-bar { position: absolute; inset-inline: 0; bottom: 0; height: 4px; background: transparent; }
.lb-turn-bar i { display: block; height: 100%; width: 100%; background: var(--accent); opacity: 0.55; transition: width 0.25s linear; }
.lb-turn.typing .lb-turn-bar { display: none; }
.lb-turn.nudge { animation: lb-turn-nudge 0.6s ease-in-out 2; }
.lb-ask-now { box-shadow: 0 0 0 3px var(--accent), 0 8px 28px rgb(0 0 0 / 0.14); animation: lb-turn-nudge 0.6s ease-in-out 1; }
@keyframes lb-turn-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes lb-turn-nudge { 0%, 100% { transform: none; } 30% { transform: scale(1.03); } 60% { transform: scale(0.99); } }
@media (prefers-reduced-motion: reduce) { .lb-turn, .lb-turn.nudge, .lb-ask-now { animation: none; } }

/* PLAN U11: the board's look, chosen on the start card (body.lb-look-*, kept in localStorage aic-board-look) */
body.lb-look-whiteboard.lb-page, body.lb-look-whiteboard .lb { --lb-paper: #FBFAF6; --lb-ink: #1F2A44; --lb-soft: #56627F; --lb-blue: #1D4ED8; --lb-red: #C2410C; --lb-green: #15803D;
  --lb-mark: rgba(250, 204, 21, .45); --lb-dot: rgba(31, 42, 68, .09); --lb-chip: rgba(255, 255, 255, .9); --lb-chip-line: #DCE3F0; }
body.lb-look-chalkboard.lb-page, body.lb-look-chalkboard .lb { --lb-paper: #2F3B35; --lb-ink: #F1F5EE; --lb-soft: #C3CEC6; --lb-blue: #FDE68A; --lb-red: #FCA5A5; --lb-green: #86EFAC;
  --lb-mark: rgba(253, 230, 138, .22); --lb-dot: rgba(241, 245, 238, .08); --lb-chip: rgba(36, 46, 41, .9); --lb-chip-line: #4B5A52;
  --lb-hand: 'Patrick Hand', 'Marhey', 'Caveat', cursive; }
body.lb-look-sketchnote.lb-page, body.lb-look-sketchnote .lb { --lb-paper: #FFFDF5; --lb-ink: #374151; --lb-soft: #6B7280; --lb-blue: #2563EB; --lb-red: #DB2777; --lb-green: #059669;
  --lb-mark: rgba(244, 114, 182, .28); --lb-dot: rgba(55, 65, 81, .08); --lb-chip: rgba(255, 255, 255, .92); --lb-chip-line: #E5E7EB; }
body.lb-look-paper.lb-page, body.lb-look-paper .lb { --lb-paper: #E9DCC2; --lb-ink: #3F3A33; --lb-soft: #6F6556; --lb-blue: #1D4ED8; --lb-red: #B91C1C; --lb-green: #166534;
  --lb-mark: rgba(202, 138, 4, .3); --lb-dot: rgba(63, 58, 51, .1); --lb-chip: rgba(245, 237, 222, .92); --lb-chip-line: #CDBB9A; }
.lb-looks { border: 0; padding: 0; margin: 14px 0 6px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.lb-looks legend { width: 100%; text-align: center; margin-bottom: 4px; }
.lb-look { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; border: 1.5px solid var(--lb-chip-line); cursor: pointer; font-size: 13px; }
.lb-look input { position: absolute; opacity: 0; pointer-events: none; }
.lb-look:has(input:checked) { border-color: var(--lb-blue); box-shadow: 0 0 0 2px color-mix(in srgb, var(--lb-blue) 30%, transparent); }
.lb-look-sw { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .2); }
/* PLAN U11: an animation on the board (a scene engine), scaled to its column */
.lb-item.scene { width: 100%; margin: 8px 0 14px; }
.lb-sc-view { position: relative; overflow: hidden; border-radius: 16px; border: 2px solid color-mix(in srgb, var(--lb-ink) 14%, transparent); }
.lb-sc-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; background: var(--lb-paper); }
.lb-sc-wait { height: 260px; }

/* the end card's share box (a tutor session shared from the board) */
.lb-share-box { margin-top: 14px; display: grid; gap: 8px; text-align: start; }
.lb-share-row { display: flex; gap: 8px; }
.lb-share-row input { flex: 1; min-width: 0; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--lb-chip-line); background: transparent; color: var(--lb-ink);
  font: 12px 'JetBrains Mono', monospace; }

/* the speech speed button in the bottom bar (1x, 1.2x ...) */
.lb-btn.lb-speed { min-width: 46px; padding: 0 10px; font: 600 14px/1 'JetBrains Mono', monospace; }

/* leaving (2026-10-09): a close button on the start card, the "Leave the lesson?" dialog */
.lb-card-close { position: absolute; top: 12px; inset-inline-end: 12px; }
.lb-leave-card { text-align: center; width: min(460px, 100%); } .lb-leave-card h2 { font-size: 24px; margin: 4px 0 10px; }
