/* TeachPen 10 — "the teacher's whiteboard"
   Palette from the classroom: blue-black ink, royal fountain-pen blue, red marking pen,
   highlighter yellow, aluminium marker tray, exercise-book rules. */
:root{
  --desk:#EEF0F3;
  --paper:#FFFFFF;
  --ink:#17203A;
  --ink-2:#4A5470;
  --ink-3:#737D93;
  --rule:#D3DAE8;
  --rule-2:#E6EAF2;
  --quink:#2B47C9;
  --quink-2:#1F37A6;
  --quink-soft:#E9EDFC;
  --red:#D93A2F;
  --red-soft:#FCE9E7;
  --hilite:#FFE047;
  --alu-1:#FBFBFC;
  --alu-2:#DCE0E6;
  --alu-edge:#C4CAD3;
  --chalk:#203B30;
  --ui:"Atkinson Hyperlegible Next","Atkinson Hyperlegible",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --hand:"Kalam","Segoe Print","Bradley Hand",cursive;
  --r-s:8px; --r-m:12px; --r-l:18px;
  --lift:0 1px 0 rgba(255,255,255,.8) inset,0 1px 2px rgba(23,32,58,.08),0 8px 24px -10px rgba(23,32,58,.22);
  --float:0 2px 4px rgba(23,32,58,.06),0 18px 44px -16px rgba(23,32,58,.32);
  --ease:cubic-bezier(.2,.8,.2,1);
  --top-h:56px;
  --safe-b:env(safe-area-inset-bottom,0px);
  color-scheme:light;
}
*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{background:var(--desk);color:var(--ink);font-family:var(--ui);font-size:15px;line-height:1.5;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
button,input,textarea,select{font:inherit;color:inherit}
button{cursor:pointer;background:none;border:0;padding:0}
a{color:var(--quink)}
a.btn{text-decoration:none}
svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}
svg .fill,svg use .fill{fill:currentColor;stroke:none}
[hidden]{display:none!important}
:focus-visible{outline:3px solid var(--quink);outline-offset:2px;border-radius:6px}
::selection{background:var(--hilite)}

/* ---------- buttons ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:40px;padding:0 16px;border-radius:999px;font-weight:600;font-size:14.5px;white-space:nowrap;transition:background .15s,box-shadow .15s,transform .15s var(--ease)}
.btn:active{transform:translateY(1px)}
.btn-ink{background:var(--quink);color:#fff;box-shadow:0 1px 0 rgba(255,255,255,.25) inset,0 6px 16px -8px rgba(43,71,201,.8)}
.btn-ink:hover{background:var(--quink-2)}
.btn-paper{background:#fff;color:var(--ink);box-shadow:0 0 0 1px var(--rule) inset,0 1px 2px rgba(23,32,58,.06)}
.btn-paper:hover{box-shadow:0 0 0 1.5px var(--ink-3) inset}
.btn-quiet{color:var(--ink);padding:0 12px}
.btn-quiet:hover{background:rgba(23,32,58,.06)}
.btn-danger{background:var(--red);color:#fff}
.btn-lg{height:52px;padding:0 22px;font-size:16px}
.btn-sm{height:32px;padding:0 12px;font-size:13.5px}
.btn-block{width:100%}
.icon-btn{display:inline-grid;place-items:center;width:40px;height:40px;border-radius:12px;color:var(--ink-2);transition:background .15s,color .15s}
.icon-btn:hover{background:rgba(23,32,58,.07);color:var(--ink)}
.icon-btn:disabled{opacity:.35;pointer-events:none}
.link-btn{font-weight:600;color:var(--ink-2);text-decoration:none;padding:8px 12px;border-radius:10px}
.link-btn:hover{background:rgba(23,32,58,.06);color:var(--ink)}

/* ================= HOME ================= */
.home{min-height:100%;overflow:auto;overflow-x:hidden;height:100vh;height:100dvh;padding:0 20px 40px}
.home-top{max-width:1180px;margin:0 auto;display:flex;align-items:center;justify-content:space-between;height:72px}
.wordmark{display:inline-flex;align-items:center;gap:10px;text-decoration:none;color:var(--ink);font-weight:800;font-size:20px;letter-spacing:-.01em}
.wordmark-nib{width:34px;height:34px}
.wordmark-nib rect{fill:var(--quink);stroke:none}
.wordmark-nib path{stroke:#fff;stroke-width:3.4}
.wordmark-nib circle{fill:var(--hilite);stroke:none}
.home-links{display:flex;gap:4px;white-space:nowrap}

.board-frame{position:relative;padding:10px 10px 0;border-radius:22px;background:linear-gradient(180deg,var(--alu-1),var(--alu-2));box-shadow:0 0 0 1px var(--alu-edge) inset,0 1px 0 #fff inset,0 30px 60px -30px rgba(23,32,58,.45)}
.board-surface{position:relative;aspect-ratio:600/470;border-radius:12px;background:var(--paper);box-shadow:0 0 0 1px rgba(23,32,58,.08) inset,0 2px 10px rgba(23,32,58,.06) inset;overflow:hidden}
#hero-demo{position:absolute;left:4%;top:3%;width:80%;height:82%;display:block}
.hero-title{font-family:var(--hand);font-weight:700;font-size:clamp(40px,5.2vw,70px);line-height:1.04;margin:0 0 20px;color:var(--ink);letter-spacing:-.01em}
.hero-sub{font-size:18px;line-height:1.6;color:var(--ink-2);margin:0 0 28px;max-width:33em}
.hero-actions{display:flex;flex-wrap:wrap;gap:10px}
.board-tray{height:30px;margin:0 -10px;border-radius:0 0 22px 22px;position:relative;background:linear-gradient(180deg,#E9ECF0,#C9CED6);box-shadow:0 1px 0 #fff inset,0 -1px 0 rgba(23,32,58,.12) inset}
.tray-marker{position:absolute;top:7px;width:118px;height:15px;border-radius:4px 8px 8px 4px;background:linear-gradient(180deg,#fff,#E3E6EB);box-shadow:0 1px 2px rgba(23,32,58,.25)}
.tray-marker::before{content:"";position:absolute;right:-2px;top:-1px;width:38px;height:17px;border-radius:4px 9px 9px 4px;background:var(--cap);box-shadow:0 -3px 4px rgba(255,255,255,.25) inset}
.tray-marker:nth-child(1){left:7%}.tray-marker:nth-child(2){left:calc(7% + 132px)}.tray-marker:nth-child(3){left:calc(7% + 264px);transform:rotate(-1.5deg)}
.tray-eraser{position:absolute;right:9%;top:4px;width:74px;height:20px;border-radius:5px;background:linear-gradient(180deg,#3A4258,#252B3D);box-shadow:0 2px 3px rgba(23,32,58,.3)}
.tray-eraser::after{content:"";position:absolute;left:3px;right:3px;bottom:-3px;height:5px;border-radius:0 0 4px 4px;background:#8C93A3}

.shelf{max-width:1180px;margin:44px auto 0}
.shelf-head{display:flex;align-items:baseline;gap:14px;flex-wrap:wrap;margin-bottom:16px}
.shelf h2,.uses h2{font-size:24px;line-height:1.2;margin:0;font-weight:800;letter-spacing:-.01em}
.shelf-note{margin:0;color:var(--ink-3)}
.shelf-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(212px,1fr));gap:22px}
.book{position:relative;display:flex;flex-direction:column;border-radius:4px 12px 12px 4px;background:var(--cover,#2B47C9);padding:10px 10px 12px 22px;box-shadow:0 1px 0 rgba(255,255,255,.25) inset,0 10px 22px -12px rgba(23,32,58,.55);text-align:left;color:var(--ink);transition:transform .18s var(--ease),box-shadow .18s}
.book::before{content:"";position:absolute;left:8px;top:8px;bottom:8px;width:0;border-left:2px dashed rgba(255,255,255,.55)}
.book:hover{transform:translateY(-3px);box-shadow:0 1px 0 rgba(255,255,255,.25) inset,0 16px 28px -14px rgba(23,32,58,.6)}
.book-open{display:block;width:100%;text-align:left;border-radius:6px}
.book-thumb{display:block;width:100%;aspect-ratio:16/10;object-fit:cover;border-radius:4px;background:#fff;box-shadow:0 0 0 1px rgba(0,0,0,.12)}
.book-label{display:block;margin-top:10px;background:#fff;border-radius:6px;padding:8px 10px 7px;box-shadow:0 1px 2px rgba(0,0,0,.18)}
.book-title{display:block;font-family:var(--hand);font-weight:700;font-size:19px;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;border-bottom:1.5px solid var(--rule);padding-bottom:3px}
.book-meta{display:block;font-size:12.5px;color:var(--ink-3);margin-top:4px}
.book-menu{position:absolute;top:14px;right:14px;width:32px;height:32px;border-radius:10px;display:grid;place-items:center;background:rgba(255,255,255,.92);color:var(--ink);box-shadow:0 1px 3px rgba(0,0,0,.2);opacity:0;transition:opacity .15s}
.book:hover .book-menu,.book-menu:focus-visible,.book-menu[aria-expanded="true"]{opacity:1}
@media (hover:none){.book-menu{opacity:1}}
.book-new{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;min-height:208px;border-radius:4px 12px 12px 4px;border:2px dashed var(--alu-edge);color:var(--ink-2);font-weight:700;background:rgba(255,255,255,.45);transition:border-color .15s,background .15s}
.book-new:hover{border-color:var(--quink);color:var(--quink);background:#fff}
.book-new svg{width:28px;height:28px}
.shelf-empty{grid-column:1/-1;margin:0;color:var(--ink-3);font-family:var(--hand);font-size:20px}

.uses{max-width:1180px;margin:56px auto 0}
.uses-list{display:grid;grid-template-columns:repeat(3,1fr);gap:28px 40px;margin:20px 0 0}
.uses-list div{border-top:2px solid var(--rule);padding-top:14px}
.uses-list dt{font-weight:800;font-size:17px;margin-bottom:6px}
.uses-list dd{margin:0;color:var(--ink-2);max-width:36em}
.home-foot{max-width:1180px;margin:56px auto 0;padding-top:20px;border-top:1px solid var(--rule);display:flex;justify-content:space-between;flex-wrap:wrap;gap:12px;color:var(--ink-3);font-size:14px}
.home-foot p{margin:0}
.home-foot a{color:var(--ink-2);margin-left:14px}

/* ================= STUDIO ================= */
.studio{position:fixed;inset:0;display:grid;grid-template-columns:1fr auto;grid-template-rows:var(--top-h) 1fr;background:var(--desk);overflow:hidden}
.topbar{grid-column:1/-1;display:flex;align-items:center;gap:8px;padding:0 10px 0 8px;background:rgba(255,255,255,.86);backdrop-filter:blur(10px);box-shadow:0 1px 0 var(--rule);z-index:20}
.title-wrap{display:flex;align-items:baseline;gap:10px;min-width:0;flex:1}
.lesson-title{min-width:60px;max-width:min(420px,40vw);border:0;background:transparent;font-weight:700;font-size:16.5px;padding:6px 8px;border-radius:8px;text-overflow:ellipsis}
.lesson-title:hover{background:rgba(23,32,58,.05)}
.lesson-title:focus{outline:none;background:#fff;box-shadow:0 0 0 2px var(--quink)}
.save-state{font-size:13px;color:var(--ink-3);white-space:nowrap}
.top-actions{display:flex;align-items:center;gap:4px}
.top-sep{width:1px;height:24px;background:var(--rule);margin:0 6px}
.rec-btn.on{background:var(--red);color:#fff}
.rec-btn.on svg .fill{animation:blink 1s steps(2) infinite}
.live-btn.on{background:var(--red-soft);color:var(--red)}
.live-btn.on svg .fill{animation:pulse 1.6s var(--ease) infinite;transform-origin:12px 12px}
@keyframes blink{50%{opacity:.2}}
@keyframes pulse{0%,100%{transform:scale(1)}50%{transform:scale(1.5)}}

.stage{position:relative;grid-column:1;grid-row:2;overflow:hidden;touch-action:none}
.board{position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:none;cursor:crosshair;-webkit-user-select:none;user-select:none}
.stage[data-tool="pan"] .board{cursor:grab}
.stage.panning .board{cursor:grabbing}
.stage[data-tool="select"] .board{cursor:default}
.stage[data-tool="text"] .board{cursor:text}
.stage[data-tool="eraser"] .board,.stage[data-tool="laser"] .board{cursor:none}

.text-editor{position:absolute;z-index:6;border:0;outline:2px dashed var(--quink);outline-offset:4px;background:transparent;resize:none;overflow:hidden;padding:0;margin:0;line-height:1.25;white-space:pre-wrap;font-family:var(--ui);font-weight:600}
.sel-bar{position:absolute;z-index:7;display:flex;gap:2px;padding:4px;background:#fff;border-radius:14px;box-shadow:var(--float)}
.zoom-ctl,.page-pill{position:absolute;z-index:5;display:flex;align-items:center;gap:2px;padding:4px;border-radius:14px;background:rgba(255,255,255,.92);box-shadow:var(--lift)}
.zoom-ctl{left:14px;bottom:18px}
.zoom-ctl .icon-btn,.page-pill .icon-btn{width:34px;height:34px;border-radius:10px}
.zoom-val,.page-count{min-width:58px;height:34px;padding:0 8px;border-radius:10px;font-weight:700;font-size:13.5px;font-variant-numeric:tabular-nums;color:var(--ink-2)}
.zoom-val:hover,.page-count:hover{background:rgba(23,32,58,.06)}
.page-pill{right:14px;bottom:18px}
.screen-bar{position:absolute;z-index:8;top:14px;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:10px;padding:6px 6px 6px 14px;border-radius:999px;background:var(--ink);color:#fff;font-weight:600;font-size:14px;box-shadow:var(--float)}
.screen-bar .btn-quiet{color:#fff}
.screen-bar .btn-quiet:hover{background:rgba(255,255,255,.12)}
.screen-dot{width:9px;height:9px;border-radius:50%;background:#5BE38B;box-shadow:0 0 0 4px rgba(91,227,139,.25)}
.live-banner{position:absolute;z-index:8;top:12px;left:50%;transform:translateX(-50%);max-width:calc(100% - 24px);display:flex;align-items:center;gap:10px;padding:8px 8px 8px 14px;border-radius:999px;background:#fff;box-shadow:var(--float);font-weight:600;font-size:14px}
.live-banner .dot{width:9px;height:9px;border-radius:50%;background:var(--red);flex:none;animation:blink 1.2s steps(2) infinite}
.live-banner .muted{color:var(--ink-3);font-weight:500}

/* rail */
.rail{grid-column:2;grid-row:2;width:176px;display:flex;flex-direction:column;background:rgba(255,255,255,.7);box-shadow:-1px 0 0 var(--rule);z-index:10;min-height:0}
.rail-head{display:flex;align-items:center;justify-content:space-between;padding:12px 10px 6px 16px}
.rail-head h2{font-size:14px;margin:0;color:var(--ink-2);font-weight:700}
.rail-close{display:inline-grid}
.rail-list{list-style:none;margin:0;padding:4px 14px 14px;overflow-y:auto;flex:1;display:flex;flex-direction:column;gap:12px;counter-reset:pg}
.rail-item{position:relative;display:flex;gap:8px;align-items:flex-start}
.rail-num{width:16px;flex:none;font-size:12px;font-weight:700;color:var(--ink-3);text-align:right;padding-top:2px;font-variant-numeric:tabular-nums}
.rail-thumb{flex:1;min-width:0;display:block;border-radius:6px;overflow:hidden;background:#fff;box-shadow:0 0 0 1px var(--rule);transition:box-shadow .15s}
.rail-thumb img{display:block;width:100%;height:auto}
.rail-item.on .rail-thumb{box-shadow:0 0 0 2.5px var(--quink)}
.rail-item.on .rail-num{color:var(--quink)}
.rail-tools{position:absolute;right:4px;top:4px;display:flex;flex-direction:column;gap:2px;opacity:0;transition:opacity .12s}
.rail-item:hover .rail-tools,.rail-item:focus-within .rail-tools{opacity:1}
@media (hover:none){.rail-item.on .rail-tools{opacity:1}}
.rail-tools button{width:26px;height:26px;border-radius:8px;display:grid;place-items:center;background:rgba(255,255,255,.95);box-shadow:0 1px 3px rgba(23,32,58,.25);color:var(--ink-2)}
.rail-tools button:hover{color:var(--ink)}
.rail-tools svg{width:15px;height:15px}
.rail-foot{padding:10px 14px 14px;border-top:1px solid var(--rule-2);display:flex;flex-direction:column;gap:10px}
.paper-pick{display:grid;grid-template-columns:repeat(4,1fr);gap:4px}
.paper-opt{height:30px;border-radius:7px;box-shadow:0 0 0 1px var(--rule) inset;background:#fff;position:relative;overflow:hidden}
.paper-opt[aria-checked="true"]{box-shadow:0 0 0 2.5px var(--quink) inset}
.paper-opt[data-bg="grid"]{background-image:linear-gradient(#D7DEEC 1px,transparent 1px),linear-gradient(90deg,#D7DEEC 1px,transparent 1px);background-size:7px 7px}
.paper-opt[data-bg="dots"]{background-image:radial-gradient(#AEB8CC 1px,transparent 1.2px);background-size:6px 6px}
.paper-opt[data-bg="lined"]{background-image:linear-gradient(90deg,transparent 7px,#F2A3A0 7px,#F2A3A0 8px,transparent 8px),repeating-linear-gradient(transparent 0 6px,#C9D6F0 6px 7px)}
.paper-opt[data-bg="chalk"]{background:var(--chalk)}
.paper-opt[data-bg="axes"]{background-image:linear-gradient(90deg,transparent calc(50% - .75px),#4A5470 calc(50% - .75px),#4A5470 calc(50% + .75px),transparent calc(50% + .75px)),linear-gradient(transparent calc(50% - .75px),#4A5470 calc(50% - .75px),#4A5470 calc(50% + .75px),transparent calc(50% + .75px)),linear-gradient(#DCE3F0 1px,transparent 1px),linear-gradient(90deg,#DCE3F0 1px,transparent 1px);background-size:100% 100%,100% 100%,6px 6px,6px 6px}
.paper-opt[data-bg="hand4"]{background-image:repeating-linear-gradient(transparent 0 4px,#A9BCE6 4px 5px,transparent 5px 7px,#A9BCE6 7px 8px,transparent 8px 10px,#E48A83 10px 11px,transparent 11px 13px,#A9BCE6 13px 14px,transparent 14px 18px)}
.paper-opt[data-bg="staff"]{background-image:repeating-linear-gradient(transparent 0 6px,#8C93A3 6px 7px,transparent 7px 9px,#8C93A3 9px 10px,transparent 10px 12px,#8C93A3 12px 13px,transparent 13px 15px,#8C93A3 15px 16px,transparent 16px 18px,#8C93A3 18px 19px,transparent 19px 27px)}

/* ---------- the marker tray ---------- */
.tray-wrap{position:absolute;left:50%;bottom:14px;transform:translateX(-50%);z-index:12;max-width:calc(100% - 24px)}
.studio .tray-wrap{left:calc((100% - 176px)/2)}
.tray{display:flex;align-items:flex-end;gap:6px;padding:0 10px 8px;border-radius:20px 20px 24px 24px;background:linear-gradient(180deg,var(--alu-1) 0%,#EEF0F3 55%,var(--alu-2) 100%);box-shadow:0 0 0 1px var(--alu-edge) inset,0 1px 0 #fff inset,0 18px 40px -16px rgba(23,32,58,.5),0 3px 6px rgba(23,32,58,.08)}
.tray-aux{display:flex;flex-direction:column;gap:4px;padding:10px 6px 0 0;margin-right:2px;border-right:1px solid rgba(23,32,58,.1)}
.aux-btn{width:36px;height:30px;border-radius:9px;display:grid;place-items:center;color:var(--ink-2)}
.aux-btn svg{width:18px;height:18px}
.aux-btn:hover{background:rgba(23,32,58,.07);color:var(--ink)}
.aux-btn[aria-pressed="true"]{background:var(--ink);color:#fff}
.tray-tools{display:flex;align-items:flex-end;gap:2px}
.tool{position:relative;display:flex;flex-direction:column;align-items:center;width:62px;padding-top:12px;color:var(--ink-2)}
.tool-art{display:block;width:38px;height:56px;transition:transform .28s var(--ease),filter .2s;filter:drop-shadow(0 3px 2px rgba(23,32,58,.18))}
.tool:hover .tool-art{transform:translateY(-3px)}
.tool[aria-pressed="true"] .tool-art{transform:translateY(-14px);filter:drop-shadow(0 12px 7px rgba(23,32,58,.24))}
.tool-name{position:relative;font-size:11.5px;font-weight:700;margin-top:5px;padding:0 4px;white-space:nowrap;z-index:0}
.tool[aria-pressed="true"] .tool-name{color:var(--ink)}
.tool[aria-pressed="true"] .tool-name::before{content:"";position:absolute;left:-2px;right:-2px;top:52%;height:9px;background:var(--hilite);border-radius:2px 5px 3px 6px;transform:rotate(-2deg) skewX(-12deg);z-index:-1;opacity:.95}
.tray-caps{display:flex;align-items:center;gap:6px;padding:0 8px 22px 12px;border-left:1px solid rgba(23,32,58,.1);align-self:stretch;margin-top:14px}
.cap{width:26px;height:26px;border-radius:50%;background:var(--c);box-shadow:0 0 0 2px rgba(255,255,255,.9) inset,0 0 0 1px rgba(23,32,58,.25),0 2px 3px rgba(23,32,58,.22);transition:transform .15s var(--ease)}
.cap:hover{transform:scale(1.08)}
.cap[aria-checked="true"]{transform:scale(1.12);box-shadow:0 0 0 2px rgba(255,255,255,.9) inset,0 0 0 2.5px var(--ink),0 3px 5px rgba(23,32,58,.25)}
.cap-more{background:conic-gradient(#D93A2F,#EE8A12,#FFE047,#1E8C4E,#2B47C9,#7B3FC4,#D93A2F)}
.cap-current{display:none}
.tray-sizes{display:flex;align-items:center;gap:2px;padding:0 0 22px 8px;border-left:1px solid rgba(23,32,58,.1);align-self:stretch;margin-top:14px}
.size{width:30px;height:30px;border-radius:9px;display:grid;place-items:center}
.size i{display:block;border-radius:50%;background:var(--ink);width:var(--d);height:var(--d);box-shadow:0 0 0 1px rgba(23,32,58,.35)}
.size:hover{background:rgba(23,32,58,.07)}
.size[aria-checked="true"]{background:#fff;box-shadow:0 0 0 1.5px var(--ink)}
/* the page actions at the tray's right end: undo and redo, a new page, and clearing the page (undo brings it back) */
.tray-acts{display:grid;grid-template-rows:repeat(2,30px);grid-auto-flow:column;grid-auto-columns:36px;gap:4px;padding:10px 0 0 8px;margin-left:2px;border-left:1px solid rgba(23,32,58,.1)}
.aux-btn:disabled{opacity:.32;cursor:default;background:none}
.act-clear:not(:disabled):hover{color:var(--red);background:var(--red-soft)}
body.role-pen .tray-acts [data-act="page"]{display:none}
/* right to left: undo points the way the line runs back */
[dir="rtl"] :is(#btn-undo,#btn-redo,.tray-acts [data-act="undo"],.tray-acts [data-act="redo"],.sk-btn[data-sk="undo"],.tap-sign) svg{transform:scaleX(-1)}
.flyout{position:absolute;bottom:calc(100% + 10px);left:50%;transform:translateX(-50%);display:flex;flex-wrap:wrap;justify-content:center;gap:4px;padding:6px;border-radius:16px;background:#fff;box-shadow:var(--float);z-index:13;max-width:calc(100vw - 24px)}
.fly-opt{display:flex;flex-direction:column;align-items:center;gap:2px;padding:6px 8px;border-radius:10px;font-size:12px;font-weight:600;color:var(--ink-2);min-width:58px}
.fly-opt svg{width:26px;height:26px}
.fly-opt:hover{background:rgba(23,32,58,.06)}
.fly-opt[aria-checked="true"]{background:var(--quink-soft);color:var(--quink)}
.fly-colors{display:grid;grid-template-columns:repeat(6,32px);gap:8px;padding:6px}
.fly-colors .cap{width:32px;height:32px}
.fly-row{display:flex;align-items:center;gap:8px;width:100%;padding:4px 6px;border-top:1px solid var(--rule-2)}
/* TeachPen 15: 3D emoji stickers (the tool shows the sticker it puts down) and Celebrate */
.tool-stk{display:grid;place-items:end center;padding-bottom:4px}
.tool-stk img{width:40px;height:40px;transition:transform .3s cubic-bezier(.2,.9,.3,1.4)}
.tool:hover .tool-stk img{transform:rotate(-8deg) scale(1.06)}
.tool[aria-pressed="true"] .tool-stk img{transform:rotate(-6deg) scale(1.12)}
.stk-fly{flex-direction:column;flex-wrap:nowrap;align-items:stretch;gap:8px;padding:10px;width:min(372px,calc(100vw - 24px))}
.stk-tabs{display:flex;gap:4px;overflow-x:auto;scrollbar-width:none}
.stk-tabs::-webkit-scrollbar{display:none}
.stk-tab{flex:none;padding:6px 11px;border-radius:99px;font-size:13px;font-weight:700;color:var(--ink-2)}
.stk-tab:hover{background:rgba(23,32,58,.06)}
.stk-tab[aria-selected="true"]{background:var(--ink);color:#fff}
.stk-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:4px}
.stk{display:grid;place-items:center;aspect-ratio:1;border-radius:12px}
.stk img{width:72%;height:auto;transition:transform .22s cubic-bezier(.2,.9,.3,1.5);pointer-events:none}
.stk:hover{background:#FFF6D6}
.stk:hover img{transform:scale(1.2) rotate(-6deg)}
.stk[aria-checked="true"]{background:var(--quink-soft);box-shadow:0 0 0 1.5px var(--quink) inset}
.stk-party{display:flex;align-items:center;justify-content:center;gap:8px;height:42px;border-radius:12px;font-size:15px;font-weight:800;color:var(--ink);
  background:linear-gradient(90deg,#FFE047,#FF9F5A 48%,#F472B6);box-shadow:0 6px 16px -8px rgba(240,100,120,.7)}
.stk-party:hover{filter:brightness(1.04);transform:translateY(-1px)}
.stk-party img{width:26px;height:26px}
.stk-none{margin:6px 8px;font-size:13px;color:var(--ink-2)}
@media (prefers-reduced-motion:reduce){.tool-stk img,.stk img{transition:none}}
.fly-row label{font-size:13px;font-weight:600;color:var(--ink-2)}
.fly-row input[type=color]{width:40px;height:30px;border:0;padding:0;background:none}

/* ---------- menus, dialogs, toasts ---------- */
.menu{position:fixed;z-index:60;min-width:250px;max-width:calc(100vw - 16px);max-height:calc(100vh - 80px);overflow:auto;padding:6px;border-radius:16px;background:#fff;box-shadow:0 0 0 1px rgba(23,32,58,.06),var(--float)}
.menu-item{display:flex;align-items:center;gap:12px;width:100%;padding:9px 12px;border-radius:10px;text-align:left;font-weight:600;font-size:14.5px}
.menu-item:hover,.menu-item:focus-visible{background:rgba(23,32,58,.06);outline:none}
.menu-item svg{color:var(--ink-2)}
.menu-item small{margin-left:auto;color:var(--ink-3);font-weight:500;font-size:12.5px}
.menu-item.danger{color:var(--red)}
.menu-item.danger svg{color:var(--red)}
.menu-sep{height:1px;background:var(--rule-2);margin:5px 8px}
.scrim{position:fixed;inset:0;z-index:55;background:transparent}

.sheet{border:0;padding:0;border-radius:22px;width:min(520px,calc(100vw - 24px));max-height:calc(100dvh - 32px);background:#fff;color:var(--ink);box-shadow:var(--float)}
.sheet::backdrop{background:rgba(23,32,58,.38);backdrop-filter:blur(2px)}
.sheet-body{padding:24px 24px 22px}
.sheet h2{margin:0 0 6px;font-size:21px;line-height:1.25;font-weight:800}
.sheet p{margin:0 0 14px;color:var(--ink-2)}
.sheet .row{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end;margin-top:18px}
.sheet .x{position:absolute;top:12px;right:12px}
.sheet input[type=text]{width:100%;height:46px;border-radius:12px;border:1.5px solid var(--rule);padding:0 14px;font-size:16px;background:#fff}
.sheet input[type=text]:focus{outline:none;border-color:var(--quink);box-shadow:0 0 0 3px var(--quink-soft)}
.code-input{text-transform:uppercase;letter-spacing:.3em;font-weight:800;text-align:center;font-size:22px!important}
.qr-box{display:grid;grid-template-columns:auto 1fr;gap:20px;align-items:center;margin:8px 0 6px}
.qr-box .qr{width:184px;height:184px;border-radius:14px;background:#fff;box-shadow:0 0 0 1px var(--rule);padding:8px;display:grid;place-items:center}
.qr-box .qr img,.qr-box .qr svg{width:100%;height:100%}
.big-code{font-size:34px;font-weight:800;letter-spacing:.14em;font-variant-numeric:tabular-nums;color:var(--ink);line-height:1.1}
.link-line{display:flex;gap:6px;align-items:center;margin-top:10px;font-size:13px;color:var(--ink-3);word-break:break-all}
.stat-line{display:flex;gap:16px;flex-wrap:wrap;margin-top:12px;font-size:14px;color:var(--ink-2)}
.stat-line b{color:var(--ink)}
.opt-list{display:flex;flex-direction:column;gap:8px}
.opt-card{display:flex;align-items:center;gap:14px;width:100%;padding:14px 16px;border-radius:14px;text-align:left;box-shadow:0 0 0 1px var(--rule) inset;background:#fff}
.opt-card:hover{box-shadow:0 0 0 2px var(--quink) inset}
.opt-card b{display:block;font-size:15.5px}
.opt-card span{display:block;color:var(--ink-3);font-size:13.5px}
.opt-card svg{width:26px;height:26px;color:var(--quink)}
.q-list{display:flex;flex-direction:column;gap:8px;max-height:46vh;overflow:auto;margin:6px 0 0;padding:0;list-style:none}
.q-list li{padding:10px 12px;border-radius:12px;background:var(--desk);font-weight:600}
.q-list li small{display:block;color:var(--ink-3);font-weight:500}
.kbd-grid{display:grid;grid-template-columns:auto 1fr;gap:6px 14px;font-size:14px}
.kbd-grid kbd{font-family:var(--ui);font-weight:700;font-size:12.5px;padding:2px 7px;border-radius:6px;background:var(--desk);box-shadow:0 1px 0 var(--alu-edge);justify-self:start}

.toasts{position:fixed;z-index:80;left:50%;bottom:calc(132px + var(--safe-b));transform:translateX(-50%);display:flex;flex-direction:column;align-items:center;gap:8px;pointer-events:none;width:max-content;max-width:calc(100vw - 24px)}
.toast{pointer-events:auto;display:flex;align-items:center;gap:12px;padding:10px 12px 10px 16px;border-radius:14px;background:var(--ink);color:#fff;font-weight:600;font-size:14px;box-shadow:var(--float);animation:toastIn .25s var(--ease)}
.toast button{color:var(--hilite);font-weight:700;padding:4px 8px;border-radius:8px;white-space:nowrap}
.toast button:hover{background:rgba(255,255,255,.1)}
@keyframes toastIn{from{opacity:0;transform:translateY(8px)}}
.drop-hint{position:fixed;inset:12px;z-index:90;border-radius:24px;border:3px dashed var(--quink);background:rgba(233,237,252,.85);display:grid;place-items:center;font-size:22px;font-weight:800;color:var(--quink);pointer-events:none}

/* captions + questions on the board */
.captions{position:absolute;z-index:9;left:50%;bottom:130px;transform:translateX(-50%);max-width:min(860px,calc(100% - 32px));padding:10px 18px;border-radius:14px;background:rgba(23,32,58,.86);color:#fff;font-size:clamp(17px,2.2vw,24px);font-weight:600;line-height:1.35;text-align:center}

/* ---------- presenting ---------- */
body.presenting .topbar,body.presenting .rail,body.presenting .zoom-ctl{display:none}
body.presenting .studio{grid-template-rows:0 1fr;grid-template-columns:1fr 0}
body.presenting .studio .tray-wrap{left:50%}
body.presenting .tray{transform:scale(.86);transform-origin:bottom center;opacity:.55;transition:opacity .2s}
body.presenting .tray:hover,body.presenting .tray:focus-within{opacity:1}
.exit-present{position:absolute;z-index:14;top:12px;right:12px;display:none}
body.presenting .exit-present{display:inline-flex}

/* ---------- viewer & phone-pen roles ---------- */
body.role-viewer .rail,body.role-viewer .tray-wrap,body.role-viewer .top-actions>*:not(.viewer-keep),body.role-viewer .save-state{display:none}
body.role-viewer .studio{grid-template-columns:1fr 0}
body.role-viewer .lesson-title{pointer-events:none}
body.role-pen .rail,body.role-pen #btn-present,body.role-pen #btn-record,body.role-pen #btn-live,body.role-pen #btn-ask,body.role-pen #btn-export,body.role-pen .save-state,body.role-pen .top-sep{display:none}
body.role-pen .studio{grid-template-columns:1fr 0}
body.role-pen .lesson-title{pointer-events:none}
body.role-pen .studio .tray-wrap,body.role-viewer .studio .tray-wrap{left:50%}

/* ================= responsive ================= */
@media (max-width:1099px){
  .studio{grid-template-columns:1fr 0}
  .studio .tray-wrap{left:50%}
  .rail{position:fixed;right:10px;top:calc(var(--top-h) + 10px);bottom:auto;max-height:calc(100% - var(--top-h) - 150px);border-radius:18px;background:#fff;box-shadow:var(--float);transform:translateX(calc(100% + 20px));transition:transform .25s var(--ease)}
  .rail.open{transform:none}
  .rail-close{display:inline-grid}
}
@media (max-width:860px){
  .uses-list{grid-template-columns:1fr 1fr}
  .hide-sm{display:none!important}
  .topbar .btn-quiet span{display:none}
  .topbar .btn-quiet{padding:0;width:40px}
  .topbar .live-btn .live-badge:not([hidden]){display:inline-grid}
  /* while a lesson records, the button shows how long it has been recording */
  .topbar .rec-btn:is(.on,.paused){width:auto;padding:0 10px}
  .topbar .rec-btn:is(.on,.paused) .rec-label{display:inline;font-size:13px;font-variant-numeric:tabular-nums}
}
@media (max-width:720px){
  :root{--top-h:52px}
  .home{padding:0 14px 32px}
  .home-top{height:62px}
  .link-btn{padding:8px 10px}
  .hero-sub{font-size:16.5px}
  .hero-actions .btn{flex:1 1 100%}
  .board-tray{height:22px}
  .tray-marker{transform:scale(.7);transform-origin:left}
  .tray-marker:nth-child(2){left:calc(7% + 92px)}
  .tray-marker:nth-child(3){left:calc(7% + 184px)}
  .uses-list{grid-template-columns:1fr;gap:20px}
  .shelf-grid{grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:14px}
  .book-title{font-size:17px}
  .topbar{gap:2px;padding:0 4px}
  .top-sep{display:none}
  .lesson-title{font-size:15px;max-width:100%}
  .save-state{display:none}
  .icon-btn{width:38px;height:38px}
  .tray-wrap,.studio .tray-wrap{left:0;right:0;bottom:0;transform:none;max-width:none}
  .tray{border-radius:18px 18px 0 0;padding:0 4px calc(6px + var(--safe-b));gap:2px;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;justify-content:space-between}
  .tray::-webkit-scrollbar{display:none}
  .tray-aux{flex-direction:column;padding:8px 4px 0 0;gap:2px}
  .aux-btn{width:34px;height:28px}
  .tool{width:42px;flex:none;padding-top:14px}
  /* only the chosen tool is named (a phone bar's "selected label" mode), so every language's names fit a 360 px phone */
  .tool:not([aria-pressed="true"]) .tool-name{visibility:hidden}
  .tool-art{width:30px;height:46px}
  .tool-stk img{width:32px;height:32px}
  .tool-name{font-size:10.5px;padding:0 2px}
  .tray-aux{padding-right:2px;margin-right:0}
  .aux-btn{width:30px}
  .tray-caps{padding:0 4px 18px 8px;margin-top:10px}
  .tray-caps .cap:not(.cap-current){display:none}
  .cap-current{display:block}
  .tray-sizes{display:none}
  /* a phone has Undo and Redo in the top bar and Clear in the More menu; while presenting (no top bar) the tray has them */
  .tray-acts{display:none}
  /* recording on a phone: the bar keeps the time, Pause, the camera and Undo; Redo and the class buttons make room */
  body.recording #btn-redo,body.recording #btn-ask,body.recording #btn-live:not(.on){display:none}
  body.presenting .tray-acts{display:grid;grid-auto-columns:30px;padding:8px 0 0 4px;gap:2px}
  .tray-acts [data-act="redo"],.tray-acts [data-act="page"]{display:none}
  .zoom-ctl{display:none}
  .page-pill{right:10px;bottom:auto;top:10px}
  .toasts{bottom:calc(110px + var(--safe-b))}
  .captions{bottom:104px}
  body.presenting .tray{transform:none;opacity:1}
  .sheet{margin:auto auto 0;border-radius:22px 22px 0 0;width:100%;max-width:100%;max-height:92dvh}
  .qr-box{grid-template-columns:1fr;justify-items:center;text-align:center}
}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}
}
body.role-viewer #pg-prev,body.role-viewer #pg-next{display:none}
body.role-viewer .zoom-ctl{left:14px}

/* full-screen class code for the projector */
.class-code{position:fixed;inset:0;z-index:70;display:flex;align-items:center;justify-content:center;gap:6vw;padding:5vh 6vw;background:#fff}
.cc-qr{width:min(62vh,46vw);aspect-ratio:1;padding:18px;border-radius:24px;box-shadow:0 0 0 2px var(--rule)}
.cc-qr svg{width:100%;height:100%}
.cc-side{max-width:520px}
.cc-lead{font-family:var(--hand);font-weight:700;font-size:clamp(28px,4vw,52px);margin:0;color:var(--ink-2)}
.cc-code{font-size:clamp(64px,11vw,150px);font-weight:800;letter-spacing:.12em;line-height:1;margin:.15em 0 .25em;color:var(--ink)}
.cc-how{font-size:clamp(17px,1.8vw,24px);color:var(--ink-2);margin:0 0 32px}
@media (max-width:720px){.class-code{flex-direction:column;gap:20px}.cc-qr{width:70vw}}
body.role-viewer .live-banner{top:auto;bottom:calc(14px + var(--safe-b))}
body.role-viewer .captions{bottom:calc(70px + var(--safe-b))}
.viewer-keep{flex:none}
@media (max-width:720px){
  body .studio .tray-wrap,body.role-pen .studio .tray-wrap,body.role-viewer .studio .tray-wrap,body.presenting .studio .tray-wrap{left:0;right:0;transform:none}
  body.role-viewer .lesson-title{font-size:14px}
}
/* the site-wide cookie notice must not cover the marker tray or the class code */
body:has(#studio:not([hidden])) #ct-cc{top:calc(var(--top-h) + 10px);bottom:auto!important}
body:has(.class-code) #ct-cc{display:none}
body.role-viewer .page-pill{top:auto;bottom:calc(14px + var(--safe-b));right:12px}
@media (max-width:720px){body.role-viewer .live-banner{left:12px;transform:none;max-width:calc(100% - 110px)}}

/* ---------- 10.2: full-width board, text styles, following, the guide ---------- */
@media (min-width:1100px){body.rail-hidden .rail{display:none}}
.rail-thumb img{max-height:212px;object-fit:cover;object-position:top}
.book-thumb{object-position:top}
.text-opt b{font-size:22px;line-height:30px;height:30px;font-weight:600}
.ts-print{font-family:var(--ui)}
.ts-hand{font-family:var(--hand);font-weight:700!important}
.live-banner .btn{height:32px;margin-left:2px}

.sheet.sheet-wide{width:min(880px,calc(100vw - 24px))}
.guide-nav{display:flex;flex-wrap:wrap;gap:6px;margin:0 40px 20px 0}
.guide-chip{height:32px;padding:0 12px;border-radius:999px;font-size:13px;font-weight:600;color:var(--ink-2);background:var(--desk);transition:background .15s,color .15s}
.guide-chip:hover{background:var(--rule-2);color:var(--ink)}
.guide-chip[aria-current="true"]{background:var(--ink);color:#fff}
.guide-body{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:26px;align-items:center;min-height:300px}
.g-scene{width:100%;height:auto;aspect-ratio:16/9;background:#F7F8FB;border-radius:16px;box-shadow:inset 0 0 0 1px var(--rule-2);stroke:none}
.guide-step{font-size:13px;font-weight:700;color:var(--ink-3);margin:0 0 4px!important}
.guide-text h2{font-size:23px}
.guide-keys{display:grid;grid-template-columns:auto 1fr;gap:7px 12px;margin:0;font-size:14px;align-items:baseline}
.guide-keys dt,.guide-keys dd{margin:0}
.guide-keys dd{color:var(--ink-2)}
.guide-keys kbd{font-family:var(--ui);font-weight:700;font-size:12.5px;padding:2px 7px;border-radius:6px;background:var(--desk);box-shadow:0 1px 0 var(--alu-edge);white-space:nowrap}
.guide .row{justify-content:space-between;align-items:center}
.guide-pager{display:flex;gap:4px}
@media (max-width:720px){
  .guide-nav{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;margin-right:44px;padding-bottom:2px}
  .guide-nav::-webkit-scrollbar{display:none}
  .guide-chip{flex:none}
  .guide-body{grid-template-columns:1fr;gap:14px;min-height:0}
  .guide-text h2{font-size:20px}
}
/* scene type */
.g-note{font:700 18px var(--hand)}
.g-hand{font:700 24px var(--hand)}
.g-ui{font:800 16px var(--ui)}
/* scene motion: every scene loops over 5.6s; resting styles are the finished picture */
.g-scene *{animation-duration:5.6s;animation-iteration-count:infinite;animation-timing-function:var(--ease);animation-fill-mode:backwards}
.g-draw{stroke-dasharray:1;animation-name:g-draw}
.g-late{animation-name:g-draw-late}
.g-later{animation-name:g-draw-later}
.g-d1{animation-delay:.3s}.g-d2{animation-delay:.45s}.g-d3{animation-delay:.6s}
@keyframes g-draw{0%{stroke-dashoffset:1;opacity:1}40%,92%{stroke-dashoffset:0;opacity:1}100%{stroke-dashoffset:0;opacity:0}}
@keyframes g-draw-late{0%,28%{stroke-dashoffset:1;opacity:1}62%,92%{stroke-dashoffset:0;opacity:1}100%{stroke-dashoffset:0;opacity:0}}
@keyframes g-draw-later{0%,56%{stroke-dashoffset:1;opacity:1}78%,92%{stroke-dashoffset:0;opacity:1}100%{stroke-dashoffset:0;opacity:0}}
.g-hl{transform-origin:54px 0;animation-name:g-hl}
@keyframes g-hl{0%,44%{transform:scaleX(0);opacity:.6}60%,92%{transform:scaleX(1);opacity:.6}100%{transform:scaleX(1);opacity:0}}
.g-tip{opacity:0;animation-name:g-tip;animation-timing-function:var(--ease)}
@keyframes g-tip{0%{offset-distance:0%;opacity:1}40%{offset-distance:100%;opacity:1}46%,100%{offset-distance:100%;opacity:0}}
.g-wob{stroke-dasharray:1;opacity:0;animation-name:g-wob}
@keyframes g-wob{0%{stroke-dashoffset:1;opacity:1}34%{stroke-dashoffset:0;opacity:1}52%{opacity:1}60%,100%{stroke-dashoffset:0;opacity:0}}
.g-ring{stroke-dasharray:1;opacity:0;animation-name:g-ring;animation-timing-function:linear}
@keyframes g-ring{0%,35%{stroke-dashoffset:1;opacity:0}37%{stroke-dashoffset:1;opacity:1}52%{stroke-dashoffset:0;opacity:1}58%,100%{stroke-dashoffset:0;opacity:0}}
.g-perfect{transform-origin:160px 90px;animation-name:g-perfect}
@keyframes g-perfect{0%,53%{opacity:0;transform:scale(.92)}64%,92%{opacity:1;transform:none}100%{opacity:0;transform:none}}
.g-note{animation-name:g-fade-mid}
@keyframes g-fade-mid{0%,32%{opacity:0}40%,90%{opacity:1}100%{opacity:0}}
.g-world{transform-origin:160px 82px;transform:scale(.4) translate(-16px,-30px);animation-name:g-pan}
@keyframes g-pan{0%,8%{transform:scale(1) translate(0,0)}28%,34%{transform:scale(1) translate(-170px,0)}52%,58%{transform:scale(1) translate(-170px,-90px)}74%,92%{transform:scale(.4) translate(-16px,-30px)}100%{transform:scale(1) translate(0,0)}}
.g-fingers{transform-origin:278px 102px;animation-name:g-fingers}
@keyframes g-fingers{0%,8%{transform:none}28%,34%{transform:translate(-18px,0)}52%,58%{transform:translate(-18px,-14px)}74%,92%{transform:translate(-12px,-8px) scale(.6)}100%{transform:none}}
.g-cut{transform-origin:160px 28px;animation-name:g-cut;animation-timing-function:linear}
@keyframes g-cut{0%,15%{transform:scaleY(0)}55%,95%{transform:scaleY(1)}96%,100%{transform:scaleY(0)}}
.g-eraser{opacity:0;animation-name:g-eraser;animation-timing-function:linear}
@keyframes g-eraser{0%,10%{transform:translateY(0);opacity:0}15%{transform:translateY(3px);opacity:1}55%,64%{transform:translateY(127px);opacity:1}72%,100%{transform:translateY(127px);opacity:0}}
.g-grow{transform-origin:94px 48px;transform:scale(1.35);animation-name:g-grow}
@keyframes g-grow{0%,20%{transform:none}55%,82%{transform:scale(1.35)}100%{transform:none}}
.g-handle{transform:translate(29px,27px);animation-name:g-handle}
@keyframes g-handle{0%,20%{transform:none}55%,82%{transform:translate(29px,27px)}100%{transform:none}}
.g-sheet{transform-origin:160px 160px}
.g-s3{transform:translate(-26px,4px) rotate(-7deg);animation-name:g-fan3}
.g-s2{transform:translate(20px,2px) rotate(5deg);animation-name:g-fan2}
@keyframes g-fan3{0%{transform:none}24%,94%{transform:translate(-26px,4px) rotate(-7deg)}100%{transform:none}}
@keyframes g-fan2{0%{transform:none}24%,94%{transform:translate(20px,2px) rotate(5deg)}100%{transform:none}}
.g-ask{animation-name:g-ask}
@keyframes g-ask{0%,50%{opacity:0;transform:translateY(22px)}60%{opacity:1;transform:none}76%{opacity:1;transform:translate(-92px,14px)}86%,100%{opacity:0;transform:translate(-92px,14px)}}
.g-wave{animation:g-flow .9s linear infinite}
@keyframes g-flow{to{stroke-dashoffset:-20}}
.g-rec{animation-name:g-blink;animation-timing-function:steps(2)}
@keyframes g-blink{0%,100%{opacity:1}50%{opacity:.25}}
.g-bar{transform-origin:70px 0;animation-name:g-bar}
@keyframes g-bar{0%{transform:scaleX(0)}40%,92%{transform:scaleX(1)}100%{transform:scaleX(1);opacity:.4}}
@media (prefers-reduced-motion:reduce){.g-scene *{animation:none!important}}
/* up to a wide laptop the tray (with its page actions, 900 px) spans the middle of the screen, so zoom and pages sit just above it */
@media (min-width:721px) and (max-width:1439px){body:not(.role-viewer) .zoom-ctl,body:not(.role-viewer) .page-pill{bottom:126px}body:not(.role-viewer) .toasts{bottom:178px}}
/* a phone on its side has little height: pinch to zoom, page arrows at the top like a phone held upright */
@media (min-width:721px) and (max-height:520px) and (pointer:coarse){
  body:not(.role-viewer) .zoom-ctl{display:none}
  body:not(.role-viewer) .page-pill{bottom:auto;top:10px;right:10px}
}

/* ================= TeachPen 11: the whole class ================= */
:root{--class:#17203A;--ok:#1E8C4E;--mid:#D9730D}
.hide-xs{}
@media (max-width:480px){.hide-xs{display:none!important}}

/* ---------- home ---------- */
.home-top{max-width:1240px}
.home-links{align-items:center}
.join-btn{margin-left:6px}
.hero2{max-width:1240px;margin:10px auto 0;display:grid;grid-template-columns:minmax(0,.92fr) minmax(0,1.08fr);gap:clamp(28px,5vw,72px);align-items:center;padding:18px 0 34px}
.eyebrow{display:inline-flex;align-items:center;gap:10px;margin:0 0 18px;padding:6px 14px 6px 10px;border-radius:999px;background:#fff;box-shadow:0 0 0 1px var(--rule) inset;font-weight:700;font-size:13.5px;color:var(--ink-2)}
.eb-dot{width:9px;height:9px;border-radius:50%;background:var(--ok);box-shadow:0 0 0 4px rgba(30,140,78,.16)}
.hero-hl{color:var(--quink);padding:0 .06em;background:linear-gradient(transparent 58%,rgba(255,224,71,.62) 58%,rgba(255,224,71,.62) 90%,transparent 90%) no-repeat 0 0/100% 100%;-webkit-box-decoration-break:clone;box-decoration-break:clone;animation:hlSwipe .9s .5s var(--ease) both}
@keyframes hlSwipe{from{background-size:0% 100%}}
.hero-copy2 .hero-title{isolation:isolate}
/* the job in searchers' words, above the promise (the page title says the same) */
.hero-kw{display:block;margin:0 0 12px;font-family:var(--ui,system-ui,sans-serif);font-weight:800;font-size:13px;line-height:1.3;letter-spacing:.08em;text-transform:uppercase;color:var(--quink)}
.btn-class{background:var(--class);color:#fff;box-shadow:0 1px 0 rgba(255,255,255,.18) inset,0 6px 16px -8px rgba(23,32,58,.7)}
.btn-class:hover{background:#0B1226}
.btn-class svg .fill{fill:#FF5A4E}
.hero-more{display:flex;flex-wrap:wrap;gap:4px 8px;margin:14px 0 0 -10px}
.hero-more .link-btn{display:inline-flex;align-items:center;gap:8px;font-size:14.5px}
.hero-proof{margin:18px 0 0;font-size:14px;color:var(--ink-3)}
.hero-scene{position:relative;padding:36px 50px 110px 40px}
.answers-chip{position:absolute;z-index:3;top:4px;left:58px;display:inline-flex;align-items:center;gap:8px;padding:8px 14px 8px 12px;border-radius:999px;background:var(--ink);color:#fff;font-weight:600;font-size:13.5px;box-shadow:var(--float);animation:popIn .5s 3.4s var(--ease) both}
.answers-chip b{font-variant-numeric:tabular-nums}
.ac-dot{width:8px;height:8px;border-radius:50%;background:#5BE38B;box-shadow:0 0 0 4px rgba(91,227,139,.25)}
/* TeachPen 13 hero: a lesson being recorded, its link on a phone, its chapters */
.btn-rec{background:var(--red);color:#fff;box-shadow:0 1px 0 rgba(255,255,255,.2) inset,0 8px 18px -8px rgba(217,58,47,.75)}
.btn-rec:hover{background:#B92D24}
.btn-rec svg{stroke:#fff}.btn-rec svg .fill{fill:#fff}
.rec-chip .ac-dot{background:#FF5A4E;box-shadow:0 0 0 4px rgba(255,90,78,.28);animation:recBlink 1.6s ease-in-out infinite}
@keyframes recBlink{50%{opacity:.35}}
.hero-cam{position:absolute;z-index:3;left:62px;top:58px;width:clamp(58px,6.4vw,84px);aspect-ratio:1;border-radius:50%;background:linear-gradient(160deg,#DCE4FF,#AFC0F7);box-shadow:0 0 0 3px #fff,0 12px 24px -10px rgba(23,32,58,.5);overflow:hidden;animation:pop .6s var(--ease) .6s both}
.hero-cam svg{width:100%;height:100%;fill:#2B47C9;opacity:.85}
.hero-cap{position:absolute;z-index:3;left:50%;bottom:150px;transform:translateX(-50%);max-width:78%;margin:0;padding:7px 14px;border-radius:12px;background:rgba(23,32,58,.88);color:#fff;font-weight:600;font-size:clamp(11px,1.05vw,14px);line-height:1.3;text-align:center;box-shadow:var(--float);animation:pop .6s var(--ease) 1.4s both}
.ph-k{margin:0;font-weight:800;font-size:.8em;letter-spacing:.05em;text-transform:uppercase;color:var(--quink)}
.ph-bar{position:relative;height:4px;margin:2px 0;border-radius:99px;background:var(--rule)}
.ph-bar i{position:absolute;inset:0 42% 0 0;border-radius:inherit;background:var(--quink)}
.ph-now{margin:0;font-weight:700;color:var(--ink)}
.ph-ch{margin:0;padding:4px 5px;border-radius:6px;color:var(--ink-2);font-weight:600}
.ph-ch b{color:var(--quink);margin-right:3px;font-variant-numeric:tabular-nums}
.ph-ch.ph-pick{background:var(--quink-soft);color:var(--ink)}
.ph-cc{margin:auto 0 0;align-self:flex-start;padding:2px 6px;border-radius:5px;background:var(--ink);color:#fff;font-weight:800;font-size:.85em}
.flow-class{padding-top:0}
.tp-langs{display:flex;flex-wrap:wrap;gap:6px 14px;font-weight:700}
.tp-langs a{color:var(--ink-2)}
[dir=rtl] .tp-langs a[lang=en],[dir=rtl] .tp-langs a[lang=es],[dir=rtl] .tp-langs a[lang=pt-BR],[dir=rtl] .tp-langs a[lang=id],[dir=rtl] .tp-langs a[lang=hi]{direction:ltr}
@keyframes popIn{from{opacity:0;transform:translateY(8px) scale(.94)}}
.phone{position:absolute;z-index:2;width:clamp(84px,9vw,124px);aspect-ratio:9/18;padding:5px;border-radius:22px;background:linear-gradient(160deg,#2A3349,#0E1424);box-shadow:0 0 0 1px rgba(255,255,255,.08) inset,0 22px 40px -18px rgba(14,20,36,.7);animation:phoneIn .7s var(--ease) both}
.ph-screen{height:100%;border-radius:17px;background:#fff;padding:16px 9px 10px;display:flex;flex-direction:column;gap:6px;overflow:hidden;font-size:clamp(8.5px,.85vw,11px);line-height:1.25}
.ph-q{margin:0 0 2px;font-weight:800;color:var(--ink);font-size:1.1em}
.ph-1{left:0;bottom:30px;transform:rotate(-7deg);animation-delay:.9s}
.ph-2{right:0;top:40px;transform:rotate(6deg);animation-delay:1.2s}
.ph-3{right:40px;bottom:0;transform:rotate(-3deg);animation-delay:1.5s}
@keyframes phoneIn{from{opacity:0;translate:0 26px}}
.ph-draw{width:100%;height:auto;border-radius:8px;background:#F4F6FA;box-shadow:0 0 0 1px var(--rule-2) inset}
.ph-tri{fill:none;stroke:#17203A;stroke-width:2.4;stroke-linejoin:round}
.ph-ink{fill:none;stroke:var(--red);stroke-width:3;stroke-linecap:round;stroke-dasharray:40;stroke-dashoffset:40;animation:inkIn .7s 2.2s var(--ease) forwards}
.ph-ink2{animation-delay:2.7s}
@keyframes inkIn{to{stroke-dashoffset:0}}
.ph-sent{margin:auto 0 0;font-weight:700;color:var(--ok);animation:popIn .4s 3.2s both}
.ph-opt{margin:0;display:flex;align-items:center;gap:6px;padding:5px 6px;border-radius:7px;box-shadow:0 0 0 1px var(--rule) inset;font-weight:600;color:var(--ink-2)}
.ph-opt b{display:grid;place-items:center;width:1.6em;height:1.6em;border-radius:5px;background:var(--desk);color:var(--ink)}
.ph-pick{animation:pickOn .35s 2.6s var(--ease) forwards}
.ph-pick b{animation:pickB .35s 2.6s forwards}
@keyframes pickOn{to{background:var(--quink-soft);box-shadow:0 0 0 2px var(--quink) inset;color:var(--quink)}}
@keyframes pickB{to{background:var(--quink);color:#fff}}
.ph-chk{margin:4px 0 0;display:flex;justify-content:space-between;font-size:1.7em}
.ph-chk span{display:grid;place-items:center;width:1.5em;height:1.5em;border-radius:50%;background:var(--desk)}
.ph-e1{animation:chkOn .35s 3s var(--ease) forwards}
@keyframes chkOn{to{background:#DDF5E6;box-shadow:0 0 0 2px var(--ok);transform:scale(1.08)}}
.ph-hand{margin:auto 0 0;padding:5px 6px;border-radius:8px;background:#FFF4D1;font-weight:700;color:#7A5200;animation:popIn .4s 3.6s both}

.flow{max-width:1240px;margin:64px auto 0}
.kicker{margin:0 0 6px;font-weight:800;font-size:13px;letter-spacing:.08em;text-transform:uppercase;color:var(--quink)}
.flow h2,.schools-band h2{font-size:clamp(26px,3.2vw,38px);line-height:1.15;margin:0;font-weight:800;letter-spacing:-.015em}
.flow-list{list-style:none;margin:24px 0 0;padding:0;display:grid;grid-template-columns:repeat(4,1fr);gap:18px;counter-reset:fl}
.flow-list li{position:relative;padding:22px 20px 22px;border-radius:18px;background:#fff;box-shadow:0 0 0 1px var(--rule-2) inset,0 10px 30px -20px rgba(23,32,58,.35)}
.flow-list li::after{content:"";position:absolute;top:44px;right:-14px;width:12px;height:2px;background:var(--rule)}
.flow-list li:last-child::after{display:none}
.fl-n{display:grid;place-items:center;width:42px;height:42px;border-radius:13px;background:var(--quink-soft);color:var(--quink);font-family:var(--hand);font-weight:700;font-size:24px}
.flow-list h3{margin:14px 0 6px;font-size:18px;font-weight:800}
.flow-list p{margin:0;color:var(--ink-2);font-size:15px}

.schools-band{max-width:1240px;margin:64px auto 0;display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:40px;align-items:center;padding:clamp(28px,4vw,52px);border-radius:28px;color:#fff;background:radial-gradient(120% 140% at 0% 0%,#24305A 0%,var(--ink) 55%,#0E1424 100%);box-shadow:0 30px 60px -34px rgba(14,20,36,.8)}
.schools-band .kicker{color:var(--hilite)}
.schools-band p{color:#C9D0E2;font-size:17px;line-height:1.6;margin:14px 0 0;max-width:34em}
.sb-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:26px}
.btn-ghost{color:#fff;box-shadow:0 0 0 1.5px rgba(255,255,255,.35) inset}
.btn-ghost:hover{background:rgba(255,255,255,.08)}
.sb-facts{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:1fr 1fr;gap:14px}
.sb-facts li{padding:18px;border-radius:18px;background:rgba(255,255,255,.06);box-shadow:0 0 0 1px rgba(255,255,255,.09) inset}
.sb-facts b{display:block;font-family:var(--hand);font-size:clamp(34px,3.6vw,46px);line-height:1;color:var(--hilite)}
.sb-facts span{display:block;margin-top:6px;color:#C9D0E2;font-size:14.5px}
.uses{max-width:1240px}
.shelf{max-width:1240px}
.home-foot{max-width:1240px}
@media (max-width:1099px){
  .hero2{grid-template-columns:1fr;gap:18px}
  .hero-scene{max-width:640px;width:100%;margin:0 auto}
  .flow-list{grid-template-columns:1fr 1fr}
  .flow-list li::after{display:none}
  .schools-band{grid-template-columns:1fr}
}
@media (max-width:720px){
  .hero2{padding-top:4px}
  .hero-title{font-size:clamp(36px,10.5vw,52px)}
  .hero-scene{padding:30px 34px 86px 22px}
  .ph-3{right:28px}
  .answers-chip{left:26px;font-size:12.5px}
  .flow-list{grid-template-columns:1fr}
  .sb-facts{grid-template-columns:1fr 1fr}
  .eyebrow{font-size:12.5px}
}

/* ---------- studio: class controls in the top bar ---------- */
.ask-btn{display:none}
body.class-live .ask-btn{display:inline-flex}
.ask-btn.busy{background:var(--ok)}
.ask-btn.busy:hover{background:#17703E}
.live-btn{position:relative}
.live-btn.on{font-variant-numeric:tabular-nums}
.live-badge{display:inline-grid;place-items:center;min-width:22px;height:20px;padding:0 6px;margin-left:-2px;border-radius:999px;background:#FFE7A3;color:#6B4A00;font-size:12px;font-weight:800}
@media (max-width:860px){.ask-btn span{display:none}.ask-btn{padding:0;width:40px}.live-btn.on span.live-label{display:inline;font-size:13px}.live-btn.on{width:auto;padding:0 10px}}
@media (max-width:480px){.live-btn.on span.live-label{display:none}.live-btn.on{width:40px;padding:0}}

/* the class panel */
.class-panel{position:absolute;z-index:30;top:var(--top-h);right:0;bottom:0;width:348px;max-width:100%;overflow:auto;overscroll-behavior:contain;background:#fff;box-shadow:-1px 0 0 var(--rule),-24px 0 48px -32px rgba(23,32,58,.35);padding:14px 16px 18px;animation:panelIn .22s var(--ease)}
@keyframes panelIn{from{transform:translateX(24px);opacity:0}}
body.panel-open .studio .tray-wrap{left:calc((100% - 348px)/2)}
@media (max-width:1099px){
  .class-panel{top:calc(var(--top-h) + 10px);right:10px;bottom:auto;max-height:calc(100% - var(--top-h) - 136px);border-radius:18px;box-shadow:var(--float)}
  body.panel-open .studio .tray-wrap{left:50%}
}
@media (max-width:720px){.class-panel{left:8px;right:8px;width:auto;max-height:calc(100% - var(--top-h) - 120px)}body.panel-open .studio .tray-wrap{left:0}}
.cp-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.cp-head h2{display:flex;align-items:center;gap:9px;margin:0;font-size:16px;font-weight:800}
.cp-dot{width:10px;height:10px;border-radius:50%;background:var(--red);animation:blink 1.4s steps(2) infinite}
.cp-dot.wait{background:var(--ink-3);animation:none}
.cp-code{display:grid;grid-template-columns:96px 1fr;gap:14px;align-items:center;padding:12px;border-radius:16px;background:var(--desk)}
.cp-qr{width:96px;height:96px;padding:6px;border-radius:12px;background:#fff;box-shadow:0 0 0 1px var(--rule)}
.cp-qr svg{width:100%;height:100%}
.cp-qr:hover{box-shadow:0 0 0 2px var(--quink)}
.cp-code-side{min-width:0}
.cp-code-side small{display:block;font-size:12px;font-weight:700;color:var(--ink-3);text-transform:uppercase;letter-spacing:.06em}
.cp-big{display:block;font-size:32px;line-height:1.1;font-weight:800;letter-spacing:.12em;color:var(--ink)}
.cp-link{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:2px 0;font-size:12.5px;font-weight:600;color:var(--quink);text-align:left}
.cp-row{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
.cp-acts{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:14px}
.cp-act{display:flex;align-items:center;gap:10px;padding:12px;border-radius:14px;background:#fff;box-shadow:0 0 0 1px var(--rule) inset;font-weight:700;font-size:14px;text-align:left;transition:box-shadow .15s,background .15s}
.cp-act:hover{box-shadow:0 0 0 2px var(--quink) inset}
.cp-act svg{color:var(--quink);width:22px;height:22px}
.cp-act-main{grid-column:1/-1;background:var(--quink);color:#fff;box-shadow:0 8px 20px -10px rgba(43,71,201,.8)}
.cp-act-main svg{color:#fff}
.cp-act-main:hover{background:var(--quink-2);box-shadow:0 8px 20px -10px rgba(43,71,201,.8)}
.cp-act[aria-pressed="true"]{background:var(--quink-soft)}
.cp-sec{margin-top:18px}
.cp-sec:empty{display:none}
.cp-sec-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.cp-sec h3{margin:0;font-size:14px;font-weight:800;color:var(--ink-2)}
.cp-sec h3 b{display:inline-grid;place-items:center;min-width:24px;height:22px;padding:0 6px;margin-left:4px;border-radius:999px;background:var(--desk);color:var(--ink);font-size:12.5px}
.cp-people{list-style:none;margin:8px 0 0;padding:0;display:flex;flex-wrap:wrap;gap:6px}
.cp-people li{display:inline-flex;align-items:center;gap:7px;padding:4px 10px 4px 4px;border-radius:999px;background:var(--desk);font-size:13.5px;font-weight:600}
.cp-people li.hand{background:#FFF1C2;padding-left:8px}
.cp-ini{display:grid;place-items:center;width:24px;height:24px;border-radius:50%;background:hsl(var(--h) 55% 88%);color:hsl(var(--h) 45% 30%);font-size:12px;font-weight:800}
.cp-empty{margin:8px 0 0;color:var(--ink-3);font-size:14px}
.cp-qs{list-style:none;margin:8px 0 0;padding:0;display:flex;flex-direction:column;gap:8px}
.cp-qs li{padding:10px 12px 6px;border-radius:12px;background:var(--desk)}
.cp-qs p{margin:0;font-weight:600}
.cp-qs small{color:var(--ink-3)}
.cp-q-acts{display:flex;gap:2px;margin:2px -8px 0 auto;justify-content:flex-end}
.cp-last{margin-top:14px;font-size:14px;color:var(--quink)}
.cp-foot{margin-top:18px;padding-top:14px;border-top:1px solid var(--rule-2)}
.cp-note{margin:0;color:var(--ink-3);font-size:13px}
.cp-foot .cp-row{justify-content:space-between}

/* ---------- ask the class (dialog) ---------- */
.kind-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin:14px 0 16px}
.kind{display:flex;flex-direction:column;align-items:flex-start;gap:4px;padding:12px;border-radius:16px;text-align:left;box-shadow:0 0 0 1px var(--rule) inset;background:#fff;transition:box-shadow .15s,background .15s}
.kind svg{width:40px;height:40px}
.kind b{font-size:15px}
.kind small{color:var(--ink-3);font-size:12.5px;line-height:1.35}
.kind:hover{box-shadow:0 0 0 2px var(--ink-3) inset}
.kind[aria-checked="true"]{background:var(--quink-soft);box-shadow:0 0 0 2px var(--quink) inset}
.a-paper{fill:#fff;stroke:#AEB8CC;stroke-width:1.6}
.a-ink{fill:none;stroke:var(--quink);stroke-width:2.6;stroke-linecap:round}
.a-on{fill:var(--quink);stroke:none}
.a-ok{fill:#5BC487}.a-mid{fill:#F2B04B}.a-bad{fill:#EC6B60}
.a-caret{stroke:var(--red);stroke-width:2.4;stroke-linecap:round}
.fld{display:block;margin:0 0 12px}
.fld>span,.fld-l{display:block;font-weight:700;font-size:14px;margin-bottom:6px}
.fld small{color:var(--ink-3);font-weight:500}
.ak-more{margin-bottom:6px}
.seg{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:10px}
.seg [role=radio]{display:inline-flex;align-items:center;gap:6px;height:38px;padding:0 14px;border-radius:999px;font-weight:600;font-size:14px;box-shadow:0 0 0 1px var(--rule) inset;background:#fff}
.seg [role=radio] small{color:var(--ink-3)}
.seg [role=radio][aria-checked="true"]{background:var(--ink);color:#fff;box-shadow:none}
.seg [role=radio][aria-checked="true"] small{color:#C9D0E2}
.seg [role=radio]:disabled{opacity:.45;cursor:not-allowed}
.ak-opts{display:grid;gap:6px}
.ak-opt{display:flex;gap:8px;align-items:center}
.ak-letter{flex:none;width:40px;height:40px;border-radius:11px;background:var(--desk);font-weight:800;box-shadow:0 0 0 1px var(--rule) inset}
.ak-letter.right{background:var(--ok);color:#fff;box-shadow:none}
.sheet .ak-opt input[type=text]{height:40px;font-size:15px}
.ak-warn{margin:10px 0 0!important;font-size:14px}
.row-left{justify-content:flex-start!important;align-items:center}
.preset-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:8px;margin:6px 0 4px}
.preset{display:flex;flex-direction:column;align-items:center;padding:12px 4px;border-radius:14px;box-shadow:0 0 0 1px var(--rule) inset;background:#fff}
.preset b{font-size:24px;line-height:1.1}
.preset small{color:var(--ink-3);font-size:12px}
.preset:hover{box-shadow:0 0 0 2px var(--quink) inset;color:var(--quink)}
.num-input{width:80px;height:42px;border-radius:12px;border:1.5px solid var(--rule);padding:0 10px;font-size:16px;font-weight:700}
.sheet textarea{width:100%;border-radius:12px;border:1.5px solid var(--rule);padding:10px 12px;font-size:15px;resize:vertical;margin-bottom:10px}
.sheet textarea:focus,.num-input:focus{outline:none;border-color:var(--quink);box-shadow:0 0 0 3px var(--quink-soft)}
.check{display:flex;align-items:center;gap:10px;font-size:14px;font-weight:600;color:var(--ink-2)}
.check input{width:18px;height:18px;accent-color:var(--quink)}
@media (max-width:720px){.kind-grid{grid-template-columns:1fr 1fr}.preset-grid{grid-template-columns:repeat(3,1fr)}}

/* ---------- the answer wall ---------- */
.act-wall{position:absolute;inset:0;z-index:25;display:flex;flex-direction:column;background:var(--desk);overflow:auto;touch-action:auto;animation:wallIn .22s var(--ease)}
@keyframes wallIn{from{opacity:0;transform:translateY(10px)}}
.aw-head{position:sticky;top:0;z-index:2;display:flex;flex-wrap:wrap;align-items:center;gap:12px 20px;padding:16px 20px;background:rgba(238,240,243,.94);backdrop-filter:blur(8px);box-shadow:0 1px 0 var(--rule)}
.aw-q{flex:1 1 320px;min-width:0}
.aw-kind{display:inline-flex;align-items:center;gap:6px;font-size:12.5px;font-weight:800;color:var(--ink-3);text-transform:uppercase;letter-spacing:.06em}
.aw-kind svg{width:22px;height:22px}
.aw-q h2{margin:2px 0 0;font-size:clamp(20px,2.4vw,28px);line-height:1.2;font-weight:800}
.aw-meter{display:flex;flex-direction:column;gap:6px;min-width:170px}
.aw-count{font-weight:800;font-size:15px;font-variant-numeric:tabular-nums}
.aw-bar{display:block;height:8px;border-radius:99px;background:#fff;box-shadow:0 0 0 1px var(--rule) inset;overflow:hidden}
.aw-bar i{display:block;height:100%;background:var(--ok);border-radius:99px;transition:width .4s var(--ease)}
.aw-acts{display:flex;flex-wrap:wrap;gap:6px}
.aw-body{flex:1;padding:20px}
.aw-draw{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:16px;align-content:start}
.aw-empty{grid-column:1/-1;margin:40px auto;text-align:center;color:var(--ink-3);font-family:var(--hand);font-size:24px}
.ans-card{position:relative;display:block;aspect-ratio:var(--ar);border-radius:14px;overflow:hidden;background:#fff;box-shadow:0 0 0 1px var(--rule-2),0 10px 24px -18px rgba(23,32,58,.5);transition:transform .15s var(--ease),box-shadow .15s;animation:popIn .3s var(--ease)}
.ans-card canvas{display:block;width:100%;height:100%}
button.ans-card:hover{transform:translateY(-2px);box-shadow:0 0 0 2px var(--quink),0 16px 30px -18px rgba(23,32,58,.5)}
.ans-name{position:absolute;left:8px;bottom:8px;max-width:calc(100% - 16px);padding:3px 9px;border-radius:999px;background:rgba(23,32,58,.82);color:#fff;font-size:12.5px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ans-card.waiting{display:grid;place-items:center;background:transparent;box-shadow:none;border:2px dashed var(--alu-edge)}
.ans-wait{color:var(--ink-3);font-weight:600;font-size:14px;padding:0 10px;text-align:center}
.aw-focus{position:fixed;inset:0;z-index:40;display:grid;place-items:center;padding:20px;background:rgba(23,32,58,.6);backdrop-filter:blur(3px)}
.awf-card{max-width:min(1200px,94vw);border-radius:18px;overflow:hidden;background:#fff;box-shadow:var(--float)}
.awf-card canvas{display:block;width:100%;height:auto;max-height:calc(100dvh - 130px);object-fit:contain}
.awf-bar{display:flex;flex-wrap:wrap;align-items:center;gap:6px;padding:10px 12px;border-top:1px solid var(--rule-2)}
.awf-name{font-weight:800;padding:0 6px}
.bars{display:flex;flex-direction:column;gap:14px;max-width:980px;margin:10px auto}
.bar-row{display:flex;align-items:center;gap:16px;padding:14px 18px;border-radius:18px;background:#fff;box-shadow:0 0 0 1px var(--rule-2)}
.bar-row.right{box-shadow:0 0 0 2.5px var(--ok)}
.bar-k{display:grid;place-items:center;flex:none;width:52px;height:52px;border-radius:14px;background:var(--quink);color:#fff;font-size:24px;font-weight:800}
.chk-0 .bar-k,.chk-1 .bar-k,.chk-2 .bar-k{background:var(--desk);font-size:28px}
.bar-main{flex:1;min-width:0}
.bar-l{display:block;font-weight:700;font-size:17px;margin-bottom:6px}
.bar-l b{color:var(--ok);font-size:14px}
.bar-track{display:block;height:18px;border-radius:99px;background:var(--desk);overflow:hidden}
.bar-track i{display:block;height:100%;border-radius:99px;background:var(--quink);transition:width .5s var(--ease)}
.chk-0 .bar-track i{background:var(--ok)}.chk-1 .bar-track i{background:var(--mid)}.chk-2 .bar-track i{background:var(--red)}
.bar-who{display:block;margin-top:6px;color:var(--ink-3);font-size:13.5px}
.bar-n{flex:none;text-align:right;min-width:60px}
.bar-n b{display:block;font-size:28px;line-height:1;font-variant-numeric:tabular-nums}
.bar-n small{color:var(--ink-3);font-weight:700}
.texts{columns:3 260px;column-gap:14px}
.text-card{break-inside:avoid;margin:0 0 14px;padding:14px 14px 6px;border-radius:14px;background:#fff;box-shadow:0 0 0 1px var(--rule-2);animation:popIn .3s var(--ease)}
.text-card p{margin:0;font-size:18px;font-weight:600;line-height:1.4;word-wrap:break-word}
.tc-foot{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:6px}
.tc-foot small{color:var(--ink-3);font-weight:600}
body.wall-open .tray-wrap,body.wall-open .zoom-ctl,body.wall-open .page-pill{visibility:hidden}
@media (max-width:720px){.aw-head{padding:12px}.aw-body{padding:12px}.aw-draw{grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px}.bar-row{padding:10px 12px;gap:10px}.bar-k{width:40px;height:40px;font-size:19px}}

/* ---------- widgets: timer + name picker ---------- */
.w-timer{position:absolute;z-index:11;top:14px;right:14px;display:flex;align-items:center;gap:10px;padding:8px 10px 8px 8px;border-radius:999px;background:#fff;box-shadow:var(--float);--k:1}
.wt-ring{width:36px;height:36px;border-radius:50%;background:conic-gradient(var(--quink) calc(var(--k) * 360deg),var(--rule-2) 0);-webkit-mask:radial-gradient(circle,transparent 11px,#000 12px);mask:radial-gradient(circle,transparent 11px,#000 12px)}
.wt-time{font-size:30px;font-weight:800;font-variant-numeric:tabular-nums;line-height:1;min-width:2.6em;text-align:center}
.wt-ctl{display:flex;align-items:center;gap:2px}
.wt-ctl .icon-btn{width:34px;height:34px}
.wt-add{height:34px;padding:0 10px;border-radius:10px;font-weight:800;font-size:14px;color:var(--ink-2)}
.wt-add:hover{background:rgba(23,32,58,.07)}
.w-timer.soon .wt-time{color:var(--mid)}
.w-timer.soon .wt-ring{background:conic-gradient(var(--mid) calc(var(--k) * 360deg),var(--rule-2) 0)}
.w-timer.paused .wt-time{opacity:.55}
.w-timer.done{background:var(--red);color:#fff;animation:timeUp 1s ease-in-out 3}
.w-timer.done .wt-ring{display:none}
.w-timer.done .wt-time{font-size:24px;padding-left:8px;min-width:0}
.w-timer.done .icon-btn{color:#fff}
@keyframes timeUp{50%{transform:scale(1.08)}}
body.role-viewer .host-only{display:none!important}
body.role-viewer .w-timer{padding:8px 16px 8px 8px}
body.presenting .w-timer{top:18px;right:18px;transform:scale(1.15);transform-origin:top right}
.w-pick{position:absolute;inset:0;z-index:24;display:grid;place-items:center;padding:20px;background:rgba(238,240,243,.72);backdrop-filter:blur(3px);animation:wallIn .2s var(--ease)}
.wp-card{min-width:min(560px,90vw);padding:30px 36px 26px;border-radius:28px;background:#fff;text-align:center;box-shadow:var(--float)}
.wp-lead{margin:0;font-weight:800;font-size:14px;letter-spacing:.08em;text-transform:uppercase;color:var(--ink-3)}
.wp-name{margin:8px 0 10px;font-family:var(--hand);font-weight:700;font-size:clamp(44px,7vw,92px);line-height:1.1;color:var(--ink);word-break:break-word}
.w-pick.landed .wp-name{color:var(--quink);animation:landed .5s var(--ease)}
@keyframes landed{0%{transform:scale(.85)}60%{transform:scale(1.08)}100%{transform:none}}
.wp-acts{display:flex;justify-content:center;gap:8px;margin:0}

/* ---------- the student's answer sheet ---------- */
.ans-sheet{position:fixed;inset:0;z-index:45;display:flex;flex-direction:column;background:#F4F6FA;animation:wallIn .22s var(--ease)}
.as-head{display:flex;align-items:flex-start;gap:12px;padding:calc(12px + env(safe-area-inset-top,0px)) 14px 10px;background:#fff;box-shadow:0 1px 0 var(--rule)}
.as-head-text{flex:1;min-width:0}
.as-head small{font-weight:800;font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:var(--quink)}
.as-q{margin:2px 0 0;font-size:clamp(19px,5vw,26px);line-height:1.25;font-weight:800;word-wrap:break-word}
body.sheet-open:has(#w-timer:not([hidden])) .as-head{padding-top:64px}
body.sheet-open .w-timer{position:fixed;z-index:46;top:8px;left:50%;right:auto;transform:translateX(-50%) scale(.82);transform-origin:top center}
.as-body{flex:1;min-height:0;display:flex;flex-direction:column;padding:14px}
.as-foot{display:flex;flex-wrap:wrap;justify-content:space-between;gap:4px 12px;padding:10px 16px calc(10px + var(--safe-b));font-size:13.5px;background:#fff;box-shadow:0 -1px 0 var(--rule)}
.as-status{font-weight:700;color:var(--ok)}
.as-private{color:var(--ink-3)}
.as-opts{display:grid;gap:10px;margin:auto 0;width:100%;max-width:620px;align-self:center}
.as-opt{position:relative;display:flex;align-items:center;gap:14px;min-height:64px;padding:10px 16px 10px 10px;border-radius:18px;background:#fff;text-align:left;font-size:18px;font-weight:700;box-shadow:0 0 0 1.5px var(--rule) inset,0 4px 12px -8px rgba(23,32,58,.3);overflow:hidden;--pct:0%}
.as-opt::before{content:"";position:absolute;inset:0;width:var(--pct);background:rgba(43,71,201,.1);transition:width .5s var(--ease)}
.as-opt>*{position:relative}
.as-k{display:grid;place-items:center;flex:none;width:46px;height:46px;border-radius:13px;background:var(--desk);font-size:21px;font-weight:800}
.as-l{flex:1}
.as-res{font-variant-numeric:tabular-nums;color:var(--ink-3);font-size:16px}
.as-opt[aria-pressed="true"]{box-shadow:0 0 0 3px var(--quink) inset;color:var(--quink)}
.as-opt[aria-pressed="true"] .as-k{background:var(--quink);color:#fff}
.as-check .as-k{font-size:28px;background:transparent}
.as-check .as-opt[aria-pressed="true"] .as-k{background:transparent}
.as-check .chk-0[aria-pressed="true"]{box-shadow:0 0 0 3px var(--ok) inset;color:var(--ok)}
.as-check .chk-1[aria-pressed="true"]{box-shadow:0 0 0 3px var(--mid) inset;color:var(--mid)}
.as-check .chk-2[aria-pressed="true"]{box-shadow:0 0 0 3px var(--red) inset;color:var(--red)}
.as-opt.right{box-shadow:0 0 0 3px var(--ok) inset}
.as-opt.right .as-l::after{content:" ✓";color:var(--ok)}
.as-opt.wrong{opacity:.75}
.as-text{display:flex;flex-direction:column;gap:12px;width:100%;max-width:620px;margin:auto 0;align-self:center}
.as-text textarea{width:100%;border-radius:16px;border:1.5px solid var(--rule);padding:14px;font-size:18px;resize:none;background:#fff}
.as-text textarea:focus{outline:none;border-color:var(--quink);box-shadow:0 0 0 3px var(--quink-soft)}
.sk-wrap{flex:1;min-height:0;display:grid;place-items:center}
.sk-cv{display:block;border-radius:14px;background:#fff;box-shadow:0 0 0 1px var(--rule),0 10px 30px -18px rgba(23,32,58,.5);touch-action:none;cursor:crosshair}
.sk-tools{display:flex;align-items:center;justify-content:center;gap:8px;padding-top:12px}
.sk-color{width:38px;height:38px;border-radius:50%;background:var(--c);box-shadow:0 0 0 3px #fff inset,0 0 0 1px rgba(23,32,58,.25)}
.sk-color[aria-pressed="true"]{box-shadow:0 0 0 3px #fff inset,0 0 0 3px var(--ink)}
.sk-sep{width:1px;height:28px;background:var(--rule);margin:0 4px}
.sk-btn{display:grid;place-items:center;width:44px;height:44px;border-radius:13px;background:#fff;box-shadow:0 0 0 1px var(--rule) inset;color:var(--ink-2)}
.sk-btn[aria-pressed="true"]{background:var(--ink);color:#fff}
.ans-pill{position:fixed;z-index:44;left:50%;bottom:calc(64px + var(--safe-b));transform:translateX(-50%);display:inline-flex;align-items:center;height:46px;padding:0 20px;border-radius:999px;background:var(--quink);color:#fff;font-weight:700;box-shadow:var(--float);animation:popIn .3s var(--ease)}
.hand-btn.on{background:#FFE7A3;box-shadow:0 0 0 1.5px #E2B33A inset}
.star-burst{position:fixed;inset:0;z-index:90;display:grid;place-items:center;align-content:center;gap:8px;pointer-events:none;animation:wallIn .3s var(--ease)}
.sb-star{font-size:min(40vw,200px);line-height:1;color:#FFC21A;text-shadow:0 10px 30px rgba(217,115,13,.35);animation:starPop 1.2s var(--ease)}
.sb-text{padding:10px 18px;border-radius:999px;background:var(--ink);color:#fff;font-weight:700;font-size:17px}
@keyframes starPop{0%{transform:scale(.2) rotate(-40deg);opacity:0}50%{transform:scale(1.12) rotate(8deg);opacity:1}100%{transform:none}}
.cc-count{min-height:1.4em;margin:-14px 0 24px;font-weight:700;color:var(--ok);font-size:clamp(16px,1.6vw,22px)}

/* ---------- the join poster (printing only) ---------- */
.poster{display:none}
@media print{
  @page{size:A4 portrait;margin:14mm}
  body.print-poster>*:not(.poster){display:none!important}
  body.print-poster{background:#fff;height:auto}
  body.print-poster .poster{display:block;text-align:center;color:#000;font-family:var(--ui)}
  .po-lead{font-family:var(--hand);font-weight:700;font-size:40pt;margin:0 0 8mm}
  .po-qr{width:120mm;height:120mm;margin:0 auto}
  .po-qr svg{width:100%;height:100%}
  .po-code{font-size:72pt;font-weight:800;letter-spacing:.14em;margin:6mm 0 4mm}
  .po-steps{display:inline-block;text-align:left;font-size:15pt;line-height:1.6;margin:0 auto 8mm}
  .po-foot{font-size:10pt;color:#555}
}
/* the timer sits beside the class panel, never under it */
body.panel-open .w-timer{right:calc(348px + 14px)}
@media (max-width:1099px){body.panel-open .w-timer{right:calc(348px + 24px)}}
@media (max-width:720px){body.panel-open .w-timer{right:14px;top:auto;bottom:130px}}
@media (max-width:420px){.home-links .link-btn{padding:8px 6px;font-size:14px}.join-btn{padding:0 10px;margin-left:2px}.join-btn svg{display:none}}

/* ---------- TeachPen Record: camera bubble, recording controls ---------- */
.cam-bubble{position:absolute;z-index:7;border-radius:50%;overflow:hidden;background:var(--ink);box-shadow:0 0 0 4px #fff,var(--float);cursor:grab;touch-action:none}
.cam-bubble:active{cursor:grabbing}
.cam-bubble video{display:block;width:100%;height:100%;object-fit:cover;transform:scaleX(-1);pointer-events:none}
.cam-ctl{position:absolute;left:50%;bottom:9%;transform:translateX(-50%);display:flex;gap:6px;opacity:0;transition:opacity .15s var(--ease)}
.cam-bubble:hover .cam-ctl,.cam-bubble:focus-within .cam-ctl{opacity:1}
.cam-ctl button{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:rgba(23,32,58,.8);color:#fff;font-weight:800;font-size:12.5px}
.cam-ctl button:hover{background:var(--ink)}
.cam-ctl svg{width:15px;height:15px}
@media (pointer:coarse){.cam-ctl{opacity:1}}
.rec-btn.paused{background:var(--ink);color:#fff}
.rec-btn.paused svg .fill{animation:none}
.rec-extra[hidden]{display:none!important}
.rec-extra[aria-pressed="false"]{opacity:.55}

/* ---------- TeachPen Record: the ready check and the countdown ---------- */
.sheet.rc-sheet{width:min(760px,calc(100vw - 24px))}
.rc-sheet .rc-sub{margin-bottom:16px}
.rc-grid{display:grid;grid-template-columns:180px minmax(0,1fr);gap:24px;align-items:start}
.rc-cam{position:relative;aspect-ratio:1;border-radius:50%;overflow:hidden;display:grid;place-items:center;background:var(--desk);box-shadow:0 0 0 1px var(--rule) inset}
.rc-cam video{width:100%;height:100%;object-fit:cover;transform:scaleX(-1)}
.rc-cam video[hidden],.rc-cam-off[hidden]{display:none}
.rc-cam-off{display:flex;flex-direction:column;align-items:center;gap:6px;color:var(--ink-3);font-weight:600;font-size:14px}
.rc-cam-off svg{width:34px;height:34px}
.sheet p.rc-h{margin:16px 0 8px;font-weight:800;font-size:14px;color:var(--ink)}
.rc-opts p.rc-h:first-child{margin-top:0}
.rc-opts .seg{margin-bottom:0}
.rc-line{display:flex;align-items:center;gap:10px;margin-top:12px;flex-wrap:wrap}
.rc-line select{flex:1 1 160px;min-width:0;max-width:100%;height:38px;border-radius:10px;border:1.5px solid var(--rule);padding:0 10px;background:#fff}
.rc-switch{display:inline-flex;align-items:center;gap:10px;height:38px;padding:0 14px 0 8px;border-radius:999px;font-weight:700;background:#fff;box-shadow:0 0 0 1px var(--rule) inset}
.rc-switch::before{content:"";width:36px;height:22px;border-radius:999px;background:var(--rule) radial-gradient(circle at 11px 50%,#fff 7.5px,transparent 8px);transition:background-color .2s var(--ease)}
.rc-switch[aria-checked="true"]::before{background:var(--quink) radial-gradient(circle at 25px 50%,#fff 7.5px,transparent 8px)}
.rc-mic-label{font-weight:700}
.rc-meter{flex:1 1 120px;height:12px;border-radius:999px;overflow:hidden;background:var(--desk);box-shadow:0 0 0 1px var(--rule) inset}
.rc-meter i{display:block;width:0;height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--ok),#E7B400 78%,var(--red))}
.rc-sheet p.rc-note{margin:8px 0 0;font-size:13.5px}
.rc-sheet p.rc-note.warn{color:var(--red);font-weight:600}
.rc-sheet p.rc-note[hidden]{display:none}
.rc-sheet .rc-go-row{position:sticky;bottom:0;z-index:1;justify-content:space-between;align-items:center;margin:18px -24px -22px;padding:14px 24px 18px;background:#fff;border-top:1px solid var(--rule-2);border-radius:0 0 22px 22px}
.rc-count{display:inline-flex;align-items:center;gap:8px;font-weight:600;color:var(--ink-2);cursor:pointer}
.rc-count input{width:18px;height:18px;accent-color:var(--quink)}
.countdown{position:absolute;inset:0;z-index:30;display:grid;place-content:center;justify-items:center;gap:12px;background:rgba(23,32,58,.32);color:#fff;cursor:pointer}
.countdown b{font-family:var(--hand);font-size:clamp(96px,16vw,200px);line-height:1;text-shadow:0 6px 30px rgba(0,0,0,.35);animation:cdPop .8s var(--ease)}
.countdown span{padding:6px 14px;border-radius:999px;background:rgba(23,32,58,.72);font-weight:700}
@keyframes cdPop{0%{transform:scale(.6);opacity:0}30%{transform:scale(1.06);opacity:1}100%{transform:none;opacity:.92}}
@media (max-height:620px) and (min-width:641px){.rc-grid{grid-template-columns:140px minmax(0,1fr);gap:18px}.rc-sheet .rc-sub{margin-bottom:10px}.sheet p.rc-h{margin-top:12px}}
@media (max-width:640px){.rc-grid{grid-template-columns:1fr;gap:16px}.rc-cam{width:132px;margin:0 auto}.rc-sheet .rc-go-row{border-radius:0}}

/* ---------- TeachPen Record: after saving, and the recovery note ---------- */

.sv-sheet p.sv-meta b{color:var(--ink)}
.sv-acts{display:flex;flex-wrap:wrap;gap:10px}
.sv-sheet p.sv-hint{margin:10px 0 0;font-size:13.5px;color:var(--ink-3)}
.sv-copy{display:block;width:100%;min-height:120px;border-radius:12px;border:1.5px solid var(--rule);padding:10px 12px;font:13.5px/1.5 ui-monospace,Consolas,monospace;color:var(--ink);resize:vertical}
.sv-sheet .seg{margin-bottom:0}
/* TeachPen 13: the lesson link, and captions, chapters and notes */
.sheet.sv-sheet{width:min(640px,calc(100vw - 24px))}
.sv-card{margin-top:16px;padding:16px 18px;border-radius:16px;background:var(--desk);box-shadow:0 0 0 1px var(--rule-2) inset}
.sv-card h3{display:flex;align-items:center;gap:8px;margin:0 0 6px;font-size:16.5px}
.sv-card h3 svg{width:20px;height:20px;fill:none;stroke:var(--quink);stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.sv-sheet p.sv-p{margin:0 0 12px;color:var(--ink-2);font-size:14.5px;line-height:1.5}
.sv-sheet p.sv-fine{margin:10px 0 0;color:var(--ink-3);font-size:13px;line-height:1.45}
.sv-sheet .sv-fine .link-btn{font-size:13px;padding:0;height:auto;min-height:0;text-decoration:underline}
.sv-del{color:var(--red)!important}
.sv-bar{height:8px;border-radius:99px;background:#fff;box-shadow:0 0 0 1px var(--rule) inset;overflow:hidden}
.sv-bar i{display:block;height:100%;border-radius:inherit;background:var(--quink);transition:width .3s var(--ease)}
.sv-linkrow{display:flex;gap:10px;margin-bottom:10px}
.sv-linkrow input{flex:1;min-width:0;height:46px;border-radius:12px;border:1.5px solid var(--rule);padding:0 12px;font:600 14.5px var(--ui);color:var(--ink);background:#fff}
.sv-qr{display:flex;align-items:center;gap:16px;margin-top:12px}
.sv-qr[hidden]{display:none}
.sv-qr .qr{width:150px;height:150px;flex:none;padding:8px;border-radius:12px;background:#fff;box-shadow:0 0 0 1px var(--rule)}
.sv-qr .qr svg{width:100%;height:100%}
.sv-qr span{color:var(--ink-2);font-size:14px}
.sv-row{display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;margin-bottom:12px}
.sv-lab{font-weight:600;font-size:14px}
.sv-row select{flex:1 1 200px;min-width:0;height:44px;border-radius:12px;border:1.5px solid var(--rule);padding:0 12px;background:#fff;font:600 14.5px var(--ui);color:var(--ink)}
.sv-chapters{list-style:none;margin:0 0 12px;padding:0;display:grid;gap:6px;max-height:min(40dvh,320px);overflow:auto}
.sv-chapters li{display:flex;align-items:center;gap:10px}
.sv-chapters span{flex:none;width:58px;font:700 13.5px var(--ui);color:var(--quink);font-variant-numeric:tabular-nums;text-align:right}
.sv-chapters input{flex:1;min-width:0;height:40px;border-radius:10px;border:1.5px solid var(--rule);padding:0 10px;font:600 14.5px var(--ui);color:var(--ink);background:#fff}
.sv-chapters input:focus,.sv-linkrow input:focus,.sv-row select:focus{outline:none;border-color:var(--quink);box-shadow:0 0 0 3px var(--quink-soft)}
.sv-sheet .sv-use{margin-bottom:0}
.my-links{list-style:none;margin:8px 0 0;padding:0;display:grid;gap:8px;max-height:60dvh;overflow:auto}
.my-links li{display:flex;align-items:center;gap:8px;padding:10px 10px 10px 14px;border-radius:14px;background:var(--desk)}
.my-links li>div{flex:1;min-width:0;display:grid}
.my-links b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.my-links span{color:var(--ink-3);font-size:13px}
@media (max-width:560px){.sv-linkrow{flex-direction:column}.sv-qr{flex-direction:column;text-align:center}}

/* ---------- TeachPen 13: the lesson player (a lesson link) ---------- */
body.role-lesson .live-banner{bottom:calc(84px + var(--safe-b))}
body.role-lesson .captions{bottom:calc(92px + var(--safe-b))}
body.role-lesson .zoom-ctl{bottom:calc(84px + var(--safe-b))}
body.role-lesson .page-pill,body.role-lesson .countdown{display:none}
body.role-lesson .toasts{bottom:calc(150px + var(--safe-b))}
@media (min-width:721px){body.lp-panel-open .captions,body.lp-panel-open .toasts{left:calc((100% - 424px) / 2)}body.lp-panel-open .captions{max-width:calc(100% - 470px)}}
.lp-bar{position:fixed;z-index:12;left:50%;bottom:calc(12px + var(--safe-b));transform:translateX(-50%);width:min(980px,calc(100% - 24px));display:flex;align-items:center;gap:6px;padding:8px 10px;border-radius:20px;background:rgba(255,255,255,.96);backdrop-filter:blur(8px);box-shadow:var(--float)}
.lp-btn{flex:none;display:inline-grid;place-items:center;min-width:44px;height:44px;padding:0 10px;border-radius:14px;font:700 14px var(--ui);color:var(--ink);background:transparent}
.lp-btn:hover{background:var(--desk)}
.lp-btn svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.lp-btn .fill{fill:currentColor}
.lp-main{background:var(--ink);color:#fff;width:48px;min-width:48px;height:48px;border-radius:50%}
.lp-main:hover{background:var(--quink)}
.lp-main svg{fill:none;stroke:currentColor;stroke-width:2.6;width:22px;height:22px}
.lp-main svg .fill{fill:currentColor;stroke:none}
.lp-btn[aria-pressed="true"],.lp-btn[aria-expanded="true"]{background:var(--quink-soft);color:var(--quink)}
.lp-time{flex:none;min-width:92px;font:700 13.5px var(--ui);color:var(--ink-2);font-variant-numeric:tabular-nums;text-align:center}
.lp-track{position:relative;flex:1;min-width:60px;height:44px;display:flex;align-items:center}
.lp-track input{width:100%;height:44px;margin:0;background:transparent;-webkit-appearance:none;appearance:none;cursor:pointer;--at:0%}
.lp-track input::-webkit-slider-runnable-track{height:6px;border-radius:99px;background:linear-gradient(90deg,var(--quink) var(--at),var(--rule) var(--at))}
.lp-track input::-moz-range-track{height:6px;border-radius:99px;background:var(--rule)}
.lp-track input::-moz-range-progress{height:6px;border-radius:99px;background:var(--quink)}
.lp-track input::-webkit-slider-thumb{-webkit-appearance:none;width:18px;height:18px;margin-top:-6px;border-radius:50%;background:#fff;box-shadow:0 0 0 2px var(--quink),0 2px 6px rgba(23,32,58,.25)}
.lp-track input::-moz-range-thumb{width:18px;height:18px;border:0;border-radius:50%;background:#fff;box-shadow:0 0 0 2px var(--quink)}
.lp-ticks{position:absolute;left:9px;right:9px;top:50%;height:0;pointer-events:none}
.lp-ticks i{position:absolute;top:-6px;width:3px;height:12px;margin-left:-1.5px;border-radius:2px;background:var(--ink);opacity:.55}
.lp-chap{max-width:160px;margin-left:6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:700 13.5px var(--ui)}
.lp-chap:empty{display:none}
#lp-list{display:inline-flex;align-items:center}
.lp.loading .lp-main{animation:lpPulse 1.2s ease-in-out infinite}
@keyframes lpPulse{50%{opacity:.55}}
.lp-start{position:fixed;inset:0;z-index:20;display:grid;place-items:center;padding:20px;background:rgba(238,240,243,.78);backdrop-filter:blur(3px)}
.lp-start[hidden]{display:none}
.lp-card{width:min(520px,100%);padding:28px 28px 24px;border-radius:24px;background:#fff;box-shadow:var(--float);text-align:center}
.lp-kicker{margin:0 0 6px;font-weight:700;font-size:13px;letter-spacing:.04em;text-transform:uppercase;color:var(--quink)}
.lp-card h1{margin:0 0 6px;font-size:clamp(24px,4.4vw,34px);line-height:1.15;overflow-wrap:anywhere}
.lp-facts{margin:0 0 20px;color:var(--ink-2);font-weight:600}
.lp-card .btn-lg svg{fill:currentColor;stroke:none}
.lp-fine{margin:14px 0 0;color:var(--ink-3);font-size:13.5px}
.lp-panel{position:fixed;z-index:13;top:calc(var(--top-h) + 10px);right:12px;bottom:calc(84px + var(--safe-b));width:min(400px,calc(100% - 24px));display:flex;flex-direction:column;border-radius:20px;background:#fff;box-shadow:var(--float);overflow:hidden}
.lp-panel[hidden]{display:none}
.lp-panel-top{display:flex;align-items:center;justify-content:space-between;padding:14px 12px 8px 18px}
.lp-panel-top h2{margin:0;font-size:18px}
.lp-chs{flex:1;overflow:auto;padding:0 10px 10px}
.lp-ch{padding:6px 8px 8px;border-radius:14px}
.lp-ch.on{background:var(--quink-soft)}
.lp-ch-h{display:flex;align-items:baseline;gap:10px;width:100%;padding:6px 4px;text-align:left;font:inherit;color:var(--ink);background:none}
.lp-ch-h span{flex:none;font-weight:700;font-size:13.5px;color:var(--quink);font-variant-numeric:tabular-nums}
.lp-ch-h b{font-size:15.5px}
.lp-ch p{margin:2px 4px 6px;padding:4px 6px;border-radius:8px;color:var(--ink-2);font-size:14.5px;line-height:1.5;cursor:pointer}
.lp-ch p:hover{background:rgba(255,255,255,.7);color:var(--ink)}
.lp-panel-foot{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 14px calc(12px + var(--safe-b));border-top:1px solid var(--rule-2)}
.lp-panel-foot .link-btn{color:var(--ink-3);font-size:13.5px}
@media (max-width:720px){
  .lp-bar{width:calc(100% - 16px);bottom:calc(8px + var(--safe-b));gap:2px;padding:6px 8px;border-radius:18px;flex-wrap:wrap}
  .lp-track{order:-1;flex:1 1 100%;height:34px}
  .lp-time{min-width:0;margin-right:auto}
  #lp-back{display:none}
  .lp-chap{max-width:90px}
  body.role-lesson .captions{bottom:calc(128px + var(--safe-b));font-size:16px}
  body.role-lesson .live-banner{bottom:calc(122px + var(--safe-b))}
  body.role-lesson .zoom-ctl{display:none}
  .lp-panel{top:auto;left:0;right:0;bottom:0;width:100%;max-height:78dvh;border-radius:22px 22px 0 0}
}
.toast.t2{flex-wrap:wrap;max-width:min(600px,calc(100vw - 24px))}
.toast.t2 span{flex:1 1 260px}

/* ---------- home: questions teachers ask, and the comparison links ---------- */
.home-faq{max-width:1240px;margin:64px auto 0}
.home-faq h2{margin:0 0 18px;font-size:clamp(26px,3vw,36px);line-height:1.15;font-weight:800;letter-spacing:-.015em}
.home-faq .faq{display:grid;gap:10px;max-width:880px}
.home-faq details{padding:16px 18px;border-radius:16px;background:#fff;box-shadow:0 0 0 1px var(--rule-2) inset}
.home-faq summary{cursor:pointer;font-weight:800;font-size:16.5px}
.home-faq details p{margin:10px 0 0;color:var(--ink-2)}
.home-faq p.faq-more{margin-top:6px}
.home-compare{margin:20px 0 0;color:var(--ink-3);font-size:15px}
.home-compare a{color:var(--ink-2);margin-right:12px;white-space:nowrap}
.uses-list dd a{font-weight:700}

/* ================= TeachPen as an app (TeachPen 14) ================= */
.install-card{display:flex;align-items:center;gap:12px;margin:18px 0 0;padding:12px 12px 12px 14px;border-radius:16px;background:#fff;box-shadow:0 0 0 1px var(--rule),var(--lift);max-width:520px}
.install-card[hidden]{display:none}
.ic-phone{width:26px;height:26px;flex:none;color:var(--quink)}
.ic-text{display:flex;flex-direction:column;flex:1;min-width:0;font-size:13.5px;line-height:1.35;color:var(--ink-2)}
.ic-text b{font-size:15px;color:var(--ink)}
.ios-steps{list-style:none;margin:8px 0 4px;padding:0;display:grid;gap:14px}
.ios-steps li{display:flex;gap:12px;align-items:flex-start;font-size:16px;line-height:1.45}
.ios-n{flex:none;width:28px;height:28px;border-radius:50%;display:grid;place-items:center;background:var(--quink-soft);color:var(--quink);font-weight:800}
.ios-share{width:18px;height:18px;vertical-align:-3px;fill:none;stroke:var(--quink);stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
/* opened from the home screen: the start screen is the app's own (big buttons and the lessons), not the website */
.app-mode .hero-scene,.app-mode .eyebrow,.app-mode .hero-title,.app-mode .hero-sub,.app-mode .hero-proof,
.app-mode .flow,.app-mode .uses,.app-mode .schools-band,.app-mode .home-faq,.app-mode .home-links .link-btn:not(#home-guide),
.app-mode .home-foot>:not(.tp-langs){display:none}
.app-mode .hero2{grid-template-columns:1fr;padding:4px 0 22px;margin-top:0}
.app-mode .hero-copy2{display:grid;grid-template-columns:1fr 1fr;gap:10px;max-width:640px}
.app-mode .hero-actions,.app-mode .hero-more{display:contents}
.app-mode #start-record{grid-column:1 / -1;min-height:84px;border-radius:22px;font-size:20px;justify-content:center}
.app-mode #start-record svg{width:26px;height:26px}
.app-mode #start-new,.app-mode .hero-more .link-btn{min-height:72px;margin:0;padding:12px 14px;border-radius:18px;background:#fff;color:var(--ink);font-size:15.5px;font-weight:700;
  box-shadow:0 0 0 1px var(--rule),var(--lift);display:flex;align-items:center;justify-content:flex-start;gap:10px;text-align:start;line-height:1.25}
.app-mode #start-new svg,.app-mode .hero-more .link-btn svg{width:22px;height:22px;flex:none;color:var(--quink)}
.app-mode .shelf{margin-top:6px}
.app-mode .home-foot{padding-top:8px}
@media (max-width:420px){.app-mode #start-new,.app-mode .hero-more .link-btn{font-size:14.5px;padding:10px 12px}}
/* a two- or three-finger tap undid or redid something: a moment's sign in the middle of the board */
.tap-sign{position:absolute;left:50%;top:42%;z-index:20;width:64px;height:64px;margin:-32px 0 0 -32px;border-radius:50%;display:grid;place-items:center;
  background:rgba(23,32,58,.78);color:#fff;pointer-events:none;animation:tapSign .7s var(--ease) forwards}
.tap-sign svg{width:30px;height:30px}
@keyframes tapSign{0%{opacity:0;transform:scale(.7)}25%{opacity:1;transform:scale(1)}70%{opacity:1}100%{opacity:0;transform:scale(1.05)}}
/* full screen: one button in the top bar (the lesson player has its own, and the app's home screen one); while full
   screen is on it shows the way back, tinted like a pressed button */
.full-btn svg{transition:transform .2s var(--ease)}
.full-btn:hover svg{transform:scale(1.12)}
.is-full .full-btn{background:var(--quink-soft);color:var(--quink)}
html:not(.app-mode) .home-full,body.role-lesson #btn-full,body.role-viewer .full-steps{display:none!important}
/* a 360 px phone holds every top-bar button and still names the lesson; while it records, the time takes the name's place */
@media (max-width:400px){
  .topbar{gap:0}
  .topbar .icon-btn{width:36px}
  .topbar .btn-quiet:not(.on):not(.paused){width:38px}
  .lesson-title{padding:6px 4px;font-size:14.5px}
  body.recording .lesson-title{display:none}
  /* the app's home: its icon is the name (the app was opened from it), so the header keeps room for its buttons */
  .app-mode .wordmark span{display:none}
}
/* full screen lets a phone's camera notch over the page: the studio, the app's home and the player keep clear of it */
:root{--safe-t:env(safe-area-inset-top,0px);--safe-l:env(safe-area-inset-left,0px);--safe-r:env(safe-area-inset-right,0px)}
.studio{padding:var(--safe-t) var(--safe-r) 0 var(--safe-l)}
.home{padding-top:var(--safe-t)}
.exit-present{top:calc(12px + var(--safe-t))}
.lp-bar{width:min(980px,calc(100% - 24px - var(--safe-l) - var(--safe-r)))}
@media (max-width:720px){
  .lp-bar{width:calc(100% - 16px - var(--safe-l) - var(--safe-r))}
  /* on a phone the player's Full screen button ends the timeline's row, as video players have it */
  .lp-track{flex-basis:calc(100% - 50px)}
  .lp-full{order:-1;height:34px}
  /* a phone's lesson toasts (Full screen, the end of the lesson) sit above the captions, never on them */
  body.role-lesson .toasts{bottom:calc(200px + var(--safe-b))}
}

/* ================= right to left (Arabic) =================
   The studio mirrors: the page list docks on the left (the grid follows the page direction), so what sits beside it,
   above it or on the other side changes sides too. Left-to-right pages never match these rules. */
@media (min-width:1100px){
  [dir="rtl"] .studio .tray-wrap{left:calc((100% + 176px)/2)}
  [dir="rtl"] body.panel-open .studio .tray-wrap{left:calc((100% + 348px)/2)}
}
[dir="rtl"] .zoom-ctl,[dir="rtl"] body.role-viewer .zoom-ctl{left:auto;right:14px}
[dir="rtl"] .page-pill{right:auto;left:14px}
[dir="rtl"] body.role-viewer .page-pill{right:auto;left:12px}
[dir="rtl"] :is(#pg-prev,#pg-next) svg{transform:scaleX(-1)}
[dir="rtl"] .sheet .x{right:auto;left:12px}
[dir="rtl"] .exit-present{right:auto;left:12px}
[dir="rtl"] .rail-tools{right:auto;left:4px}
[dir="rtl"] .book-menu{right:auto;left:14px}
[dir="rtl"] .ans-name{left:auto;right:8px}
[dir="rtl"] .class-panel{right:auto;left:0;box-shadow:1px 0 0 var(--rule),24px 0 48px -32px rgba(23,32,58,.35)}
[dir="rtl"] body.panel-open .w-timer{right:14px}
@media (max-width:1099px){
  [dir="rtl"] .rail{right:auto;left:10px;transform:translateX(calc(-100% - 20px))}
  [dir="rtl"] .rail.open{transform:none}
  [dir="rtl"] .class-panel{right:auto;left:10px}
}
@media (max-width:720px){
  [dir="rtl"] .class-panel{left:8px;right:8px}
  [dir="rtl"] .page-pill{left:10px;right:auto}
  [dir="rtl"] body.panel-open .w-timer{right:14px}
}
@media (min-width:721px) and (max-height:520px) and (pointer:coarse){
  [dir="rtl"] body:not(.role-viewer) .page-pill{right:auto;left:10px}
}
/* timelines run left to right in every language (media players do), so the chapter ticks sit on the right second */
[dir="rtl"] .lp-track,[dir="rtl"] #replay-bar input[type=range],[dir="rtl"] .lp-time,[dir="rtl"] #lp-rate{direction:ltr}
[dir="rtl"] .lp-panel{right:auto;left:12px}
@media (min-width:721px){[dir="rtl"] body.lp-panel-open .captions,[dir="rtl"] body.lp-panel-open .toasts{left:calc((100% + 424px) / 2)}}
/* TeachPen 15: the sticker band on the home page */
.stk-band{position:relative;display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);gap:28px;align-items:center;max-width:1240px;margin:64px auto 0;padding:clamp(28px,4vw,52px);border-radius:28px;overflow:hidden;
  background:radial-gradient(120% 140% at 100% 0%,#FFF1B8 0%,#FFE1EC 42%,#E6ECFF 100%);box-shadow:0 0 0 1px rgba(23,32,58,.06) inset}
.stk-copy .kicker{color:#B4234F}
.stk-copy h2{font-size:clamp(26px,3.2vw,38px);line-height:1.12;margin:6px 0 12px;letter-spacing:-.01em;text-wrap:balance}
.stk-copy>p{font-size:16.5px;line-height:1.6;color:var(--ink-2);max-width:56ch}
.stk-actions{margin:18px 0 16px}
.stk-actions .btn img{width:26px;height:26px;margin-right:2px}
.stk-pen{font-size:14.5px;color:var(--ink-2);padding:12px 14px;border-radius:14px;background:rgba(255,255,255,.66);max-width:56ch}
.stk-pen b{color:var(--ink)}
.stk-wall{position:relative;min-height:300px}
.sw-i{position:absolute;left:var(--x);top:var(--y);width:var(--s);height:var(--s);filter:drop-shadow(0 10px 10px rgba(23,32,58,.16));animation:swFloat 5.6s ease-in-out var(--d) infinite alternate}
@keyframes swFloat{from{transform:translateY(0) rotate(-4deg)}to{transform:translateY(-14px) rotate(5deg)}}
@media (max-width:820px){.stk-band{grid-template-columns:1fr;padding:26px 20px;margin:40px 0 0}.stk-wall{min-height:210px;order:-1}.sw-i{width:calc(var(--s) * .78);height:calc(var(--s) * .78)}}
@media (prefers-reduced-motion:reduce){.sw-i{animation:none}}
.app-mode .stk-band{display:none}
/* seven tools on a 360 px phone: each a little narrower */
@media (max-width:380px){.tool{width:37px}.tool-art{width:27px;height:42px}.tool-stk img{width:29px;height:29px}}
/* presenting on a phone: the tray also carries Undo and Clear, so the tools give up a little more room */
@media (max-width:720px){body.presenting .tool{width:37px}body.presenting .tool-art{width:27px;height:42px}body.presenting .tool-stk img{width:29px;height:29px}}
@media (max-width:380px){body.presenting .tool{width:34px}body.presenting .tool-art{width:25px;height:39px}body.presenting .tool-stk img{width:27px;height:27px}}

/* ================= TeachPen 16 — the live class: voice, chat, reactions ================= */
:root{
  --go:#0F9D58; --go-2:#12B886; --go-soft:#E3F7EC;
  --sun:#FFC21A; --sun-soft:#FFF4CF;
  --violet:#7B3FC4; --violet-soft:#F0E8FB;
  --pink:#E0356B; --pink-soft:#FDE7EF;
  --teal:#0E9AA7;
}
@keyframes vcWave{from{height:5px}to{height:16px}}
@keyframes pbPop{0%{transform:scale(1)}40%{transform:scale(1.45) rotate(-8deg)}100%{transform:scale(1)}}
@keyframes popUp{from{opacity:0;transform:translate(-50%,10px) scale(.96)}to{opacity:1;transform:translate(-50%,0) scale(1)}}
@keyframes hearGlow{0%,100%{box-shadow:0 10px 24px -8px rgba(15,157,88,.7),0 0 0 0 rgba(18,184,134,.5)}60%{box-shadow:0 10px 24px -8px rgba(15,157,88,.7),0 0 0 12px rgba(18,184,134,0)}}
@keyframes rxUp{0%{transform:translate(0,30px) scale(.3);opacity:0}12%{transform:translate(0,0) scale(1.18);opacity:1}24%{transform:translate(calc(var(--dx)*.2),-44px) scale(1);opacity:1}100%{transform:translate(var(--dx),-62vh) scale(.9) rotate(var(--rot));opacity:0}}
@keyframes rxFade{0%,100%{opacity:0}20%,70%{opacity:1}}

/* --- the teacher's class panel: voice card, three tabs --- */
.class-panel{display:flex;flex-direction:column;overflow:hidden;padding:0}
.class-panel .cp-head{padding:14px 12px 0 16px;margin-bottom:10px}
.cp-voice{margin:0 16px;padding:5px;border-radius:18px;background:#EEF1F6;transition:background .2s}
.cp-voice.on{background:linear-gradient(135deg,var(--go),var(--go-2));color:#fff}
.vc-main{display:flex;align-items:center;gap:12px;width:100%;padding:7px 10px 7px 7px;border-radius:14px;text-align:left}
.vc-main:hover{background:rgba(255,255,255,.55)}
.cp-voice.on .vc-main:hover{background:rgba(255,255,255,.12)}
.vc-ic{flex:none;display:grid;place-items:center;width:44px;height:44px;border-radius:50%;background:#fff;color:var(--ink-2);box-shadow:var(--lift)}
.cp-voice.on .vc-ic{color:var(--go)}
.vc-ic svg{width:22px;height:22px}
.vc-text{min-width:0}
.vc-text b{display:block;font-size:15px;line-height:1.25}
.vc-text small{display:block;font-size:12.5px;line-height:1.3;color:var(--ink-2)}
.cp-voice.on .vc-text small{color:rgba(255,255,255,.9)}
.vc-meter{margin-left:auto;display:flex;gap:3px;align-items:center;height:20px}
.vc-meter i{width:4px;height:5px;border-radius:2px;background:currentColor;opacity:.3}
.cp-voice.speaking .vc-meter i{opacity:1;animation:vcWave .45s ease-in-out infinite alternate}
.vc-meter i:nth-child(2),.vc-wave i:nth-child(2){animation-delay:.12s}
.vc-meter i:nth-child(3),.vc-wave i:nth-child(3){animation-delay:.24s}
.vc-meter i:nth-child(4){animation-delay:.36s}
.vc-row{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:36px;padding:2px 6px 2px 10px}
.cp-voice.on .vc-row .btn-quiet{color:#fff}
.vc-none{margin:0;padding:8px 10px;font-size:13px;color:var(--ink-2)}
.chat-switch{display:inline-flex;align-items:center;gap:9px;font-size:13.5px;font-weight:600;cursor:pointer}
.chat-switch input{position:absolute;opacity:0;pointer-events:none}
.sw{flex:none;position:relative;width:36px;height:22px;border-radius:999px;background:#B8C0D0;transition:background .15s}
.sw::after{content:"";position:absolute;top:2px;left:2px;width:18px;height:18px;border-radius:50%;background:#fff;box-shadow:0 1px 2px rgba(23,32,58,.3);transition:transform .15s var(--ease)}
.chat-switch input:checked+.sw{background:var(--go)}
.cp-voice.on .chat-switch input:checked+.sw{background:#fff}
.cp-voice.on .chat-switch input:checked+.sw::after{background:var(--go)}
.chat-switch input:checked+.sw::after{transform:translateX(14px)}
.chat-switch input:focus-visible+.sw{outline:2px solid var(--quink);outline-offset:2px}
.cp-tabs{display:flex;gap:4px;margin:12px 16px 0;padding:4px;border-radius:14px;background:#EEF1F6}
.cp-tabs [role=tab]{flex:1;display:inline-flex;align-items:center;justify-content:center;gap:6px;height:36px;border-radius:10px;font-size:14px;font-weight:700;color:var(--ink-2)}
.cp-tabs [role=tab][aria-selected=true]{background:#fff;color:var(--ink);box-shadow:var(--lift)}
.cp-n{display:inline-grid;place-items:center;min-width:20px;height:20px;padding:0 6px;border-radius:999px;background:var(--quink-soft);color:var(--quink);font-size:12px;font-weight:800}
.cp-n.warn{background:var(--red);color:#fff}
.cp-body{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:14px 16px 18px}
.cp-pane-chat:not([hidden]){display:flex;flex-direction:column;height:100%;min-height:340px}
.cp-pane-chat .cp-sec{margin-top:0;margin-bottom:10px}
.cp-chat{flex:1;min-height:0;display:flex}
.cp-hint{margin:10px 0 0;font-size:12.5px;color:var(--ink-3)}
.cp-people{flex-direction:column;flex-wrap:nowrap;gap:5px}
.cp-people li.pp{display:flex;align-items:center;gap:10px;padding:5px 5px 5px 7px;border-radius:14px;background:#fff;box-shadow:0 0 0 1px var(--rule-2) inset;font-size:14.5px}
.cp-people li.pp.hand{background:var(--sun-soft);box-shadow:0 0 0 1.5px var(--sun) inset;padding-left:7px}
.pp .cp-ini{flex:none;width:30px;height:30px;font-size:13px;background:hsl(var(--h) 75% 86%);color:hsl(var(--h) 60% 26%);transition:box-shadow .15s}
.pp-hand{flex:none;display:grid;place-items:center;width:30px;height:30px;font-size:19px}
.pp.speaking .cp-ini,.pp.speaking .pp-hand{box-shadow:0 0 0 3px var(--go-2)}
.pp-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pp-tag{flex:none;padding:2px 8px;border-radius:999px;background:var(--red-soft);color:#A1281F;font-size:11.5px;font-weight:700}
.pp-mic{flex:none;display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:#EEF1F6;color:var(--ink-3);transition:background .15s,color .15s}
.pp-mic svg{width:19px;height:19px}
.pp-mic:hover{background:var(--go-soft);color:var(--go)}
.pp-mic.may{background:var(--go-soft);color:var(--go)}
.pp-mic.live{background:var(--go);color:#fff}
.pp-mic:disabled{opacity:.55;pointer-events:none}
.voice-btn.on{background:var(--go);color:#fff}
.voice-btn.on:hover{background:#0B8A4C;color:#fff}
.voice-btn.on.speaking{box-shadow:0 0 0 3px rgba(18,184,134,.35)}
.live-btn{position:relative}
.live-btn.has-chat::after{content:"";position:absolute;top:5px;right:5px;width:10px;height:10px;border-radius:50%;background:var(--quink);box-shadow:0 0 0 2px #fff}

/* --- the class pulse --- */
.pulse{margin-top:14px;padding:12px 12px 10px;border-radius:18px;background:linear-gradient(160deg,#FFF7DA,#FFE9CC)}
.pulse-head{display:flex;align-items:baseline;gap:8px}
.pulse-head h3{margin:0;font-size:14px;font-weight:800;color:#5A3B00}
.pulse-head small{font-size:12px;color:#8A6A2C}
.pulse-bars{display:grid;grid-template-columns:repeat(6,1fr);gap:2px;margin-top:8px;align-items:end}
.pb{display:flex;flex-direction:column;align-items:center;gap:3px;padding:5px 0 3px;border-radius:12px;color:#5A3B00}
.pb:hover{background:rgba(255,255,255,.75)}
.pb-track{display:flex;align-items:flex-end;width:16px;height:46px;border-radius:8px;background:rgba(90,59,0,.1);overflow:hidden}
.pb-track i{display:block;width:100%;height:0;border-radius:8px;background:var(--c);transition:height .4s var(--ease)}
.pb img{width:32px;height:32px;filter:grayscale(.7) opacity(.75);transition:filter .2s}
.pb.has img{filter:none}
.pb.tap img,.react-pop .tap img{animation:pbPop .35s var(--ease)}
.pb b{font-size:13.5px;font-weight:800;line-height:1}
.pb small{display:none}
.pulse-line{display:block;width:100%;height:34px;margin-top:6px}
.pl-line{fill:none;stroke:#D9730D;stroke-width:2;stroke-linejoin:round;vector-effect:non-scaling-stroke}
.pl-fill{fill:rgba(217,115,13,.16);stroke:none}
.pulse-foot{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:4px}
.pulse-mood{margin:0;font-size:13px;line-height:1.35;color:#6B4A0C}
.pulse-mood.warn{color:#A8440A;font-weight:800}
.pulse-foot .link-btn{flex:none;font-size:13px;font-weight:700;color:var(--quink)}

/* --- reactions floating up the board --- */
.rx-layer{position:absolute;inset:0;z-index:12;overflow:hidden;pointer-events:none}
.rx{position:absolute;bottom:76px;animation:rxUp 3s cubic-bezier(.2,.6,.3,1) forwards;filter:drop-shadow(0 6px 10px rgba(23,32,58,.28));will-change:transform,opacity}
.rx-calm{animation-name:rxFade}

/* --- the chat --- */
.chat{flex:1;display:flex;flex-direction:column;min-width:0;min-height:0;width:100%}
.chat>.chat-switch{margin:0 0 8px;padding:8px 10px;border-radius:12px;background:#EEF1F6}
.chat-list{flex:1;min-height:110px;display:flex;flex-direction:column;gap:10px;overflow:auto;overscroll-behavior:contain;padding:6px 2px 10px}
.chat-list:focus-visible{outline:2px solid var(--quink);outline-offset:2px;border-radius:10px}
.chat-empty{margin:auto;text-align:center;color:var(--ink-3);font-size:14px}
.chat-empty-art{display:block;font-size:34px;margin-bottom:4px}
.chat-empty p{margin:0}
.msg{position:relative;display:flex;align-items:flex-start;gap:8px}
.msg-av{flex:none;display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:hsl(var(--h) 75% 86%);color:hsl(var(--h) 60% 26%);font-size:13px;font-weight:800}
.msg-b{min-width:0;max-width:calc(100% - 76px);padding:7px 12px 8px;border-radius:5px 16px 16px 16px;background:#EEF1F6}
.msg-h{display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 6px;font-size:12px;color:var(--ink-3)}
.msg-n{font-weight:800;color:var(--ink-2)}
.msg p{margin:2px 0 0;font-size:14.5px;line-height:1.4;color:var(--ink);overflow-wrap:anywhere}
.msg-tag{padding:1px 7px;border-radius:999px;background:var(--quink);color:#fff;font-size:10.5px;font-weight:800;letter-spacing:.03em}
.msg-tag.lock{background:#7A5200;color:#fff}
.msg.host .msg-av{background:var(--quink);color:#fff}
.msg.host .msg-b{background:var(--quink-soft)}
.msg.mine{flex-direction:row-reverse}
.msg.mine .msg-b{border-radius:16px 5px 16px 16px;background:var(--quink)}
.msg.mine p,.msg.mine .msg-h,.msg.mine .msg-n{color:#fff}
.msg.mine .msg-tag{background:#fff;color:var(--quink)}
.msg.priv .msg-b{background:var(--sun-soft);box-shadow:0 0 0 1.5px var(--sun) inset}
.msg.priv p,.msg.priv .msg-h,.msg.priv .msg-n{color:#3F2B00}
.msg.pending{opacity:.55}
.msg-more{flex:none;display:grid;place-items:center;width:28px;height:28px;margin-top:2px;border-radius:8px;color:var(--ink-3);opacity:.55}
.msg-more svg{width:18px;height:18px}
.msg:hover .msg-more,.msg-more:focus-visible{opacity:1;background:#EEF1F6}
.chat-form{flex:none;display:flex;flex-direction:column;gap:6px;padding-top:8px;border-top:1px solid var(--rule-2)}
.chat-to{display:flex;gap:2px;padding:3px;border-radius:999px;background:#EEF1F6}
.chat-to button{flex:1;height:30px;border-radius:999px;font-size:13px;font-weight:700;color:var(--ink-2)}
.chat-to button[aria-checked=true]{background:#fff;color:var(--ink);box-shadow:var(--lift)}
.chat-to button:disabled{opacity:.4}
.chat-note{margin:0;padding:7px 10px;border-radius:10px;background:var(--sun-soft);color:#5A3B00;font-size:12.5px;line-height:1.35}
.chat-quick{display:flex;gap:2px}
.chat-quick button{width:38px;height:32px;border-radius:9px;font-size:19px;line-height:1}
.chat-quick button:hover{background:#EEF1F6}
.chat-row{display:flex;gap:8px}
.chat-row input{flex:1;min-width:0;height:44px;padding:0 16px;border:1.5px solid var(--rule);border-radius:999px;background:#fff;font-size:16px}
.chat-row input:focus{outline:none;border-color:var(--quink);box-shadow:0 0 0 3px var(--quink-soft)}
.chat-send{flex:none;display:grid;place-items:center;width:44px;height:44px;border-radius:50%;background:var(--quink);color:#fff;box-shadow:0 6px 16px -8px rgba(43,71,201,.8)}
.chat-send:hover{background:var(--quink-2)}
.chat-send svg{width:20px;height:20px;fill:currentColor;stroke:none}
[dir=rtl] .chat-send svg{transform:scaleX(-1)}

/* --- a student's class bar --- */
.class-bar{position:absolute;z-index:20;left:50%;bottom:calc(10px + var(--safe-b));transform:translateX(-50%);display:flex;gap:2px;padding:6px;border-radius:24px;background:#fff;box-shadow:var(--float)}
.cb{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-width:60px;height:54px;padding:0 8px;border-radius:18px;font-size:11.5px;font-weight:700;color:var(--ink-2);transition:background .15s,color .15s}
.cb svg{width:24px;height:24px}
.cb img{width:26px;height:26px}
.cb-emo{font-size:21px;line-height:26px}
.cb:hover{background:#EEF1F6}
.cb[aria-expanded=true]{background:var(--quink-soft);color:var(--quink)}
.cb.hand-btn.on{background:var(--sun);color:#3F2B00}
.cb-mic{color:var(--go)}
.cb-mic.on{background:var(--go);color:#fff}
.cb-mic.busy{opacity:.6}
.cb-sound.off{color:var(--red)}
.cb-n{position:absolute;top:3px;right:9px;display:grid;place-items:center;min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:var(--red);color:#fff;font-size:11px;font-weight:800}
.react-pop{position:absolute;z-index:21;left:50%;bottom:calc(82px + var(--safe-b));transform:translateX(-50%);display:flex;gap:2px;padding:8px;border-radius:24px;background:#fff;box-shadow:var(--float);animation:popUp .18s var(--ease)}
.react-pop[hidden]{display:none}
.react-pop button{display:flex;flex-direction:column;align-items:center;gap:3px;width:56px;padding:6px 0 5px;border-radius:16px;font-size:10.5px;font-weight:700;line-height:1.1;color:var(--ink-2)}
.react-pop button:hover{background:#EEF1F6}
.react-pop img{width:38px;height:38px}
.chat-sheet{position:absolute;z-index:25;top:calc(var(--top-h) + 10px);right:10px;bottom:calc(10px + var(--safe-b));width:360px;max-width:calc(100% - 20px);display:flex;flex-direction:column;border-radius:22px;background:#fff;box-shadow:var(--float);overflow:hidden}
.chat-sheet[hidden]{display:none}
.cs-head{flex:none;display:flex;align-items:center;justify-content:space-between;padding:8px 8px 8px 18px;background:linear-gradient(120deg,var(--quink),var(--violet));color:#fff}
.cs-head h2{margin:0;font-size:16px;font-weight:800}
.cs-head .icon-btn{color:#fff}
.cs-head .icon-btn:hover{background:rgba(255,255,255,.18);color:#fff}
.cs-body{flex:1;min-height:0;display:flex;padding:8px 12px 12px}
.hear-pill{position:absolute;z-index:22;left:50%;bottom:calc(84px + var(--safe-b));transform:translateX(-50%);display:flex;align-items:center;gap:8px;height:48px;padding:0 20px 0 16px;border-radius:999px;background:var(--go);color:#fff;font-size:15px;font-weight:800;white-space:nowrap;animation:hearGlow 1.6s infinite}
.hear-pill[hidden]{display:none}
.hear-pill svg{width:22px;height:22px}
.voice-chip{position:absolute;z-index:11;top:12px;left:12px;display:flex;align-items:center;gap:8px;height:34px;max-width:60%;padding:0 13px 0 11px;border-radius:999px;background:var(--go);color:#fff;font-size:13.5px;font-weight:700;box-shadow:var(--float)}
.voice-chip bdi{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.vc-wave{flex:none;display:flex;align-items:center;gap:2px;height:16px}
.vc-wave i{width:3px;height:6px;border-radius:2px;background:#fff;animation:vcWave .45s ease-in-out infinite alternate}
body.in-class .live-banner,body.in-class .page-pill{bottom:calc(82px + var(--safe-b))}
body.in-class .captions{bottom:calc(138px + var(--safe-b))}
body.in-class .zoom-ctl{bottom:calc(82px + var(--safe-b))}
body.in-class .toasts{bottom:calc(150px + var(--safe-b))}
body.in-class.chat-open .hear-pill{display:none}
@media (max-width:720px){
  .chat-sheet{top:auto;left:6px;right:6px;bottom:calc(6px + var(--safe-b));width:auto;max-width:none;height:min(66dvh,540px)}
  .cp-pane-chat:not([hidden]){min-height:300px}
}
@media (max-width:380px){
  .cb{min-width:54px;padding:0 5px}
  .react-pop{padding:6px}
  .react-pop button{width:49px}
  .react-pop img{width:34px;height:34px}
}
@media (prefers-reduced-motion:reduce){
  .cp-voice.speaking .vc-meter i,.vc-wave i,.hear-pill{animation:none}
}
.cp-sec-acts{display:flex;gap:2px;flex-wrap:wrap;justify-content:flex-end}
.cp-pane .cp-acts{margin-top:0}
.cp-pane .cp-code{margin-top:14px}

/* --- TeachPen 16: the free teacher account --- */
.sheet.sheet-acct{width:min(460px,calc(100vw - 24px));overflow:auto}
.sheet-acct .sheet-body{padding:0 26px 22px}
.acct-rainbow{display:flex;height:8px;margin:0 -26px 22px}
.acct-rainbow i{flex:1}
.acct-rainbow i:nth-child(1){background:#2B47C9}.acct-rainbow i:nth-child(2){background:#7B3FC4}.acct-rainbow i:nth-child(3){background:#E0356B}
.acct-rainbow i:nth-child(4){background:#F2A20C}.acct-rainbow i:nth-child(5){background:#0F9D58}.acct-rainbow i:nth-child(6){background:#0E9AA7}
.acct-badge{display:inline-flex;align-items:center;height:26px;padding:0 11px;border-radius:999px;background:var(--go-soft);color:#0A6B3C;font-size:12.5px;font-weight:800}
.acct h2{margin:10px 0 6px;font-size:24px;line-height:1.2;font-weight:800}
.acct-lead{margin:0 0 16px!important;font-size:15px;line-height:1.5}
.acct-g{display:flex;justify-content:center;min-height:44px}
.acct-g[hidden],.acct-or[hidden]{display:none}
.acct-or{display:flex;align-items:center;gap:12px;margin:14px 0 10px;color:var(--ink-3);font-size:13px;font-weight:600}
.acct-or::before,.acct-or::after{content:"";flex:1;height:1.5px;background:var(--rule-2)}
.acct .fld{display:block;margin-bottom:10px}
.acct .fld>span{display:block;margin-bottom:4px;font-size:13.5px;font-weight:700;color:var(--ink-2)}
.acct .fld small{font-weight:500;color:var(--ink-3)}
.acct input{width:100%;height:48px;padding:0 14px;border:1.5px solid var(--rule);border-radius:12px;background:#fff;font-size:16px}
.acct input:focus{outline:none;border-color:var(--quink);box-shadow:0 0 0 3px var(--quink-soft)}
.acct-err{min-height:0;margin:0 0 10px!important;color:#B3202A!important;font-size:14px;font-weight:700}
.acct-err:empty{display:none}
.acct #ac-go{background:linear-gradient(120deg,var(--quink),var(--violet));box-shadow:0 10px 22px -10px rgba(91,63,196,.8)}
.acct #ac-go:disabled{opacity:.6}
.acct-swap{margin:14px 0 0!important;font-size:14.5px;text-align:center}
.acct-swap .link-btn{font-weight:800;color:var(--quink)}
.acct-swap a.link-btn{display:block;margin-top:6px;font-weight:600}
.acct-fine{margin:12px 0 0!important;font-size:12.5px;line-height:1.45;text-align:center;color:var(--ink-3)!important}
.acct-fine a{color:inherit}
.acct-chip{gap:7px;background:linear-gradient(120deg,var(--quink),var(--violet))}
.acct-chip.in{padding:0 12px 0 4px;background:#fff;color:var(--ink);box-shadow:0 0 0 1px var(--rule) inset,0 1px 2px rgba(23,32,58,.06)}
.acct-av{display:grid;place-items:center;width:24px;height:24px;border-radius:50%;background:linear-gradient(135deg,var(--quink),var(--pink));color:#fff;font-size:12px;font-weight:800}
.acct-chip bdi{max-width:110px;overflow:hidden;text-overflow:ellipsis}
html.app-mode .acct-chip:not(.in){display:none}

/* --- TeachPen 16: writing on a shared window, tab or screen --- */
.screen-bar{flex-wrap:wrap;justify-content:center;max-width:calc(100% - 24px);border-radius:22px;background:linear-gradient(120deg,#17203A,#2B2F6B)}
.screen-keep{display:inline-flex;align-items:center;gap:8px;padding:0 4px;font-size:13.5px;cursor:pointer}
.screen-keep input{position:absolute;opacity:0;pointer-events:none}
.screen-keep .sw{background:rgba(255,255,255,.3)}
.screen-keep input:checked+.sw{background:#5BE38B}
.screen-keep input:checked+.sw::after{transform:translateX(14px)}
.screen-keep input:focus-visible+.sw{outline:2px solid #fff;outline-offset:2px}
.screen-bar{width:max-content;flex-wrap:nowrap}
@media (max-width:900px){.screen-keep>span:last-child{display:none}.screen-bar{gap:6px}}

/* ================= TeachPen 16 — a more colourful home ================= */
@keyframes flyA{0%{transform:translate(0,0) rotate(-6deg)}50%{transform:translate(6px,-14px) rotate(6deg)}100%{transform:translate(0,0) rotate(-6deg)}}
@keyframes chipWave{from{height:4px}to{height:12px}}
.home{background:radial-gradient(60% 50% at 100% 0%,rgba(123,63,196,.10),transparent 70%),radial-gradient(50% 40% at 0% 12%,rgba(18,184,134,.10),transparent 70%),var(--desk)}
.eyebrow .eb-dot{background:conic-gradient(#2B47C9,#7B3FC4,#E0356B,#F59F00,#12B886,#2B47C9)!important;width:12px;height:12px}
.new-pill{display:inline-flex;align-items:center;height:22px;padding:0 9px;margin-right:6px;border-radius:999px;background:#FFE047;color:#3F2B00;letter-spacing:.04em}
.cls-band{position:relative;display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);gap:36px;align-items:center;max-width:1240px;margin:56px auto 0;padding:clamp(28px,4vw,52px);border-radius:30px;overflow:hidden;color:#fff;
  background:radial-gradient(90% 120% at 100% 100%,#E0356B 0%,transparent 55%),radial-gradient(80% 90% at 0% 0%,#2B47C9 0%,transparent 60%),linear-gradient(135deg,#3B2CB8,#7B3FC4 55%,#B83FA0);box-shadow:0 30px 70px -40px rgba(59,44,184,.9)}
.cls-band .kicker{display:flex;align-items:center;color:#fff}
.cls-band h2{margin:0;font-size:clamp(30px,3.8vw,46px);line-height:1.08;font-weight:800;letter-spacing:-.02em}
.cls-lead{margin:14px 0 0;font-size:17.5px;line-height:1.6;color:#EDE7FF;max-width:34em}
.cls-feats{list-style:none;margin:22px 0 0;padding:0;display:grid;grid-template-columns:1fr 1fr;gap:10px}
.cls-feats li{display:grid;grid-template-columns:40px 1fr;grid-template-rows:auto auto;column-gap:10px;align-items:center;padding:12px 14px;border-radius:18px;background:rgba(255,255,255,.12);box-shadow:0 0 0 1px rgba(255,255,255,.16) inset;backdrop-filter:blur(4px)}
.cls-feats img{grid-row:1/3;width:38px;height:38px;filter:drop-shadow(0 4px 8px rgba(0,0,0,.25))}
.cls-feats b{font-size:16px}
.cls-feats span{font-size:13.5px;line-height:1.4;color:#E4DDFF}
.cls-feats li::before{content:"";position:absolute}
.cls-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:24px}
.cls-go{background:#FFE047;color:#2A1D00;box-shadow:0 12px 26px -12px rgba(255,224,71,.9)}
.cls-go:hover{background:#FFD21A}
.cls-go svg .fill{fill:#2A1D00}
.cls-scene{position:relative;min-height:380px}
.cls-board{position:absolute;left:0;right:56px;top:16px;padding:22px 18px 14px;border-radius:20px;background:#fff;box-shadow:0 24px 50px -24px rgba(23,20,70,.8)}
.cls-board svg{display:block;width:100%;height:auto}
.cls-chip{position:absolute;top:12px;left:12px;display:inline-flex;align-items:center;gap:2px;height:28px;padding:0 11px 0 9px;border-radius:999px;background:#0F9D58;color:#fff;font-size:12.5px;font-weight:700}
.cls-chip i{display:inline-block;width:3px;height:6px;margin-right:2px;border-radius:2px;background:#fff;animation:chipWave .45s ease-in-out infinite alternate}
.cls-chip i:nth-child(2){animation-delay:.15s}.cls-chip i:nth-child(3){animation-delay:.3s;margin-right:6px}
.cls-phone{position:absolute;right:0;bottom:0;width:206px;padding:9px;border-radius:34px;background:#17203A;box-shadow:0 30px 60px -24px rgba(0,0,0,.7)}
.cp-scr{display:flex;flex-direction:column;gap:7px;min-height:300px;padding:14px 11px 11px;border-radius:26px;background:#fff;color:var(--ink)}
.cps-h{margin:0 0 2px;padding:8px 10px;border-radius:14px;background:linear-gradient(120deg,#2B47C9,#7B3FC4);color:#fff;font-size:13px;font-weight:800}
.cps-m{margin:0;max-width:88%;padding:6px 10px;border-radius:4px 14px 14px 14px;background:#EEF1F6;font-size:12px;line-height:1.35}
.cps-m b{display:block;font-size:10.5px;color:var(--ink-3)}
.cps-m.t{background:var(--quink-soft)}
.cps-m.me{align-self:flex-end;border-radius:14px 4px 14px 14px;background:var(--quink);color:#fff}
.cps-bar{display:flex;justify-content:space-around;margin-top:auto;padding:6px;border-radius:16px;background:#F4F5F8;font-size:17px}
.cps-bar .on{padding:0 6px;border-radius:10px;background:#0F9D58}
.fly{position:absolute;filter:drop-shadow(0 8px 14px rgba(0,0,0,.3));animation:flyA 3.6s ease-in-out infinite}
.f1{left:4%;bottom:20%}.f2{left:30%;bottom:6%;animation-delay:.6s}.f3{left:52%;top:2%;animation-delay:1.2s}.f4{right:2%;top:30%;animation-delay:1.8s}.f5{left:44%;bottom:30%;animation-delay:2.4s}
/* colour on the steps and the uses */
.flow-list li:nth-child(1) .fl-n{background:#E7F5FF;color:#1971C2}
.flow-list li:nth-child(2) .fl-n{background:#F3F0FF;color:#6741D9}
.flow-list li:nth-child(3) .fl-n{background:#FFF0F6;color:#C2255C}
.flow-list li:nth-child(4) .fl-n{background:#EBFBEE;color:#2B8A3E}
.flow-list li{border-top:4px solid transparent;background-image:linear-gradient(#fff,#fff),linear-gradient(90deg,#4C6EF5,#AE3EC9);background-origin:border-box;background-clip:padding-box,border-box}
.flow-list li:nth-child(2){background-image:linear-gradient(#fff,#fff),linear-gradient(90deg,#AE3EC9,#E64980)}
.flow-list li:nth-child(3){background-image:linear-gradient(#fff,#fff),linear-gradient(90deg,#E64980,#F59F00)}
.flow-list li:nth-child(4){background-image:linear-gradient(#fff,#fff),linear-gradient(90deg,#F59F00,#12B886)}
.uses-list div{border-top:0;padding:18px 18px 16px;border-radius:18px;background:#fff;box-shadow:0 0 0 1px var(--rule-2) inset}
.uses-list div:nth-child(6n+1){background:#EEF6FF}.uses-list div:nth-child(6n+2){background:#F5F0FF}.uses-list div:nth-child(6n+3){background:#FFF0F5}
.uses-list div:nth-child(6n+4){background:#FFF8E6}.uses-list div:nth-child(6n+5){background:#EAFBF1}.uses-list div:nth-child(6n+6){background:#E9FAFB}
.home-faq details[open]{box-shadow:0 0 0 2px var(--quink) inset}
.home-faq summary::marker{color:var(--quink)}
@media (max-width:900px){
  .cls-band{grid-template-columns:1fr}
  .cls-scene{min-height:360px;max-width:520px;width:100%;margin:0 auto}
}
@media (max-width:560px){
  .cls-feats{grid-template-columns:1fr}
  .cls-band{border-radius:22px;margin-left:-6px;margin-right:-6px}
  .cls-scene{min-height:330px}
  .cls-board{right:40px}
  .cls-phone{width:176px}
  .cp-scr{min-height:256px}
}
@media (prefers-reduced-motion:reduce){.fly,.cls-chip i{animation:none}}
html.app-mode .cls-band{display:none}
.cls-board{right:96px}
@media (max-width:600px){#home-guide{display:none}.home-links{gap:6px}}
@media (max-width:380px){.join-btn{padding:0 10px}.join-btn svg{display:none}}
.acct-links{margin-top:4px!important}
/* the illustration keeps its layout in right-to-left languages; only the phone's chat reads right to left */
.cls-scene{direction:ltr}
[dir=rtl] .cls-scene .cp-scr{direction:rtl}
