/* ClassLive — "blackboard and graph paper" */
:root {
  --board: #16302F; --board-2: #1D3B39; --board-3: #285049; --board-4: #346159;
  --chalk: #F4F7F5; --chalk-2: #C5D4D0; --chalk-3: #8FA8A3;
  --grid: #9CC3DE; --grid-faint: #DCEAF3;
  --hl: #F2C230; --hl-ink: #2A2100;
  --red: #E5484D; --green: #2FA36B;
  --paper: #F8FBFC; --ink: #16302F; --ink-2: #4A615E; --line: #D5E1E6;
  --font: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Bricolage Grotesque", var(--font);
  --r: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 17px/1.5 var(--font); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
body.paper {
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid-faint) 1px, transparent 1px), linear-gradient(90deg, var(--grid-faint) 1px, transparent 1px);
  background-size: 28px 28px; background-position: -1px -1px; min-height: 100vh;
}
h1, h2, h3 { font-family: var(--display); line-height: 1.12; margin: 0 0 .4em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4vw, 2.9rem); font-weight: 800; }
h2 { font-size: 1.3rem; font-weight: 700; }
a { color: #1F5E8C; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--hl); outline-offset: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--ink-2); }
.small { font-size: .9rem; }
.lede { font-size: 1.12rem; color: var(--ink-2); max-width: 46ch; }
.mono-num { font-variant-numeric: tabular-nums; letter-spacing: .03em; }
.err { background: #FDECEC; color: #8A1C1F; border-left: 4px solid var(--red); padding: .6em .9em; border-radius: 4px; }
.row { display: flex; gap: .6rem; align-items: center; }
.row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; } .row.center { justify-content: center; }
.stack { display: grid; gap: .9rem; }
label { display: grid; gap: .3rem; font-weight: 700; font-size: .95rem; }
label.check { display: flex; gap: .6rem; font-weight: 400; align-items: flex-start; }
label.check input { margin-top: .3em; width: 1.05em; height: 1.05em; accent-color: var(--board-3); }
input, select, textarea { font: inherit; font-weight: 400; color: var(--ink); background: #fff; border: 1.5px solid #B7C9CF; border-radius: 8px; padding: .55em .7em; min-width: 0; }
input:focus, select:focus, textarea:focus { border-color: var(--board-3); outline: none; box-shadow: 0 0 0 3px rgba(242,194,48,.45); }
textarea { resize: vertical; }

.btn { --b: #fff; --t: var(--ink); --bd: #B7C9CF; display: inline-flex; align-items: center; justify-content: center; gap: .4em; font: 700 .97rem var(--font);
  padding: .55em 1.05em; border-radius: 8px; border: 1.5px solid var(--bd); background: var(--b); color: var(--t); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { --bd: var(--ink-2); }
.btn.primary { --b: var(--board); --t: var(--chalk); --bd: var(--board); }
.btn.primary:hover { --b: var(--board-3); --bd: var(--board-3); }
.btn.danger { --b: var(--red); --t: #fff; --bd: var(--red); }
.btn.danger.ghost { --b: transparent; --t: #B4262B; --bd: transparent; }
.btn.ghost { --b: transparent; --bd: transparent; }
.btn.ghost:hover { --b: rgba(22,48,47,.07); }
.btn.big { padding: .75em 1.3em; font-size: 1.05rem; }
.btn.small { padding: .3em .7em; font-size: .85rem; }
.btn:disabled { opacity: .55; cursor: default; }
.linkbtn { background: none; border: 0; font: inherit; color: inherit; cursor: pointer; padding: 0; }
.tag { font-size: .78rem; font-weight: 700; background: var(--hl); color: var(--hl-ink); padding: .1em .5em; border-radius: 99px; vertical-align: middle; }

/* top bar ---------------------------------------------------------------- */
.topbar { display: flex; justify-content: space-between; align-items: center; padding: .8rem clamp(16px, 4vw, 40px); background: var(--board); color: var(--chalk); }
.brand { display: flex; align-items: center; gap: .55rem; font: 800 1.25rem var(--display); color: var(--chalk); text-decoration: none; }
.topbar nav { display: flex; gap: 1.3rem; align-items: center; flex-wrap: wrap; }
.topbar nav a, .topbar .linkbtn { color: var(--chalk-2); text-decoration: none; font-weight: 700; }
.topbar nav a:hover, .topbar .linkbtn:hover, .topbar nav a[aria-current] { color: var(--chalk); }
.topbar nav a[aria-current] { box-shadow: inset 0 -3px 0 var(--hl); }
.flash { max-width: 1100px; margin: 1rem auto 0; padding: .7rem 1rem; background: #E8F5EE; border-left: 4px solid var(--green); border-radius: 4px; }

/* landing ----------------------------------------------------------------- */
.landing { display: grid; grid-template-columns: minmax(320px, 440px) 1fr; min-height: calc(100vh - 60px); }
.join-card { padding: clamp(28px, 6vw, 72px) clamp(16px, 4vw, 56px); background: var(--paper); border-right: 1.5px solid var(--line); display: flex; flex-direction: column; justify-content: center; gap: .9rem; }
.join-card h1 { font-size: clamp(2.3rem, 4.5vw, 3.4rem); }
.join-card input[name=code] { font-size: 1.45rem; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.hero-graph { margin: 0; position: relative; overflow: hidden; background: #fff; }
.hero-graph svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-graph .curve { stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw 2.4s .3s ease-out forwards; }
.hero-graph .curve2 { opacity: 0; animation: fade .6s 2.4s forwards; }
.hero-graph figcaption { position: absolute; right: 24px; bottom: 20px; font: italic 1.15rem Georgia, serif; color: var(--ink); background: rgba(255,255,255,.85); padding: .2em .6em; border-radius: 4px; }
.hero-graph figcaption span { color: #9A7400; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .hero-graph .curve { animation: none; stroke-dashoffset: 0; } .hero-graph .curve2 { animation: none; opacity: 1; } }
@media (max-width: 760px) { .landing { grid-template-columns: 1fr; } .hero-graph { min-height: 220px; order: -1; } .join-card { border-right: 0; } }

/* pages ------------------------------------------------------------------- */
.narrow { max-width: 480px; margin: 0 auto; padding: clamp(28px, 6vw, 64px) 16px; }
.wide { max-width: 1160px; margin: 0 auto; padding: clamp(24px, 4vw, 48px) clamp(16px, 3vw, 32px); }
.panel { background: #fff; border: 1.5px solid var(--line); border-radius: var(--r); padding: 1.3rem; }
.page-head { margin-bottom: 1.5rem; }
.dash { display: grid; grid-template-columns: 1fr 340px; gap: 2rem; align-items: start; }
@media (max-width: 900px) { .dash { grid-template-columns: 1fr; } }
.lesson-list { display: grid; gap: 0; background: #fff; border: 1.5px solid var(--line); border-radius: var(--r); }
.lesson { display: grid; grid-template-columns: 1fr auto; gap: 1rem; padding: 1.2rem 1.3rem; border-bottom: 1.5px solid var(--line); background: #fff; }
.lesson:last-child { border-bottom: 0; }
.lesson h2 { margin-bottom: .25rem; }
.lesson .meta { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; margin: 0; color: var(--ink-2); font-size: .93rem; }
.lesson .notes { margin: .4rem 0 0; font-size: .93rem; color: var(--ink-2); }
.lesson-actions { display: flex; gap: .5rem; align-items: flex-start; flex-wrap: wrap; justify-content: flex-end; }
.live-pill { font: 700 .78rem var(--font); background: var(--green); color: #fff; padding: .15em .6em; border-radius: 99px; vertical-align: middle; margin-left: .3rem; }
details.edit { position: relative; }
details.edit > summary { list-style: none; }
details.edit > summary::-webkit-details-marker { display: none; }
details.edit[open] > form { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; width: min(360px, 86vw); background: #fff; border: 1.5px solid var(--line); border-radius: var(--r); padding: 1rem; box-shadow: 0 12px 30px rgba(22,48,47,.16); }
details.edit.inline[open] > form { position: static; box-shadow: none; border: 0; padding: .4rem 0 0; width: auto; }
.empty { padding: 2rem 1.3rem; color: var(--ink-2); margin: 0; }
.new-lesson { position: sticky; top: 1rem; }
.install-hint { border-top: 1.5px dashed var(--line); margin-top: 1rem; padding-top: .8rem; }
.lesson.rec { grid-template-columns: 260px 1fr; border: 1.5px solid var(--line); border-radius: var(--r); margin-bottom: 1rem; }
.lesson.rec video { width: 100%; border-radius: 6px; background: #000; aspect-ratio: 16/9; }
@media (max-width: 700px) { .lesson, .lesson.rec { grid-template-columns: 1fr; } .lesson-actions { justify-content: flex-start; } }
.player { width: 100%; max-height: 75vh; background: #000; border-radius: var(--r); margin: 1rem 0; }
.table { width: 100%; border-collapse: collapse; background: #fff; border: 1.5px solid var(--line); border-radius: var(--r); margin-bottom: 2rem; }
.table th, .table td { text-align: left; padding: .65rem .8rem; border-bottom: 1px solid var(--line); }
.table th { font-size: .88rem; color: var(--ink-2); }

/* =========================================================== ROOM ======= */
body.board { background: var(--board); color: var(--chalk); overflow: hidden; }
body.board a { color: var(--hl); }
.screen { min-height: 100vh; }
.board input, .board select, .board textarea { background: var(--board-2); color: var(--chalk); border-color: var(--board-4); }
.board .muted { color: var(--chalk-3); }
.board .btn { --b: var(--board-3); --t: var(--chalk); --bd: var(--board-4); }
.board .btn:hover { --b: var(--board-4); --bd: var(--chalk-3); }
.board .btn.primary { --b: var(--hl); --t: var(--hl-ink); --bd: var(--hl); }
.board .btn.primary:hover { --b: #FFD24D; }
.board .btn.ghost { --b: transparent; --bd: transparent; --t: var(--chalk-2); }
.board .btn.ghost:hover { --b: rgba(255,255,255,.07); }
.board .btn.danger { --b: var(--red); --t: #fff; --bd: var(--red); }
.board .btn.danger.ghost { --b: transparent; --bd: transparent; --t: #FF8E8E; }
.board .err { background: rgba(229,72,77,.15); color: #FFC2C2; }

svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* pre-join */
.prejoin { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: clamp(20px, 4vw, 56px); align-items: center; padding: clamp(16px, 4vw, 56px); max-width: 1240px; margin: 0 auto; }
.pj-video { position: relative; aspect-ratio: 16/9; background: var(--board-2); border-radius: 14px; overflow: hidden; border: 1.5px solid var(--board-4); }
.pj-video video { width: 100%; height: 100%; object-fit: cover; display: block; }
video.mirror, .tile.mirror video { transform: scaleX(-1); }
.pj-off { position: absolute; inset: 0; display: grid; place-items: center; color: var(--chalk-3); font-size: 1.1rem; }
.pj-controls { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 12px; }
.round { width: 52px; height: 52px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; background: var(--red); color: #fff; }
.round.on { background: rgba(22,48,47,.75); border: 1.5px solid rgba(244,247,245,.4); }
.round.sm { width: 38px; height: 38px; background: var(--board-3); }
.round.sm.primary { background: var(--hl); color: var(--hl-ink); }
.meter { position: absolute; left: 14px; bottom: 26px; width: 80px; height: 6px; border-radius: 3px; background: rgba(0,0,0,.4); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--hl); transition: width .08s; }
.devices { margin-top: 14px; }
.devices label { flex: 1 1 180px; font-size: .85rem; color: var(--chalk-2); }
.devices select { font-size: .9rem; width: 100%; }
.pj-form { display: grid; gap: 1rem; }
.pj-form h1 { font-size: clamp(2rem, 3.8vw, 3rem); margin: 0; }
.pj-form p { margin: 0; }
.pj-form .btn.big { justify-self: start; min-width: 12rem; }
@media (max-width: 820px) { .prejoin { grid-template-columns: 1fr; } body.board { overflow: auto; } }

/* waiting / ended */
.waitscreen { display: grid; place-items: center; padding: 16px; }
.wait-card { text-align: center; max-width: 520px; display: grid; gap: 1rem; justify-items: center; }
.wait-graph svg { width: 160px; height: 80px; }
.wait-graph path { stroke-dasharray: 200; animation: wave 2.6s linear infinite; }
@keyframes wave { from { stroke-dashoffset: 400; } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .wait-graph path { animation: none; } }
#waitVideo { width: 280px; aspect-ratio: 16/9; object-fit: cover; border-radius: 10px; background: var(--board-2); }

/* room layout */
.roomscreen { display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: auto minmax(0,1fr) auto; height: 100vh; height: 100dvh; }
.room-head { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; gap: 1rem; padding: .5rem 1rem; border-bottom: 1px solid var(--board-3); }
.rh-left { display: flex; gap: .8rem; align-items: baseline; min-width: 0; }
.rh-title { font: 700 1.05rem var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rh-sub { color: var(--chalk-3); font-size: .88rem; white-space: nowrap; }
.rh-mid { display: flex; gap: .5rem; }
.rh-right { display: flex; gap: .4rem; justify-content: flex-end; }
.btn.ghost-light { --b: transparent; --bd: var(--board-4); --t: var(--chalk-2); }
.pill { font-size: .82rem; font-weight: 700; padding: .2em .7em; border-radius: 99px; background: var(--board-3); font-variant-numeric: tabular-nums; display: inline-flex; gap: .4em; align-items: center; }
.pill.rec { background: var(--red); color: #fff; }
.pill.rec i { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .2; } }
@media (max-width: 700px) { .room-head { grid-template-columns: minmax(0,1fr) auto; } .rh-right { display: none; } .rh-sub { display: none; } }

.room-body-wrap { display: flex; min-height: 0; }
.stage { position: relative; flex: 1; min-width: 0; padding: 10px; display: flex; }

/* video grid */
.videos { flex: 1; min-height: 0; }
.videos.grid { display: flex; flex-wrap: wrap; gap: 10px; align-content: center; justify-content: center; }
.videos.grid .tile { width: var(--tw, 320px); aspect-ratio: 16/9; }
.videos.speaker { display: flex; flex-wrap: wrap; gap: 10px; align-content: flex-start; justify-content: center; }
.videos.speaker .tile.main { flex: 0 0 100%; height: calc(100% - 112px); }
.videos.speaker .tile.main:only-child { height: 100%; }
.videos.speaker > .tile:not(.main) { width: 180px; aspect-ratio: 16/9; }

.tile { position: relative; background: var(--board-2); border-radius: 12px; overflow: hidden; border: 2px solid transparent; transition: border-color .15s; }
.tile video { width: 100%; height: 100%; object-fit: cover; display: block; background: #0F2221; }
.tile.screen video, .tile.main.screen video { object-fit: contain; }
.tile.main video { object-fit: contain; }
.tile.speaking { border-color: var(--hl); }
.tile .avatar { position: absolute; inset: 0; display: none; place-items: center; background: var(--board-2); }
.tile .avatar span { width: min(34%, 120px); aspect-ratio: 1; border-radius: 50%; background: var(--av); display: grid; place-items: center; font: 700 clamp(1rem, 3vw, 2.4rem) var(--display); color: #fff; }
.tile.nocam .avatar { display: grid; }
.tile.nocam video { opacity: 0; }
.tile .nametag { position: absolute; left: 8px; bottom: 8px; display: flex; gap: .35rem; align-items: center; max-width: calc(100% - 16px); background: rgba(13,30,29,.72); padding: .15em .6em; border-radius: 6px; font-size: .85rem; }
.tile .nametag .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .mi { width: 9px; height: 9px; border-radius: 50%; background: var(--green); flex: none; }
.tile .mi.off { background: var(--red); }
.tile .hand { position: absolute; top: 8px; left: 8px; font-size: 1.5rem; background: var(--hl); width: 2.1rem; height: 2.1rem; border-radius: 50%; display: grid; place-items: center; animation: pop .3s; }
@keyframes pop { from { transform: scale(.3); } }
.tile .pin { position: absolute; top: 8px; right: 8px; opacity: 0; background: rgba(13,30,29,.7); border: 0; color: var(--chalk); border-radius: 6px; padding: 4px; cursor: pointer; }
.tile:hover .pin, .tile.pinned .pin { opacity: 1; }
.tile.pinned .pin { color: var(--hl); }
.tile .pin svg { width: 18px; height: 18px; }
.tile.away { opacity: .55; }
.tile.weak::after { content: "Weak connection"; position: absolute; top: 8px; left: 50%; transform: translateX(-50%); font-size: .75rem; background: rgba(229,72,77,.85); padding: .1em .5em; border-radius: 4px; }

/* whiteboard */
.boardwrap { flex: 1; min-width: 0; display: grid; grid-template-rows: auto 1fr auto; gap: 8px; }
.wb-toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; position: relative; }
.tg { display: flex; gap: 2px; align-items: center; background: var(--board-2); border: 1px solid var(--board-3); border-radius: 9px; padding: 3px; }
.tool { min-width: 36px; height: 36px; border: 0; background: transparent; color: var(--chalk-2); border-radius: 6px; cursor: pointer; display: inline-flex; gap: .3rem; align-items: center; justify-content: center; padding: 0 .4rem; font: 700 .85rem var(--font); }
.tool:hover { background: var(--board-3); color: var(--chalk); }
.tool.on { background: var(--hl); color: var(--hl-ink); }
.tool svg { width: 20px; height: 20px; }
.tool .sym { font: 700 1rem Georgia, serif; }
.sw { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--board-2); background: var(--c); cursor: pointer; margin: 0 2px; box-shadow: 0 0 0 1.5px var(--board-4); }
.sw.on { box-shadow: 0 0 0 2.5px var(--hl); }
.colors input[type=color] { width: 30px; height: 30px; padding: 0; border: 0; background: none; cursor: pointer; }
.sz { width: 34px; height: 36px; border: 0; background: transparent; border-radius: 6px; cursor: pointer; display: grid; place-items: center; }
.sz i { width: var(--s); height: var(--s); border-radius: 50%; background: var(--chalk-2); }
.sz.on { background: var(--board-4); } .sz.on i { background: var(--hl); }
.wb-toolbar select { height: 34px; padding: 0 .5rem; font-size: .88rem; border-radius: 6px; }
.pages span { font-variant-numeric: tabular-nums; font-size: .9rem; padding: 0 .4rem; color: var(--chalk-2); }
.sym-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; background: var(--board-2); border: 1px solid var(--board-4); padding: 8px; border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.4); }
.sym-pop button { min-width: 36px; height: 34px; border: 0; border-radius: 6px; background: var(--board-3); color: var(--chalk); font: 1.05rem Georgia, "Cambria Math", serif; cursor: pointer; }
.sym-pop button:hover { background: var(--hl); color: var(--hl-ink); }
.wb-canvas { position: relative; min-height: 0; border-radius: 10px; overflow: hidden; background: #C9D3D2; }
.wb-canvas canvas { position: absolute; inset: 0; }
#wbLive { touch-action: none; cursor: crosshair; }
#wbLive[data-tool=pan] { cursor: grab; } #wbLive[data-tool=text] { cursor: text; } #wbLive[data-tool=laser] { cursor: none; }
.board .wb-text { position: absolute; z-index: 3; min-width: 160px; min-height: 1.4em; background: rgba(255,255,255,.92); border: 1.5px dashed #1F6FD1; border-radius: 4px; padding: 0 4px; font-family: var(--font); line-height: 1.25; resize: both; box-shadow: none; }
.wb-readonly { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); background: rgba(22,48,47,.85); color: var(--chalk); padding: .3em .9em; border-radius: 99px; font-size: .85rem; pointer-events: none; }
.boardwrap.readonly .tg:not(.pages) .tool:not([data-tool=laser]):not([data-tool=pan]):not(#wbExport) { opacity: .4; }
.board.is-guest .host-only { display: none !important; }
.board.is-host .student-only { display: none !important; }
.filmstrip { display: flex; gap: 8px; overflow-x: auto; min-height: 0; }
.filmstrip .tile { width: 168px; aspect-ratio: 16/9; flex: none; }
.filmstrip .tile .nametag { font-size: .75rem; }
.filmstrip:empty { display: none; }

/* reactions + toasts */
.reactions { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.react-fly { position: absolute; font-size: 2.6rem; transform: translate(-50%, 0); animation: fly 2.6s ease-out forwards; }
@keyframes fly { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.6); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -160px) scale(1); } }
.toasts { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 30; width: min(560px, calc(100% - 32px)); }
.toast { display: flex; gap: .7rem; align-items: center; background: var(--chalk); color: var(--ink); padding: .55rem .6rem .55rem 1rem; border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.35); font-size: .95rem; animation: pop .2s; }
.toast span { flex: 1; }
.toast.quiet { background: var(--board-3); color: var(--chalk); }
.toast .btn { --b: var(--board); --t: var(--chalk); --bd: var(--board); }
.toast .x { background: none; border: 0; font-size: 1.3rem; line-height: 1; cursor: pointer; color: inherit; opacity: .6; padding: 0 .3rem; }

/* side panel */
.side { width: 340px; flex: none; background: var(--board-2); border-left: 1px solid var(--board-3); display: flex; flex-direction: column; min-height: 0; }
.side-tabs { display: flex; border-bottom: 1px solid var(--board-3); }
.side-tabs [role=tab] { flex: 1; background: none; border: 0; color: var(--chalk-3); font: 700 .95rem var(--font); padding: .8rem; cursor: pointer; border-bottom: 3px solid transparent; display: inline-flex; gap: .4rem; justify-content: center; align-items: center; }
.side-tabs [role=tab][aria-selected=true] { color: var(--chalk); border-bottom-color: var(--hl); }
.side-tabs [role=tab] span:not(.dot) { background: var(--board-4); border-radius: 99px; padding: 0 .5em; font-size: .8rem; }
.side-tabs .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--hl); }
.side-tabs .x { background: none; border: 0; color: var(--chalk-3); font-size: 1.5rem; padding: 0 .9rem; cursor: pointer; }
.side-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: auto; }
.pad { padding: .6rem .9rem; }
.plist { list-style: none; margin: 0; padding: .3rem .4rem; }
.pitem { display: flex; gap: .6rem; align-items: center; padding: .45rem .5rem; border-radius: 8px; position: relative; }
.pitem:hover { background: var(--board-3); }
.pitem.away { opacity: .55; }
.av { width: 34px; height: 34px; border-radius: 50%; background: var(--av); display: grid; place-items: center; font: 700 .85rem var(--display); color: #fff; flex: none; }
.pname { flex: 1; min-width: 0; display: grid; line-height: 1.2; }
.pname b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .95rem; }
.pname small { color: var(--chalk-3); font-size: .78rem; }
.pitem .st { display: flex; gap: 4px; color: var(--chalk-2); }
.pitem .st svg { width: 18px; height: 18px; }
.pitem .st svg.off { color: #FF8E8E; }
.hand-sm { font-size: 1.1rem; }
.pmenu { position: relative; }
.pmenu summary { list-style: none; cursor: pointer; padding: 4px; border-radius: 6px; color: var(--chalk-2); }
.pmenu summary::-webkit-details-marker { display: none; }
.pmenu summary:hover { background: var(--board-4); }
.pmenu .menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 15; background: var(--chalk); color: var(--ink); border-radius: 10px; padding: 6px; min-width: 230px; box-shadow: 0 12px 30px rgba(0,0,0,.4); display: grid; }
.pmenu .menu button { text-align: left; background: none; border: 0; font: .92rem var(--font); padding: .5rem .7rem; border-radius: 6px; cursor: pointer; color: var(--ink); }
.pmenu .menu button:hover { background: #E3ECEB; }
.pmenu .menu button.danger { color: #B4262B; }
.menu-sel { display: flex !important; align-items: center; gap: .4rem; font-weight: 400 !important; padding: .4rem .7rem; font-size: .92rem; }
.menu-sel select { background: #fff; color: var(--ink); border-color: #B7C9CF; padding: .2em .4em; }
.waiting-box { margin: .6rem; padding: .6rem; border-radius: 10px; background: rgba(242,194,48,.12); border: 1.5px solid rgba(242,194,48,.55); }
.waiting-box .pitem:hover { background: transparent; }

/* chat */
.chatlog { list-style: none; margin: 0; padding: .8rem; flex: 1; overflow-y: auto; display: grid; align-content: start; gap: .8rem; }
.ch-head { display: flex; gap: .3rem; align-items: baseline; font-size: .85rem; flex-wrap: wrap; }
.ch-head b { color: var(--chalk); }
.ch.host .ch-head b { color: var(--hl); }
.ch-head .priv { color: #F7A8C4; }
.ch-head time { margin-left: auto; color: var(--chalk-3); font-size: .78rem; }
.ch-body { font-size: .95rem; word-wrap: break-word; overflow-wrap: anywhere; white-space: pre-wrap; display: grid; gap: .4rem; justify-items: start; }
.ch.private .ch-body { border-left: 3px solid #F7A8C4; padding-left: .5rem; }
.ch-body img { max-width: 100%; max-height: 180px; border-radius: 8px; }
.filecard { display: flex; gap: .6rem; align-items: center; background: var(--board-3); color: var(--chalk) !important; text-decoration: none; padding: .5rem .7rem; border-radius: 8px; max-width: 100%; }
.filecard:hover { background: var(--board-4); }
.filecard .fi { width: 38px; height: 38px; border-radius: 6px; background: var(--hl); color: var(--hl-ink); display: grid; place-items: center; font: 700 .7rem var(--font); flex: none; }
.filecard span:last-child { display: grid; min-width: 0; }
.filecard b { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filecard small { color: var(--chalk-2); font-size: .78rem; }
.chatform { border-top: 1px solid var(--board-3); padding: .6rem; display: grid; gap: .5rem; }
.chatform.disabled .chat-input { opacity: .4; pointer-events: none; }
.chatform label { display: flex; align-items: center; gap: .4rem; font-weight: 400; color: var(--chalk-3); }
.chatform select { padding: .2em .4em; font-size: .85rem; }
.chat-input { display: flex; gap: .4rem; align-items: flex-end; }
.chat-input textarea { flex: 1; resize: none; max-height: 120px; padding: .5rem .7rem; font-size: .95rem; }

/* controls */
.controls { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .45rem 1rem; border-top: 1px solid var(--board-3); background: var(--board); }
.cg { display: flex; gap: 2px; align-items: center; }
.cg:nth-child(2) { flex-wrap: wrap; justify-content: center; }
.ctl { position: relative; display: grid; justify-items: center; gap: 2px; background: none; border: 0; color: var(--chalk-2); padding: .35rem .6rem; border-radius: 9px; cursor: pointer; font: 700 .76rem var(--font); min-width: 70px; }
.ctl:hover { background: var(--board-3); color: var(--chalk); }
.ctl.active { color: var(--hl); }
.ctl.off { color: #FF8E8E; }
.ctl.off svg { color: var(--red); }
.ctl.dim { opacity: .55; }
.ctl.attn::after { content: ""; position: absolute; top: 6px; right: 18px; width: 9px; height: 9px; border-radius: 50%; background: var(--hl); }
#btnRec.active { color: var(--red); }
.ctl .badge { position: absolute; top: 2px; right: 14px; background: var(--hl); color: var(--hl-ink); border-radius: 99px; font-style: normal; font-size: .7rem; padding: 0 .4em; min-width: 1.3em; }
.react-wrap { position: relative; }
.react-pop { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); display: flex; gap: 2px; background: var(--chalk); padding: 6px; border-radius: 99px; box-shadow: 0 10px 28px rgba(0,0,0,.35); z-index: 25; }
.react-pop button { font-size: 1.5rem; background: none; border: 0; cursor: pointer; padding: 2px 6px; border-radius: 50%; }
.react-pop button:hover { background: #E3ECEB; transform: scale(1.15); }
@media (max-width: 1000px) { .ctl { min-width: 54px; padding: .3rem .35rem; } .ctl span { display: none; } .side { position: absolute; right: 0; top: 52px; bottom: 64px; z-index: 40; width: min(360px, 100%); box-shadow: -12px 0 30px rgba(0,0,0,.35); } }

/* dialogs */
.dlg { border: 0; border-radius: 14px; padding: 1.4rem; background: var(--board-2); color: var(--chalk); width: min(440px, calc(100% - 32px)); box-shadow: 0 30px 60px rgba(0,0,0,.5); }
.dlg.wide { width: min(620px, calc(100% - 32px)); }
.dlg::backdrop { background: rgba(8,20,19,.6); }
.dlg h2 { margin-bottom: 1rem; }
.dlg label { color: var(--chalk-2); }
.dlg label.check { color: var(--chalk); }
.br-assign { display: grid; gap: .4rem; margin: 1rem 0; max-height: 45vh; overflow: auto; }
.br-row { display: flex !important; justify-content: space-between; align-items: center; font-weight: 400 !important; color: var(--chalk) !important; padding: .3rem .5rem; border-radius: 6px; background: var(--board-3); }
.br-rooms { list-style: none; padding: 0; display: grid; gap: .5rem; }
.br-rooms li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .6rem .8rem; background: var(--board-3); border-radius: 8px; }
.br-rooms li div { display: grid; } .br-rooms small { color: var(--chalk-2); }
#brMsgForm input { flex: 1; }

.upload-bar { position: fixed; left: 50%; top: 60px; transform: translateX(-50%); background: var(--chalk); color: var(--ink); padding: .6rem 1rem; border-radius: 10px; z-index: 60; display: grid; gap: .4rem; min-width: 300px; box-shadow: 0 10px 30px rgba(0,0,0,.4); font-weight: 700; font-size: .9rem; }
.upload-bar i { display: block; height: 6px; background: #D8E3E1; border-radius: 3px; overflow: hidden; }
.upload-bar b { display: block; height: 100%; width: 0; background: var(--board-3); transition: width .2s; }

/* phones ------------------------------------------------------------------ */
@media (max-width: 700px) {
  .prejoin { padding: 12px 16px 24px; gap: 16px; align-content: start; }
  .prejoin .devices { display: none; }            /* still available in Settings once inside */
  .pj-form h1 { font-size: 1.9rem; }
  .pj-form .btn.big { justify-self: stretch; }
  .controls { padding: .35rem .5rem; gap: .3rem; }
  .roomscreen { width: 100vw; overflow: hidden; }
  .cg { flex: none; }
  .cg:nth-child(2) { min-width: 0; flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; flex: 1 1 0; scrollbar-width: none; }
  .cg:nth-child(2)::-webkit-scrollbar { display: none; }
  .ctl { min-width: 46px; }
  .controls .btn.danger { padding: .5em .8em; }
  .stage { padding: 6px; }
  .wb-toolbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .wb-toolbar::-webkit-scrollbar { display: none; }
  .tg { flex: none; }
  .sym-pop { position: fixed; top: 110px; left: 8px; right: 8px; grid-template-columns: repeat(8, 1fr); }
  .filmstrip .tile { width: 112px; }
  .side { top: 0; bottom: 0; width: 100%; z-index: 50; }
  .videos.speaker > .tile:not(.main) { width: 120px; }
  .videos.speaker .tile.main { height: calc(100% - 80px); }
  .toasts { bottom: 8px; }
}
