:root {
  --bg: #000; --surface: #0b0910; --surface-2: #141019; --line: #221c2b; --line-2: #2f2739;
  --ink: #ececf1; --muted: #8d8798; --accent: #8b5cf6; --accent-ink: #b79cfb; --accent-soft: rgba(139, 92, 246, .16);
  --amber: #f5b342; --cyan: #38bdf8; --good: #34d399; --bad: #f87171;
  --sheet: #08070c; --rule: rgba(236, 236, 241, .13);
  --r: 10px; --font: Inter, system-ui, sans-serif; --mono: "JetBrains Mono", ui-monospace, monospace;
}
html[data-theme=light] {
  --bg: #fff; --surface: #fff; --surface-2: #f1f0f5; --line: #e3e0ea; --line-2: #c9c4d3;
  --ink: #16131c; --muted: #6b6577; --accent: #7c4ddb; --accent-ink: #6a3ccc; --accent-soft: rgba(124, 77, 219, .12);
  --amber: #b97a00; --cyan: #0284c7; --good: #059669; --bad: #dc2626;
  --sheet: #fff; --rule: rgba(22, 19, 28, .16);
}
*, *::before, *::after { animation: none !important; transition: none !important; }   /* nothing on the board animates or eases */
* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; scroll-behavior: auto !important; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; border: 2px solid var(--surface); }
*::-webkit-scrollbar-thumb:hover { background: var(--muted); }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 14px/1.45 var(--font); overflow: hidden; overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:focus-visible, textarea:focus-visible, [contenteditable]:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; display: block; }
[hidden] { display: none !important; }

/* canvas + card layer */
/* Layers, bottom to top: grid, input surface, boxes and pictures, ink, their live ink, my live stroke, cursors. */
#bg, #c, #rv, #ov { position: fixed; inset: 0; display: block; pointer-events: none; }
#bg { z-index: 0; }
#hit { position: fixed; inset: 0; touch-action: none; z-index: 1; }
#cards { position: fixed; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; z-index: 2; }
#cardsz { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
#c { z-index: 3; }
#rv { z-index: 4; }
#ov { z-index: 5; }
body[data-tool=eraser] #hit { cursor: cell; }
body[data-tool=select] #hit { cursor: default; }
body[data-tool=text] #hit { cursor: text; }
body[data-tool=line] #hit, body[data-tool=rect] #hit, body[data-tool=arrow] #hit { cursor: crosshair; }
/* island */
#island { position: fixed; top: 43px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 2px; padding: 3px 8px 4px; background: var(--surface); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 16px 16px; z-index: 11; }
#island > button { width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); }
#island > button:hover { color: var(--ink); background: var(--surface-2); }
#island > button[aria-pressed=true] { color: var(--accent-ink); background: var(--accent-soft); }
#island > button:disabled { opacity: .35; cursor: default; }
#island .sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }

/* his own boxes and pictures on the board */
.card { position: absolute; touch-action: none; pointer-events: none; color: var(--ink); font-size: 21px; line-height: 1.55; }
body[data-tool=select] .card.text, body[data-tool=text] .card.text, body[data-tool=select] .card.image, .card.editing { pointer-events: auto; }
/* text and image cards stay bare */
.card.text { padding: 6px; border-radius: 6px; cursor: move; touch-action: none; }
.card.text.editing { outline: 1.5px solid var(--accent); outline-offset: 2px; background: var(--sheet); }
.card.text .body { padding: 2px 6px; cursor: text; }
math-field { display: block; width: 100%; min-height: 1.4em; padding: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: inherit; --caret-color: var(--accent); --selection-background-color: var(--accent-soft); --contains-highlight-background-color: transparent; --smart-fence-color: var(--muted); }
math-field::part(menu-toggle) { display: none; }
.card.text .body.edit.math { white-space: normal; }
.card.text .katex-display { margin: .2em 0; }
.textog { position: absolute; top: -30px; right: 0; height: 24px; padding: 0 9px; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line-2); pointer-events: auto; }
.textog[aria-pressed=true] { color: var(--accent-ink); background: var(--accent-soft); border-color: transparent; }
.card.text .body p { margin: 0 0 .4em; }
.card.text .body p:last-child { margin-bottom: 0; }
.card.text .body.edit { white-space: pre-wrap; min-height: 1.4em; outline: 0; }
.card.text .body.edit:empty::before { content: "Type here · Esc when done"; color: var(--muted); }
.card.image img { display: block; width: 100%; cursor: grab; touch-action: none; user-select: none; -webkit-user-drag: none; }
.card .kill { position: absolute; top: -14px; left: -14px; width: 26px; height: 26px; border-radius: 99px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--muted); opacity: 0; pointer-events: none; }
.card .kill svg { width: 14px; height: 14px; }
body[data-tool=select] .card .kill { opacity: 1; pointer-events: auto; }
body[data-tool=select] .card .kill:hover { color: var(--bad); border-color: var(--bad); }
.card.image.stretch img { height: 100%; object-fit: fill; }
.card.image.bg { z-index: -1; }
body .card.image.bg, .card.image.bg img { pointer-events: none; cursor: default; }
.card.image.bg .rz { display: none; }
body.selmoving .card.sel, .card.moving { will-change: translate; }

#pens { position: fixed; top: 104px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 2px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; z-index: 11; }
#pens button { width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; }
#pens button:hover { background: var(--surface-2); }
#pens button[aria-checked=true] { background: var(--accent-soft); }
#pens i { display: block; width: 20px; border-radius: 99px; background: var(--ink); height: var(--w); }

#toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); padding: 8px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--ink); font-size: 13px; z-index: 12; max-width: min(520px, 90vw); }
#toast.err { border-color: rgba(248, 113, 113, .5); }
/* pen popover: thickness | colour */
#pens .psep { width: 1px; align-self: stretch; margin: 6px 4px; background: var(--line-2); }
#pens b { display: block; width: 18px; height: 18px; border-radius: 99px; }
#pens [data-c][aria-checked=true] b { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.card.text .katex-display, .card.text .katex-display > .katex { text-align: left; }   /* same place as while typing */
.card.text .body.edit.math { outline: 0; background: transparent; }

/* ---- the room: board tabs and people along the top, call controls down the right */
#top { position: fixed; top: 0; left: 0; right: 0; height: 44px; display: flex; align-items: center; gap: 6px; padding: 0 8px; background: var(--surface); border-bottom: 1px solid var(--line); z-index: 10; }
#top .grow { flex: 1; }
#tabs { display: flex; gap: 2px; overflow-x: auto; min-width: 0; scrollbar-width: none; }
#tabs::-webkit-scrollbar { display: none; }
.tab { display: flex; align-items: center; gap: 7px; height: 32px; padding: 0 6px 0 10px; border-radius: 8px; color: var(--muted); white-space: nowrap; cursor: pointer; user-select: none; }
.tab svg { width: 15px; height: 15px; flex: none; }
.tab:hover { color: var(--ink); background: var(--surface-2); }
.tab.cur { color: var(--ink); background: var(--surface-2); }
.tab .name { font-weight: 500; }
.tab .name[contenteditable=plaintext-only] { outline: 1px solid var(--accent); border-radius: 4px; padding: 0 4px; cursor: text; }
.tab .dot { width: 8px; height: 8px; border-radius: 99px; flex: none; }
.tab .del { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; opacity: 0; }
.tab .del svg { width: 13px; height: 13px; }
.tab:hover .del, .tab.cur .del { opacity: .6; }
.tab .del:hover, .tab .del.arm { opacity: 1; color: var(--bad); }
#newboard { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); flex: none; }
#newboard:hover { color: var(--ink); background: var(--surface-2); }
#net { font-size: 13px; color: var(--amber); white-space: nowrap; }
#people { display: flex; flex: none; }
.av { width: 30px; height: 30px; border-radius: 99px; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; background: var(--c); border: 2px solid var(--surface); margin-left: -6px; }
.av:first-child { margin-left: 0; }
.av:not(.me):hover { box-shadow: 0 0 0 2px var(--c); }
.av.me { cursor: default; }
#leave { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--bad); background: var(--surface-2); flex: none; }
#leave:hover { color: #fff; background: var(--bad); }
#leave svg { width: 16px; height: 16px; }
#island > button.arm { color: var(--bad); background: var(--surface-2); }

#rail { position: fixed; top: 44px; right: 0; bottom: 0; width: 56px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0; background: var(--surface); border-left: 1px solid var(--line); z-index: 10; }
#rail .grow { flex: 1; }
#rail button { position: relative; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); }
#rail button:hover { color: var(--ink); background: var(--surface-2); }
#rail button[aria-pressed=true] { color: var(--accent-ink); background: var(--accent-soft); }
#rail button.off, #rail button.off[aria-pressed] { color: #fff; background: var(--bad); }
#rail svg { width: 19px; height: 19px; }
.badge { position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--bad); color: #fff; font: 700 10px/16px var(--font); font-style: normal; }

#tiles { position: fixed; top: 52px; right: 64px; z-index: 9; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; touch-action: none; user-select: none; }
.tile { position: relative; width: 224px; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #111018; border: 1px solid var(--line-2); cursor: grab; box-shadow: 0 6px 24px rgba(0, 0, 0, .25); }
.tile.big { width: min(520px, 46vw); }
.tile.screen.big { width: min(900px, 70vw); }
.tile video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.tile.screen video { object-fit: contain; }
.tile.mirror video, #join .preview video.mirror { transform: scaleX(-1); }
.tile.novideo video { visibility: hidden; }
.tile .avatar { position: absolute; inset: 0; margin: auto; width: 56px; height: 56px; border-radius: 99px; display: none; place-items: center; background: color-mix(in srgb, var(--c) 30%, #111018); border: 2px solid var(--c); color: #fff; font-weight: 700; font-size: 20px; }
.tile.big .avatar { width: 88px; height: 88px; font-size: 30px; }
.tile.novideo .avatar { display: grid; }
.tile .label { position: absolute; left: 6px; bottom: 6px; display: flex; align-items: center; gap: 6px; max-width: calc(100% - 12px); padding: 2px 8px; border-radius: 6px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px; }
.tile .label i { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.tile .label b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .label svg { width: 13px; height: 13px; color: #f87171; flex: none; }
.tile .state { position: absolute; top: 6px; left: 6px; padding: 2px 8px; border-radius: 6px; background: rgba(0, 0, 0, .55); color: #fbbf24; font-size: 12px; }

#chat, #settings { position: fixed; right: 64px; bottom: 8px; z-index: 11; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
#chat { width: min(340px, calc(100vw - 80px)); height: min(440px, calc(100vh - 70px)); display: flex; flex-direction: column; }
#chat header { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 6px 14px; font-weight: 600; }
#chat .x { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); }
#chat .x:hover { color: var(--ink); background: var(--surface-2); }
#msgs { flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: 4px 14px; display: flex; flex-direction: column; gap: 10px; }
#msgs li { display: grid; gap: 1px; }
#msgs .who { font-size: 12px; font-weight: 600; }
#msgs .who small { font-weight: 400; color: var(--muted); margin-left: 6px; }
#msgs .txt { white-space: pre-wrap; word-break: break-word; }
#msgs a { color: var(--accent-ink); }
#chat .again { padding: 8px; }
#settings { width: 300px; padding: 14px; display: grid; gap: 12px; }
#settings label { display: grid; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); }
#settings select { height: 36px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink); font: 13px var(--font); padding: 0 8px; }
#settings .check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); font-size: 13px; }
.again { display: flex; gap: 6px; width: 100%; }
.again input { flex: 1; min-width: 0; height: 38px; padding: 0 12px; border-radius: 9px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); font: 15px var(--font); outline: none; }
.again input:focus { border-color: var(--accent); }
.again button { width: 38px; height: 38px; flex: none; border-radius: 9px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; }
.again button:hover { background: var(--accent); color: #fff; }

#peermenu { position: fixed; z-index: 12; display: grid; padding: 4px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
#peermenu button { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 12px; border-radius: 7px; white-space: nowrap; }
#peermenu button:hover { background: var(--surface-2); }
#peermenu svg { width: 16px; height: 16px; color: var(--muted); }

#cursors { position: fixed; inset: 0; pointer-events: none; z-index: 6; overflow: hidden; }
.pcur { position: absolute; left: 0; top: 0; will-change: transform; }
.pcur svg { width: 20px; height: 20px; margin: -3px 0 0 -4px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .3)); }
.pcur span { position: absolute; left: 14px; top: 16px; padding: 1px 7px; border-radius: 6px; color: #fff; font-size: 11px; font-weight: 600; white-space: nowrap; }
.pcur.idle span { display: none; }
.pcur.idle { opacity: .5; }

#join { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: var(--bg); overflow-y: auto; }
.jform { width: min(400px, 100%); display: grid; gap: 10px; }
.jform h2 { margin: 0; font-size: 24px; font-weight: 650; letter-spacing: -.01em; }
.jform .sub { margin: 0 0 4px; color: var(--muted); }
.jform input { height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: transparent; color: var(--ink); font: 15px var(--font); }
.jform input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.jform .err { margin: 0; min-height: 18px; font-size: 13px; color: var(--bad); }
.jform .go { height: 44px; border-radius: 10px; font-weight: 600; color: #fff; background: var(--accent); }
.preview { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #111018; }
.preview video { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview .ph { position: absolute; inset: 0; display: none; place-items: center; color: #8d8798; }
.preview.novideo .ph { display: grid; }
.preview.novideo video { visibility: hidden; }
.ptog { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 10px; }
.ptog button { width: 44px; height: 44px; border-radius: 99px; display: grid; place-items: center; color: #fff; background: rgba(255, 255, 255, .18); }
.ptog button.off { background: var(--bad); }
.wcard { background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; padding: 26px 26px 18px; }

/* the tool island hangs from the top bar like a notch: joined to it, rounded below, never faded */
#island::before, #island::after { content: ""; position: absolute; top: 0; width: 14px; height: 14px; background: radial-gradient(circle at 100% 100%, transparent 13.5px, var(--line) 13.5px, var(--line) 14.5px, var(--surface) 14.5px); }
#island::before { left: -14px; transform: scaleX(-1); }
#island::after { right: -14px; }
body.bare #island { top: 0; }
body.bare #top, body.bare #rail { display: none; }
body.bare #tiles { top: 8px; right: 8px; }
body.bare #chat, body.bare #settings { right: 8px; }
#pens { top: 96px; }
body.bare #pens { top: 52px; }

/* one resize ball, bottom right, on the selected card or the box being typed in */
.card .rz { position: absolute; right: -9px; bottom: -9px; width: 16px; height: 16px; border-radius: 99px; background: var(--accent); border: 2px solid var(--bg); cursor: nwse-resize; touch-action: none; display: none; pointer-events: auto; z-index: 2; }
.card .rz::before { content: ""; position: absolute; inset: -10px; border-radius: 99px; }   /* a bigger target for a finger */
.card.solo .rz, .card.editing .rz { display: block; }
.card.image.bg .rz { display: none; }
.card.editing .rz { display: block; }

/* links and what they embed */
.card a { pointer-events: auto; color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }
.embed { margin-top: 8px; border-radius: 10px; overflow: hidden; background: #000; border: 1px solid var(--line-2); pointer-events: auto; }
.embed iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; background: #fff; }
.embed:not(.yt) iframe { aspect-ratio: 4 / 3; }
.embed.yt iframe { background: #000; }
.ebar { display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; background: var(--surface-2); color: var(--muted); font-size: 13px; line-height: 1.3; }
.ebar a { color: var(--accent-ink); word-break: normal; white-space: nowrap; }
body.selmoving .embed iframe, .card.moving .embed iframe { pointer-events: none; }

/* lessons */
#lessonbtn { display: flex; align-items: baseline; gap: 7px; height: 32px; padding: 0 8px 0 10px; border-radius: 8px; flex: none; white-space: nowrap; }
#lessonbtn:hover { background: var(--surface-2); }
#lessonbtn b { font-weight: 650; }
#lessonbtn small { color: var(--muted); font-size: 12px; }
#lessonbtn svg { width: 15px; height: 15px; color: var(--muted); align-self: center; }
#lessons { position: fixed; top: 48px; left: 8px; z-index: 12; width: 320px; max-height: calc(100vh - 70px); overflow-y: auto; padding: 6px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
#lessons ol { list-style: none; margin: 0; padding: 0; }
#lessons li { display: flex; align-items: center; gap: 2px; border-radius: 8px; }
#lessons li.cur { background: var(--surface-2); }
#lessons li .open { flex: 1; display: grid; text-align: left; padding: 8px 10px; border-radius: 8px; }
#lessons li .open small { color: var(--muted); font-size: 12px; }
#lessons li > button:not(.open) { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); }
#lessons li > button:not(.open):hover { color: var(--ink); background: var(--surface-2); }
#lessons li > button svg { width: 15px; height: 15px; }
#lessons .newl { display: flex; align-items: center; gap: 8px; width: 100%; height: 40px; margin-top: 6px; padding: 0 12px; border-radius: 8px; font-weight: 600; color: var(--accent-ink); background: var(--accent-soft); }
#lessons .hint { margin: 8px 10px 4px; color: var(--muted); font-size: 12px; }
#nextlesson { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); z-index: 30; width: min(420px, calc(100vw - 24px)); box-shadow: 0 16px 40px rgba(0, 0, 0, .25); }
#nextlesson h3 { margin: 0 0 6px; font-size: 16px; }
#nextlesson p { margin: 0 0 14px; color: var(--muted); }
#nextlesson .row { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
#nextlesson button { height: 38px; padding: 0 14px; border-radius: 9px; font-weight: 600; background: var(--surface-2); }
#nextlesson .new { color: #fff; background: var(--accent); }

/* top bar pills */
#follow, #recpill { display: flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
#follow { color: var(--accent-ink); background: var(--accent-soft); }
#recpill { color: #fff; background: var(--bad); font-variant-numeric: tabular-nums; }
#recpill i { width: 8px; height: 8px; border-radius: 99px; background: #fff; }
#rail button.live { color: #fff; background: var(--bad); }
.av.tutor { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--c); }
#sharing { position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%); z-index: 12; display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-2); color: var(--ink); font-size: 13px; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); }
#sharing button { height: 30px; padding: 0 12px; border-radius: 7px; font-weight: 600; color: #fff; background: var(--bad); }

/* insert menu, under the island */
#insert { position: fixed; top: 96px; left: 50%; transform: translateX(-50%); z-index: 12; display: grid; padding: 5px; min-width: 260px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
body.bare #insert { top: 52px; }
#insert button { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: 8px; text-align: left; }
#insert button:hover { background: var(--surface-2); }
#insert svg { color: var(--muted); }
#insert small { margin-left: auto; color: var(--muted); font-size: 12px; }
#insert kbd { margin-left: auto; font: 600 11px var(--font); color: var(--muted); border: 1px solid var(--line-2); border-radius: 5px; padding: 0 5px; }
#drop { position: fixed; inset: 12px; z-index: 50; display: grid; place-items: center; border: 2px dashed var(--accent); border-radius: 16px; background: color-mix(in srgb, var(--bg) 70%, transparent); pointer-events: none; font-size: 17px; font-weight: 600; color: var(--accent-ink); }

/* chat | transcript */
#chat header { padding: 6px 8px 4px 8px; }
.ctabs { display: flex; gap: 2px; }
.ctabs button { height: 30px; padding: 0 12px; border-radius: 8px; color: var(--muted); font-weight: 600; }
.ctabs button[aria-selected=true] { color: var(--ink); background: var(--surface-2); }
#lines { flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: 4px 14px; display: flex; flex-direction: column; gap: 10px; }
#lines li { display: grid; gap: 1px; }
#lines .who { font-size: 12px; font-weight: 600; }
#lines .who small { font-weight: 400; color: var(--muted); margin-left: 6px; }
#lines .empty { color: var(--muted); font-size: 13px; line-height: 1.5; }
.txfoot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px 10px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.txfoot button { height: 32px; padding: 0 12px; border-radius: 8px; font-weight: 600; color: var(--accent-ink); background: var(--accent-soft); }
.txfoot[hidden] { display: none; }

/* join: student or tutor */
.role { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.role button { height: 40px; font-weight: 600; color: var(--muted); }
.role button[aria-checked=true] { color: var(--accent-ink); background: var(--accent-soft); }
@media (max-width: 1560px) { #tiles { top: 100px; } body.bare #tiles { top: 56px; } }   /* clear of the island on narrower screens */
