/* ===== Nimbus ===== */
:root {
  --bg: #f4f5f9;
  --panel: #fff;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --soft: #f1f2f6;
  --accent: #6d5efc;
  --accent-soft: rgba(109, 94, 252, 0.1);
  --danger: #ef4444;
  --ok: #10b981;
  --warn: #f59e0b;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 8px 24px rgba(16, 24, 40, 0.1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; font-size: 15px; }
#app { height: 100%; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.err { color: var(--danger); font-size: 14px; }
.ic { display: inline-flex; line-height: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ----- controls ----- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; color: var(--ink); transition: background 0.15s, border-color 0.15s, transform 0.05s; }
.btn:hover { border-color: #cfd3dc; background: #fafafb; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #5b4be8; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.accent { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--soft); }
.btn.danger.ghost { color: var(--danger); background: transparent; }
.btn.small { padding: 6px 12px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; margin-top: 12px; padding: 12px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.linkbtn { border: 0; background: none; color: var(--muted); text-decoration: underline; cursor: pointer; margin-top: 14px; font-size: 13px; }
.tbtn { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; border-radius: 9px; cursor: pointer; color: var(--ink); flex: none; font-weight: 700; font-size: 13px; }
.tbtn:hover { background: var(--soft); }
.tbtn.on { background: var(--accent); color: #fff; }
.tbtn.wide { width: auto; padding: 0 10px; min-width: 52px; }
.tbtn.danger:hover { color: var(--danger); background: #fef2f2; }
.input { font: inherit; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; width: 100%; color: var(--ink); outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { resize: vertical; line-height: 1.45; }
.input.big { font-size: 22px; padding: 14px; text-align: center; font-weight: 600; }
.input.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 14px 0; }
.field > span { font-size: 13px; font-weight: 600; }
.field.inline { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
.field.inline select { width: auto; }
.toggle { display: flex; gap: 10px; align-items: center; margin: 14px 0; font-size: 14px; cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--accent); }
.seg { display: inline-flex; background: var(--soft); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--muted); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.seg.full { display: flex; }
.seg.full button { flex: 1; }
.swatches { display: flex; gap: 5px; align-items: center; }
.sw { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.15); cursor: pointer; padding: 0; }
.sw.on { outline: 2px solid var(--accent); outline-offset: 2px; }
.sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; flex: none; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: var(--soft); font-size: 12px; font-weight: 600; }
.chip.ok { background: #d1fae5; color: #047857; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.pill.live { background: #fee2e2; color: #b91c1c; }
.pill.xs { padding: 1px 7px; font-size: 10px; }
.badge { background: #0f172a; color: #fff; font-size: 11px; padding: 3px 8px; border-radius: 6px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.count { background: var(--danger); color: #fff; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 1px 8px; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #ef4444; flex: none; animation: pulse 1.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); } 70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }
.spinner { width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 700; border: 2px solid #fff; flex: none; letter-spacing: 0; }
.avatar.xs { width: 20px; height: 20px; font-size: 8px; border-width: 1.5px; }
.avatar.sm { width: 30px; height: 30px; }
.avatar.off { opacity: 0.35; filter: grayscale(1); }
.tdot { width: 12px; height: 12px; border-radius: 4px; flex: none; display: inline-block; }

/* ----- toasts / modal / offline ----- */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 5000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #111827; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow); animation: up 0.2s ease; transition: opacity 0.3s; max-width: 90vw; }
.toast.err { background: #b91c1c; }
.toast.out { opacity: 0; }
@keyframes up { from { transform: translateY(10px); opacity: 0; } }
.modal-back { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); z-index: 4000; display: grid; place-items: center; padding: 16px; animation: fade 0.15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: 16px; padding: 24px; width: min(420px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: var(--shadow); animation: up 0.2s ease; }
.modal.wide { width: min(560px, 100%); }
.modal h2 { margin: 0 0 12px; font-size: 19px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.offline { position: fixed; top: 0; left: 0; right: 0; z-index: 4500; background: #f59e0b; color: #fff; text-align: center; padding: 6px; font-size: 13px; font-weight: 600; }

/* ----- join screens ----- */
.center-screen { min-height: 100%; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 10%, #e9e6ff, transparent 50%), radial-gradient(circle at 90% 90%, #dff3ff, transparent 50%), var(--bg); }
.card { background: var(--panel); border-radius: 16px; padding: 20px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 0 0 1px var(--line); }
.card h3 { margin: 0 0 12px; font-size: 15px; }
.card.join { width: min(460px, 100%); padding: 32px; box-shadow: var(--shadow); }
.card.join h2 { margin: 18px 0 6px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--accent); font-size: 24px; letter-spacing: -0.02em; }
.logo.small { font-size: 18px; }
.teamlist { display: flex; flex-direction: column; gap: 8px; margin: 18px 0; max-height: 46vh; overflow: auto; }
.teamlist .empty { text-align: center; padding: 12px; }
.teamrow { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; text-align: left; transition: border-color 0.15s, box-shadow 0.15s; }
.teamrow:hover:not(:disabled) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.teamrow:disabled { opacity: 0.5; cursor: not-allowed; }
.tname { font-weight: 700; flex: 1; }
.tmembers { display: flex; }
.tmembers .avatar + .avatar { margin-left: -5px; }
.newteam { display: flex; gap: 8px; }

/* ----- workspace shell ----- */
.ws { display: flex; flex-direction: column; height: 100%; }
.topbar { height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 14px; background: #fff; border-bottom: 1px solid var(--line); flex: none; position: relative; z-index: 20; }
.teamchip { display: flex; align-items: center; gap: 8px; border: 0; background: var(--soft); padding: 6px 12px; border-radius: 9px; font-weight: 700; cursor: pointer; max-width: 220px; }
.teamchip:disabled { cursor: default; color: var(--ink); opacity: 1; }
.teamchip span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs { display: flex; gap: 2px; background: var(--soft); padding: 3px; border-radius: 11px; margin-left: 8px; }
.tab { display: flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; }
.tab.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }
.people { display: flex; padding-left: 6px; }
.people .avatar { margin-left: -6px; }
.menuwrap { position: relative; }
.menu { position: absolute; right: 0; top: 110%; background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 6px; min-width: 220px; z-index: 100; border: 1px solid var(--line); }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 9px 10px; border-radius: 8px; cursor: pointer; text-align: left; font-size: 14px; }
.menu button:hover { background: var(--soft); }
.panes { flex: 1; position: relative; min-height: 0; }
.pane { position: absolute; inset: 0; display: none; }
.pane.on { display: block; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
body.presenting .ws { height: calc(100% - var(--pbar-h, 172px)); }

/* ----- board ----- */
.board { position: absolute; inset: 0; overflow: hidden; }
.bv { position: absolute; inset: 0; background-color: #f5f6f8; background-image: radial-gradient(#cbd0da 1.1px, transparent 1.2px); touch-action: none; outline: none; overflow: hidden; user-select: none; -webkit-user-select: none; }
.bv[data-tool="hand"], .bv.space { cursor: grab; }
.bv.panning { cursor: grabbing; }
.bv[data-tool="sticky"], .bv[data-tool="text"], .bv[data-tool="rect"], .bv[data-tool="ellipse"], .bv[data-tool="line"], .bv[data-tool="pen"] { cursor: crosshair; }
.bw { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; --inv: 1; }
.bel { position: absolute; }
.bel-sticky { border-radius: 4px; padding: 16px; display: flex; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 8px 16px -6px rgba(0, 0, 0, 0.18); }
.bel-sticky .bel-text, .bedit-sticky { white-space: pre-wrap; word-break: break-word; overflow: hidden; width: 100%; line-height: 1.25; color: #1f2937; font-weight: 500; }
.bel-by { position: absolute; right: 8px; bottom: 5px; font-size: 10px; color: rgba(0, 0, 0, 0.4); max-width: 80%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bel-text > .bel-text, .bedit-text { white-space: pre-wrap; word-break: break-word; line-height: 1.3; font-weight: 600; }
.bel-rect, .bel-ellipse { border: 3px solid; border-radius: 10px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 12px; overflow: hidden; }
.bel-ellipse { border-radius: 50%; padding: 18px 24px; }
.bel-rect .bel-text, .bel-ellipse .bel-text { white-space: pre-wrap; word-break: break-word; line-height: 1.25; font-weight: 600; color: #1f2937; }
.bel-svg { overflow: visible; display: block; pointer-events: none; }
.bel-path { fill: none; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.bel-hit { fill: none; stroke: transparent; stroke-width: 16px; stroke-linecap: round; stroke-linejoin: round; pointer-events: stroke; }
.bel-line, .bel-pen { pointer-events: none; }
.bel-image img { width: 100%; height: 100%; display: block; border-radius: 4px; pointer-events: none; -webkit-user-drag: none; user-select: none; }
.bel.selected.bel-line .bel-path, .bel.selected.bel-pen .bel-path { filter: drop-shadow(0 0 3px rgba(109, 94, 252, 0.8)); }
.bel.editing .bel-text { visibility: hidden; }
.bsel { position: absolute; left: 0; top: 0; z-index: 999999; pointer-events: none; }
.btmp { position: absolute; left: 0; top: 0; z-index: 999998; pointer-events: none; }
.sbox { position: absolute; outline: calc(2px * var(--inv)) solid var(--accent); outline-offset: calc(2px * var(--inv)); border-radius: 3px; }
.sbox.remote { outline-color: var(--c); outline-style: dashed; }
.sbox-name { position: absolute; left: calc(-2px * var(--inv)); top: calc(-24px * var(--inv)); font-size: calc(11px * var(--inv)); background: var(--c); color: #fff; padding: calc(1px * var(--inv)) calc(6px * var(--inv)); border-radius: calc(4px * var(--inv)); white-space: nowrap; font-weight: 600; }
.hdl { position: absolute; width: calc(12px * var(--inv)); height: calc(12px * var(--inv)); background: #fff; border: calc(2px * var(--inv)) solid var(--accent); border-radius: calc(3px * var(--inv)); transform: translate(-50%, -50%); pointer-events: auto; cursor: move; }
.hdl.br { left: 100%; top: 100%; cursor: nwse-resize; transform: translate(-30%, -30%); }
.btmp-svg { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; }
.btmp-svg path { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.bghost { position: absolute; border: calc(2px * var(--inv)) dashed var(--accent); background: rgba(109, 94, 252, 0.06); border-radius: 6px; }
.bghost-ellipse { border-radius: 50%; }
.bedit { position: absolute; resize: none; border: 0; outline: calc(2px * var(--inv)) solid var(--accent); outline-offset: 0; background: transparent; font-family: var(--font); color: #1f2937; margin: 0; }
.bedit-sticky { padding: 16px; border-radius: 4px; }
.bedit-text { padding: 0; background: rgba(255, 255, 255, 0.9); overflow: hidden; }
.bedit-rect, .bedit-ellipse { text-align: center; background: rgba(255, 255, 255, 0.92); padding: 12px; font-weight: 600; line-height: 1.25; border-radius: 10px; }
.bmarq { position: absolute; border: 1px solid var(--accent); background: rgba(109, 94, 252, 0.08); pointer-events: none; }
.bcur { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.rcur { position: absolute; left: 0; top: 0; transition: transform 0.09s linear; }
.rcur svg { display: block; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3)); }
.rcur svg path { fill: var(--c); }
.rcur-name { position: absolute; left: 14px; top: 16px; background: var(--c); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 10px; white-space: nowrap; font-weight: 600; }
.bhint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; color: var(--muted); pointer-events: none; display: flex; flex-direction: column; gap: 8px; max-width: 460px; line-height: 1.5; font-size: 14px; }
.bhint b { font-size: 20px; color: var(--ink); }
.btools, .bzoom, .bprops { position: absolute; background: #fff; box-shadow: var(--shadow); border-radius: 14px; display: flex; z-index: 10; }
.btools { left: 14px; top: 50%; transform: translateY(-50%); flex-direction: column; gap: 2px; padding: 6px; }
.bzoom { right: 14px; bottom: 14px; padding: 4px; align-items: center; }
.bprops { top: 14px; left: 50%; transform: translateX(-50%); padding: 6px 10px; gap: 6px; align-items: center; max-width: calc(100% - 28px); overflow-x: auto; }
.bprops .fs { min-width: 26px; text-align: center; font-size: 13px; font-weight: 600; }

/* ----- notes ----- */
.notes { position: absolute; inset: 0; overflow: auto; padding: 24px 16px; }
.notes-page { max-width: 880px; margin: 0 auto; background: #fff; border-radius: 14px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 0 0 1px var(--line); min-height: 100%; display: flex; flex-direction: column; }
.notes .ql-toolbar.ql-snow { border: 0; border-bottom: 1px solid var(--line); position: sticky; top: -24px; background: #fff; z-index: 2; border-radius: 14px 14px 0 0; padding: 10px 16px; }
.notes .ql-container.ql-snow { border: 0; font-family: var(--font); font-size: 16px; flex: 1; }
.notes .ql-editor { padding: 32px 56px 80px; line-height: 1.6; min-height: 60vh; }
.notes .ql-editor.ql-blank::before { left: 56px; color: #9ca3af; font-style: normal; }
.notes .ql-editor h1 { font-size: 2em; margin: 0.6em 0 0.3em; }
.notes .ql-editor h2 { font-size: 1.5em; margin: 0.6em 0 0.3em; }

/* ----- slides editor (PowerPoint-style) ----- */
.slides-ed { position: absolute; inset: 0; display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.slides-ed.has-props { grid-template-columns: 220px minmax(0, 1fr) 300px; }
.slides-ed:not(.has-props) .sprops { display: none; }
.slist { background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.slist-items { overflow: auto; flex: 1; padding-bottom: 20px; }
.pane-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.addwrap { position: relative; text-transform: none; letter-spacing: 0; }
.splitbtn { display: inline-flex; }
.splitbtn > .btn:first-child { border-radius: 9px 0 0 9px; }
.splitbtn > .btn.caret { border-radius: 0 9px 9px 0; padding: 6px 6px; border-left: 1px solid rgba(255, 255, 255, 0.35); }
.addmenu { position: absolute; left: 0; top: 115%; z-index: 60; width: 340px; background: #fff; box-shadow: var(--shadow); border-radius: 12px; padding: 8px; border: 1px solid var(--line); max-height: 75vh; overflow: auto; color: var(--ink); font-weight: 400; }
.addmenu-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); padding: 4px 6px; }
.addmenu-item { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 7px 8px; border: 0; background: none; border-radius: 8px; cursor: pointer; color: var(--ink); }
.addmenu-item:hover, .layout-item:hover { background: var(--soft); }
.addmenu-item small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.addmenu-item b { font-size: 14px; }
.addmenu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.layout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.layout-item { border: 0; background: none; padding: 6px; border-radius: 8px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink); }
.layout-thumb { width: 144px; height: 81px; position: relative; overflow: hidden; border-radius: 4px; box-shadow: 0 0 0 1px var(--line); background: #fff; }
.layout-thumb .stage { transform: scale(0.09); }
.kind-ic { width: 34px; height: 34px; border-radius: 9px; background: var(--soft); display: grid; place-items: center; font-size: 17px; flex: none; font-weight: 700; }
.thumb { position: relative; display: grid; grid-template-columns: 18px 1fr; gap: 4px; padding: 6px 10px 6px 6px; cursor: pointer; }
.thumb-num { font-size: 12px; color: var(--muted); font-weight: 600; text-align: right; padding-top: 2px; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.thumb-live { color: var(--danger); font-size: 9px; }
.thumb-stage { width: 176px; height: 99px; border-radius: 4px; overflow: hidden; position: relative; box-shadow: 0 0 0 1px var(--line); background: #fff; }
.thumb-stage .stage { transform: scale(0.11); box-shadow: none; }
.thumb.on .thumb-stage { box-shadow: 0 0 0 3px var(--accent); }
.thumb.dropover { box-shadow: inset 0 3px 0 var(--accent); }
.thumb.dropafter { box-shadow: inset 0 -3px 0 var(--accent); }
.thumb.sel .thumb-stage { box-shadow: 0 0 0 3px var(--accent); }
.thumb.sel { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.thumb.sel.on .thumb-stage { box-shadow: 0 0 0 3px var(--accent), 0 0 0 6px color-mix(in srgb, var(--accent) 30%, transparent); }
.slist:focus { outline: none; }
.slist:focus-visible .thumb.on .thumb-stage { box-shadow: 0 0 0 3px var(--accent), 0 0 0 6px color-mix(in srgb, var(--accent) 30%, transparent); }
.slist-sel { display: flex; flex-wrap: wrap; align-items: center; gap: 0 2px; margin: 0 8px 6px; padding: 5px 6px; background: var(--accent); color: #fff; border-radius: 9px; position: sticky; top: 0; z-index: 3; }
.slist-sel-n { font-size: 12.5px; font-weight: 700; white-space: nowrap; flex-basis: 100%; padding: 1px 4px 3px; }
.slist-sel .grow { display: none; }
.slist-sel .tbtn { color: #fff; width: 26px; height: 26px; }
.slist-sel .tbtn:hover { background: rgba(255, 255, 255, 0.2); }
.thumb-tools { position: absolute; right: 14px; bottom: 10px; display: none; gap: 2px; background: rgba(255, 255, 255, 0.95); border-radius: 7px; padding: 2px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15); }
.thumb:hover .thumb-tools { display: flex; }
.thumb-tools button { border: 0; background: none; width: 24px; height: 24px; border-radius: 5px; cursor: pointer; display: grid; place-items: center; }
.thumb-tools button:hover { background: var(--soft); }
.thumb-who { position: absolute; top: 10px; right: 14px; display: flex; }
.thumb-who .avatar + .avatar { margin-left: -5px; }
.sedit { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; background: #e9ebf0; }
.ribbon { background: #fff; border-bottom: 1px solid var(--line); flex: none; position: relative; z-index: 5; }
.rtabs { display: flex; align-items: center; gap: 2px; padding: 4px 10px 0; }
.rtab { border: 0; background: none; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.rtab.on { color: var(--accent); border-bottom-color: var(--accent); }
.rtabs .btn { margin-left: 6px; margin-bottom: 3px; }
.rbody { display: flex; align-items: stretch; gap: 0; padding: 6px 6px 2px; overflow-x: auto; border-top: 1px solid var(--line); min-height: 74px; }
.rgroup { display: flex; flex-direction: column; justify-content: space-between; padding: 0 10px; border-right: 1px solid var(--line); flex: none; }
.rgroup:last-child { border-right: 0; }
.rgroup-row { display: flex; align-items: center; gap: 2px; flex: 1; }
.rgroup-label { font-size: 11px; color: var(--muted); text-align: center; padding: 3px 0 2px; }
.rbtn { min-width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 0; background: none; border-radius: 6px; cursor: pointer; color: var(--ink); padding: 0 6px; font-size: 13px; }
.rbtn:hover:not(:disabled) { background: var(--soft); }
.rbtn.on { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px rgba(109, 94, 252, 0.35); }
.rbtn:disabled { opacity: 0.35; cursor: default; }
.rbtn.wide { padding: 0 9px; font-weight: 600; }
.rtxt { font-size: 15px; font-weight: 700; line-height: 1; }
.rsep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.rsel { font: inherit; font-size: 13px; padding: 5px 6px; border: 1px solid var(--line); border-radius: 6px; background: #fff; height: 30px; margin-right: 2px; max-width: 128px; }
.rsel.small { width: 68px; }
.rsel:disabled { opacity: 0.45; }
.colorbtn { flex-direction: column; gap: 1px; padding: 2px 6px; }
.colorbar { width: 20px; height: 5px; border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18); }
.colorpop { position: absolute; top: 110%; left: 0; z-index: 60; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 8px; width: 186px; }
.colorpop-auto { width: 100%; border: 0; background: var(--soft); border-radius: 6px; padding: 6px; cursor: pointer; font-size: 12px; margin-bottom: 8px; }
.swatches.wrap { flex-wrap: wrap; gap: 6px; }
.scanvas-host { flex: 1; min-height: 0; position: relative; }
.scv { position: absolute; inset: 0; overflow: hidden; outline: none; user-select: none; -webkit-user-select: none; touch-action: none; }
.scv-stage { position: absolute; left: 0; top: 0; width: 1600px; height: 900px; transform-origin: 0 0; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08), 0 24px 60px -20px rgba(0, 0, 0, 0.3); --ink: #111827; --sub: #4b5563; --inv: 1; }
.scv-stage.theme-dark { --ink: #f8fafc; --sub: #cbd5e1; }
.scv-stage.theme-accent { --ink: #fff; --sub: rgba(255, 255, 255, 0.85); }
.scv-base { position: absolute; inset: 0; pointer-events: none; }
.scv-base > .slide { position: absolute; inset: 0; }
.scv-els { position: absolute; inset: 0; }
.scv-sel, .scv-guides { position: absolute; inset: 0; pointer-events: none; z-index: 100000; }
.scv-sel .sbox { position: absolute; outline: calc(1.5px * var(--inv)) solid #4f46e5; outline-offset: 0; border-radius: 0; box-shadow: 0 0 0 calc(2.5px * var(--inv)) rgba(255, 255, 255, 0.55); }
.scv-sel .sbox.editing { outline-style: dashed; }
.sh { position: absolute; width: calc(11px * var(--inv)); height: calc(11px * var(--inv)); background: #fff; border: calc(1.5px * var(--inv)) solid #4f46e5; border-radius: 50%; transform: translate(-50%, -50%); pointer-events: auto; }
.sh.nw { left: 0; top: 0; cursor: nwse-resize; } .sh.n { left: 50%; top: 0; cursor: ns-resize; } .sh.ne { left: 100%; top: 0; cursor: nesw-resize; }
.sh.e { left: 100%; top: 50%; cursor: ew-resize; } .sh.se { left: 100%; top: 100%; cursor: nwse-resize; } .sh.s { left: 50%; top: 100%; cursor: ns-resize; }
.sh.sw { left: 0; top: 100%; cursor: nesw-resize; } .sh.w { left: 0; top: 50%; cursor: ew-resize; }
.sh.pt { cursor: move; }
.sguide { position: absolute; background: #ef4444; }
.sguide.v { top: 0; bottom: 0; width: calc(1px * var(--inv)); }
.sguide.hz { left: 0; right: 0; height: calc(1px * var(--inv)); }
.scv-marq { position: absolute; border: 1px solid var(--accent); background: rgba(109, 94, 252, 0.08); pointer-events: none; }
.snotes { flex: none; height: 92px; border-top: 1px solid var(--line); background: #fff; }
.snotes-ta { width: 100%; height: 100%; border: 0; resize: none; padding: 10px 16px; font: inherit; font-size: 14px; outline: none; color: var(--ink); background: transparent; }
.sempty { position: absolute; inset: 120px 24px 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); gap: 6px; z-index: 6; }
.sempty h3 { color: var(--ink); margin: 8px 0 0; font-size: 20px; }
.sempty p { max-width: 460px; line-height: 1.5; }
.sempty-ic { width: 72px; height: 72px; border-radius: 20px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.sempty-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.sprops { background: #fff; border-left: 1px solid var(--line); overflow: auto; padding: 0 16px 24px; }
.sprops .pane-head { padding-left: 0; padding-right: 0; }
.img-prev { width: 100%; max-height: 160px; object-fit: contain; background: var(--soft); border-radius: 8px; }

/* slide elements (shared by editor, thumbnails, beamer) */
.sx-layer { position: absolute; inset: 0; }
.slide > .sx-layer { z-index: 2; }
.sx { position: absolute; box-sizing: border-box; }
.sx-shape { position: absolute; inset: 0; box-sizing: border-box; }
.sx-body { position: absolute; inset: 0; display: flex; flex-direction: column; box-sizing: border-box; line-height: 1.2; overflow: visible; }
.sx-text { white-space: pre-wrap; word-break: break-word; }
.sx-text p { margin: 0; }
.sx-text ul, .sx-text ol { margin: 0; padding-left: 1.3em; }
.sx-text li { padding-left: 0.15em; }
.sx-text ul li::marker { color: var(--accent); }
.theme-accent .sx-text ul li::marker, .scv-stage.theme-accent .sx .ql-editor li[data-list="bullet"] > .ql-ui:before { color: currentColor; }
.sx-text.sx-ph { color: #9ca3af; font-weight: 400; }
.sx-text > :is(p, ul, ol) + :is(p, ul, ol), .sx-text li + li, .sx .ql-editor > :is(p, ol) + :is(p, ol), .sx .ql-editor li + li { margin-top: var(--ps, 0px); }
.sx-body.nowrap .sx-text, .sx-body.nowrap .ql-editor { white-space: pre; }
.sx[data-mk="text"] .sx-text li::marker, .sx[data-mk="text"] .ql-editor li[data-list="bullet"] > .ql-ui:before { color: inherit; }
.sx-psvg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sx-psvg path { vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.sx .ql-editor .ql-indent-1:not(.ql-direction-rtl) { padding-left: 1.3em; }
.sx .ql-editor .ql-indent-2:not(.ql-direction-rtl) { padding-left: 2.6em; }
.sx .ql-editor .ql-indent-3:not(.ql-direction-rtl) { padding-left: 3.9em; }
.sx .ql-editor .ql-indent-4:not(.ql-direction-rtl) { padding-left: 5.2em; }
.sx .ql-editor li.ql-indent-1:not(.ql-direction-rtl) { padding-left: 2.6em; }
.sx .ql-editor li.ql-indent-2:not(.ql-direction-rtl) { padding-left: 3.9em; }
.sx .ql-editor li.ql-indent-3:not(.ql-direction-rtl) { padding-left: 5.2em; }
.sx .ql-editor li.ql-indent-4:not(.ql-direction-rtl) { padding-left: 6.5em; }
.sx-image img { width: 100%; height: 100%; display: block; object-fit: fill; pointer-events: none; -webkit-user-drag: none; }
.sx-imgph { width: 100%; height: 100%; border: 3px dashed #c4c9d4; border-radius: 12px; display: grid; place-items: center; color: #9ca3af; font-size: 28px; background: rgba(0, 0, 0, 0.02); }
.sx-svg { overflow: visible; display: block; pointer-events: none; }
.sx-svg path:first-child { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.sx-hit { fill: none; stroke: transparent; stroke-width: 24px; pointer-events: stroke; }
.sx-line { pointer-events: none; }
.scv-els .sx:not(.sx-line) { cursor: move; }
.scv-els .sx.editing { cursor: text; }
.sx .ql-container { font: inherit; height: auto; }
.sx .ql-editor { padding: 0; line-height: inherit; overflow: visible; height: auto; white-space: pre-wrap; outline: none; cursor: text; user-select: text; -webkit-user-select: text; }
.sx .ql-editor p { margin: 0; }
.sx .ql-editor ol { padding-left: 0; margin: 0; }
.sx .ql-editor li { padding-left: 1.3em; }
.sx .ql-editor li > .ql-ui:before { margin-left: -1.3em; margin-right: 0.3em; width: 1em; text-align: left; }
.sx .ql-editor li[data-list="bullet"] > .ql-ui:before { color: var(--accent); }
.sx .ql-editor.ql-blank::before { left: 0; right: 0; color: #9ca3af; font-style: normal; font-weight: 400; }

.fullprev { position: fixed; inset: 0; background: #000; z-index: 3000; }
.fullprev-stage { position: absolute; inset: 0 0 56px 0; }
.fullprev-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 56px; display: flex; align-items: center; justify-content: center; gap: 12px; color: #fff; }
.fullprev-bar .tbtn { color: #fff; }
.fullprev-bar .tbtn:hover { background: rgba(255, 255, 255, 0.12); }

/* ----- stage + slides (1600x900 logical) ----- */
.stage-host { position: relative; overflow: hidden; }
.stage { position: absolute; left: 0; top: 0; width: 1600px; height: 900px; transform-origin: 0 0; }
.slide { --ink: #111827; --sub: #4b5563; --surface: rgba(17, 24, 39, 0.06); width: 1600px; height: 900px; padding: 90px 110px 70px; display: flex; flex-direction: column; background: #fff; color: var(--ink); position: relative; overflow: hidden; font-family: var(--font); }
.slide.theme-dark { --ink: #f8fafc; --sub: #cbd5e1; --surface: rgba(255, 255, 255, 0.08); background: #0f172a; }
.slide.theme-accent { --ink: #fff; --sub: rgba(255, 255, 255, 0.85); --surface: rgba(255, 255, 255, 0.16); background: var(--accent); }
.slide.theme-light::after { content: ""; position: absolute; right: -180px; top: -180px; width: 420px; height: 420px; border-radius: 50%; background: var(--accent); opacity: 0.08; }
.slide.theme-dark::after { content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 10px; background: var(--accent); }
.s-center { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.s-big { font-size: 124px; line-height: 1.02; letter-spacing: -0.03em; margin: 0; font-weight: 800; white-space: pre-wrap; }
.theme-light .s-big::before, .theme-dark .s-big::before { content: ""; display: block; width: 120px; height: 14px; border-radius: 7px; background: var(--accent); margin-bottom: 48px; }
.theme-accent .s-big::before { content: ""; display: block; width: 120px; height: 14px; border-radius: 7px; background: #fff; margin-bottom: 48px; }
.s-sub { font-size: 46px; color: var(--sub); margin-top: 32px; }
.s-sub .rich p { margin: 0; }
.s-title { font-size: 70px; line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 44px; font-weight: 780; white-space: pre-wrap; position: relative; z-index: 1; }
.s-kicker { font-size: 28px; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 800; color: var(--accent); margin-bottom: 18px; }
.theme-accent .s-kicker { color: rgba(255, 255, 255, 0.8); }
.s-body { font-size: 44px; line-height: 1.4; color: var(--ink); flex: 1; min-height: 0; overflow: hidden; }
.rich p { margin: 0 0 0.5em; }
.rich ul, .rich ol { margin: 0 0 0.5em; padding-left: 1.3em; }
.rich li { margin-bottom: 0.35em; padding-left: 0.2em; }
.rich ul li::marker { color: var(--accent); }
.theme-accent .rich ul li::marker { color: #fff; }
.rich code { font-family: ui-monospace, Menlo, monospace; background: var(--surface); padding: 0.05em 0.3em; border-radius: 0.2em; font-size: 0.9em; }
.s-imgwrap { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.s-imgwrap.full { margin: -40px -60px; }
.s-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 18px; }
.s-img-empty { width: 100%; height: 100%; border: 4px dashed var(--surface); border-radius: 24px; display: grid; place-items: center; font-size: 36px; color: var(--sub); }
.s-caption { font-size: 32px; color: var(--sub); text-align: center; margin-top: 24px; }
.slide.kind-page { padding: 0; background: #000; align-items: center; justify-content: center; }
.slide.kind-page::after, .slide.imported::after { display: none; }
.s-page { width: 100%; height: 100%; object-fit: contain; display: block; }
.import-box { display: flex; flex-direction: column; gap: 12px; }
.import-bar { height: 8px; border-radius: 4px; background: var(--soft); overflow: hidden; }
.import-bar > div { height: 100%; width: 0; background: var(--accent); transition: width 0.3s; }
.import-hint { font-size: 13px; line-height: 1.45; }
.import-opts { display: flex; flex-direction: column; gap: 10px; }
.import-opts > p { margin: 0 0 4px; font-size: 13px; word-break: break-all; }
.import-opt { display: flex; gap: 14px; align-items: flex-start; text-align: left; width: 100%; min-width: 0; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; font: inherit; color: inherit; }
.import-opt:hover { border-color: var(--accent); background: var(--soft); }
.import-opt.rec { border-color: var(--accent); }
.import-opt b { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.import-opt small { display: block; color: var(--muted); font-size: 13px; line-height: 1.45; margin-top: 3px; }
.import-opt .pill { font-size: 11px; padding: 2px 8px; background: var(--accent); color: #fff; }
.import-opt-ic { width: 40px; height: 40px; border-radius: 10px; background: var(--soft); display: grid; place-items: center; flex: none; color: var(--accent); }
.addmenu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.s-split { display: grid; grid-template-columns: 1fr 1fr; gap: 70px; flex: 1; min-height: 0; }
.s-split > div:first-child { display: flex; flex-direction: column; min-height: 0; }
.s-split .s-body { font-size: 38px; }
.s-board { flex: 1; min-height: 0; border-radius: 20px; background: #f5f6f8; position: relative; overflow: hidden; }
.s-board.full { margin: -50px -70px -30px; }
.board-static { position: absolute; inset: 0; overflow: hidden; }
.board-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.board-empty { position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; color: #94a3b8; }
.s-opts { display: grid; gap: 22px; }
.opt { position: relative; height: 104px; border-radius: 20px; background: var(--surface); overflow: hidden; display: flex; align-items: center; gap: 28px; padding: 0 36px 0 22px; font-size: 42px; font-weight: 600; }
.s-opts.n5 .opt, .s-opts.n6 .opt { height: 80px; font-size: 34px; }
.s-opts.n7 .opt, .s-opts.n8 .opt { height: 62px; font-size: 28px; }
.s-opts.n5, .s-opts.n6, .s-opts.n7, .s-opts.n8 { gap: 14px; }
.opt-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--accent); opacity: 0.28; transition: width 0.7s cubic-bezier(0.2, 0.8, 0.2, 1); }
.theme-accent .opt-fill { background: #fff; opacity: 0.3; }
.slide .opt-letter { position: relative; width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 32px; flex: none; }
.theme-accent .slide .opt-letter, .theme-accent .opt-letter { background: #fff; color: var(--accent); }
.s-opts.n7 .opt-letter, .s-opts.n8 .opt-letter { width: 46px; height: 46px; font-size: 24px; }
.opt-label { position: relative; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opt-count { position: relative; font-weight: 800; font-variant-numeric: tabular-nums; }
.slide.revealed .opt:not(.correct) { opacity: 0.45; }
.opt.correct { box-shadow: inset 0 0 0 5px #10b981; }
.opt.correct .opt-letter { background: #10b981; color: #fff; }
.opt.correct .opt-fill { background: #10b981; }
.s-foot { margin-top: auto; padding-top: 24px; display: flex; justify-content: space-between; font-size: 28px; color: var(--sub); font-weight: 600; }
.s-cloud { flex: 1; min-height: 0; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; align-items: center; gap: 6px 40px; overflow: hidden; }
.s-cloud[data-empty]::before { content: attr(data-empty); font-size: 36px; color: var(--sub); }
.s-cloud .w { font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; animation: pop 0.4s ease; color: var(--accent); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.s-cloud .w[data-c="1"] { color: #0ea5e9; }
.s-cloud .w[data-c="2"] { color: #f59e0b; }
.s-cloud .w[data-c="3"] { color: #10b981; }
.s-cloud .w[data-c="4"] { color: #ef4444; }
.s-cloud .w[data-c="5"] { color: #d946ef; }
.theme-accent .s-cloud .w { color: #fff !important; }
.theme-accent .s-cloud .w:nth-child(even) { opacity: 0.75; }
@keyframes pop { from { transform: scale(0.3); opacity: 0; } }
.slide.enter { animation: enter 0.45s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes enter { from { opacity: 0; transform: translateY(24px); } }

/* ----- live: audience + presenter (student devices) ----- */
.livebanner { position: fixed; top: 66px; left: 50%; transform: translateX(-50%); z-index: 900; background: #111827; color: #fff; padding: 7px 8px 7px 14px; border-radius: 999px; display: flex; gap: 10px; align-items: center; font-size: 14px; box-shadow: var(--shadow); white-space: nowrap; }
.livebanner .muted { color: #9ca3af; }
.livebanner .btn { margin-left: 4px; }
.votesheet { position: fixed; inset: 0; z-index: 950; background: rgba(15, 23, 42, 0.5); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade 0.2s; }
.vs-card { background: #fff; border-radius: 20px; width: min(560px, 100%); padding: 20px; box-shadow: var(--shadow); animation: up 0.25s ease; max-height: 100%; overflow: auto; }
.vs-head { display: flex; align-items: center; gap: 10px; }
.vs-head .tbtn { margin-left: auto; }
.vs-team { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; }
.vs-team::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.vs-kind { color: var(--muted); font-size: 13px; }
.vs-q { font-size: 22px; font-weight: 750; margin: 14px 0 18px; line-height: 1.25; white-space: pre-wrap; }
.vs-opts { display: flex; flex-direction: column; gap: 10px; }
.vs-opt { display: flex; align-items: center; gap: 12px; padding: 14px; border: 2px solid var(--line); border-radius: 14px; background: #fff; font-size: 17px; text-align: left; cursor: pointer; font-weight: 600; transition: border-color 0.15s, background 0.15s; }
.vs-opt:hover:not(:disabled) { border-color: #c7c2ff; }
.vs-opt > span:nth-child(2) { flex: 1; }
.vs-opt .opt-letter { width: 32px; height: 32px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; font-weight: 800; flex: none; }
.vs-opt.mine { border-color: var(--accent); background: var(--accent-soft); }
.vs-opt.mine .opt-letter { background: var(--accent); color: #fff; }
.vs-opt.correct { border-color: var(--ok); background: #ecfdf5; }
.vs-opt.correct .opt-letter { background: var(--ok); color: #fff; }
.vs-opt.wrong { border-color: var(--danger); background: #fef2f2; }
.vs-opt:disabled { cursor: default; }
.vs-result { font-size: 22px; font-weight: 800; text-align: center; padding: 8px; }
.vs-result.ok { color: #047857; }
.vs-result.no { color: #b91c1c; }
.vs-words .row { flex-wrap: nowrap; }
.vs-mine { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; }
.pbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; background: #0f172a; color: #fff; padding: 14px 16px; box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.2); --pv-h: min(clamp(200px, 36vh, 440px), calc(58vw * 9 / 16)); }
.pbar.small { --pv-h: 144px; }
.pbar-in { display: grid; grid-template-columns: calc(var(--pv-h) * 16 / 9) minmax(0, 1fr); gap: 20px; height: var(--pv-h); max-width: 1640px; margin: 0 auto; position: relative; }
.pbar-live { position: absolute; top: -42px; left: 0; background: #ef4444; color: #fff; padding: 5px 12px; border-radius: 8px 8px 0 0; font-size: 13px; font-weight: 700; display: flex; gap: 8px; align-items: center; }
.pbar-live .live-dot { background: #fff; }
.pbar-stage { width: calc(var(--pv-h) * 16 / 9); height: var(--pv-h); border-radius: 10px; box-shadow: 0 0 0 1px #334155; }
.pbar-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 0; }
.pbar-notes { font-size: 16px; flex: 1; min-height: 0; overflow: auto; white-space: pre-wrap; color: #e2e8f0; line-height: 1.45; }
.pbar.small .pbar-notes { font-size: 14px; }
.pbar-notes.muted { color: #64748b; }
.pbar-res { font-size: 13px; color: #a5b4fc; font-weight: 600; }
.pbar-ctrl { display: flex; gap: 8px; align-items: center; margin-top: auto; flex-wrap: wrap; }
.pbar-count { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 54px; text-align: center; }
.pbar .btn { background: #1e293b; color: #fff; border-color: #334155; }
.pbar .btn.primary { background: var(--accent); border-color: var(--accent); }
.pbar .btn.danger { background: var(--danger); border-color: var(--danger); }
.pbar .btn.accent { background: var(--warn); border-color: var(--warn); }

/* ----- teacher ----- */
.teacher { min-height: 100%; display: flex; flex-direction: column; }
.teacher .topbar { position: sticky; top: 0; }
.tgrid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; padding: 20px; max-width: 1440px; margin: 0 auto; width: 100%; align-items: start; }
.tcol { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.qr { background: #fff; border-radius: 12px; }
.qr svg { width: 100%; max-width: 240px; height: auto; display: block; margin: 0 auto; }
.status { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 12px 0 10px; font-weight: 600; }
.status .dot { width: 8px; height: 8px; border-radius: 50%; }
.status.ok .dot { background: var(--ok); }
.status.warn .dot { background: var(--warn); }
.copyrow { display: flex; gap: 8px; }
.pinrow { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.pin { font-size: 34px; letter-spacing: 0.14em; font-variant-numeric: tabular-nums; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-head h3 { margin: 0; }
.live-stage { aspect-ratio: 16 / 9; width: 100%; border-radius: 10px; margin: 12px 0; background: #e5e7eb; }
.live-who { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.queue { display: flex; flex-direction: column; }
.qrow { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.qrow:first-child { border-top: 0; }
.tcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.tcard { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; border-top: 4px solid var(--c); background: #fff; }
.tcard.islive { box-shadow: 0 0 0 2px #ef4444; }
.tcard-head { display: flex; align-items: center; gap: 8px; }
.tcard-head .chip { gap: 3px; }
.chip.full { background: #fee2e2; color: #b91c1c; }
.tempty { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.row.nowrap { flex-wrap: nowrap; align-items: flex-end; }
.row.nowrap .field { margin: 10px 0 6px; }
.row.nowrap .field:first-child { width: 120px; flex: none; }
.modal .seg.full { margin-bottom: 4px; }
.tcard-members { display: flex; flex-wrap: wrap; min-height: 22px; }
.tcard-actions { display: flex; gap: 6px; align-items: center; margin-top: auto; }
.tcard-actions .tbtn { margin-left: auto; }
.tcard-actions .tbtn + .tbtn { margin-left: 0; }
.member { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; margin: 0 10px 6px 0; }
.member.off { opacity: 0.45; }
.member .x { border: 0; background: none; color: var(--muted); cursor: pointer; visibility: hidden; padding: 0 2px; font-size: 15px; }
.member:hover .x { visibility: visible; }
.loose { display: flex; flex-wrap: wrap; gap: 4px 0; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.loose > .muted { margin-right: 10px; margin-bottom: 6px; }

/* ----- beamer ----- */
body.beamer { background: #0b1020; color: #fff; overflow: hidden; }
.bm-idle { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6vh; padding: 5vh 6vw; background: radial-gradient(circle at 15% 15%, rgba(109, 94, 252, 0.35), transparent 45%), radial-gradient(circle at 85% 85%, rgba(14, 165, 233, 0.25), transparent 45%), #0b1020; }
.bm-join { display: flex; align-items: center; gap: 7vw; }
.logo.xl { font-size: 8vh; color: #fff; gap: 2vh; }
.logo.xl svg { width: 9vh; height: 9vh; }
.bm-lead { font-size: 3vh; opacity: 0.7; margin: 4vh 0 1vh; }
.bm-url { font-size: 4vh; font-weight: 700; font-family: ui-monospace, Menlo, monospace; word-break: break-all; max-width: 46vw; }
.bm-pin { margin-top: 4vh; display: flex; align-items: baseline; gap: 2vh; font-size: 3vh; opacity: 0.95; }
.bm-pin span { opacity: 0.7; }
.bm-pin b { font-size: 10vh; letter-spacing: 0.16em; font-variant-numeric: tabular-nums; }
.bm-qr { background: #fff; padding: 2.2vh; border-radius: 2.4vh; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4); }
.bm-qr svg { width: 44vh; height: 44vh; display: block; }
.bm-teams { display: flex; flex-wrap: wrap; gap: 1.6vh; justify-content: center; max-width: 92vw; }
.bm-team { background: rgba(255, 255, 255, 0.07); border-left: 0.6vh solid var(--c); padding: 1.2vh 2vh; border-radius: 1.2vh; font-size: 2.3vh; display: flex; flex-direction: column; gap: 0.8vh; min-width: 14vw; }
.bm-members { display: flex; flex-wrap: wrap; gap: 0.4vh; }
.bm-members .avatar { border-color: transparent; }
.bm-hint { font-size: 2.6vh; opacity: 0.6; }
.bm-msg { font-size: 3vh; opacity: 0.8; }
.bm-live { position: fixed; inset: 0; background: #000; }
.bm-stage { position: absolute; inset: 0; }
.bm-foot { position: absolute; left: 1.6vh; bottom: 1.6vh; display: flex; gap: 1.2vh; align-items: center; background: rgba(15, 23, 42, 0.7); color: #fff; padding: 0.7vh 1.6vh; border-radius: 1vh; font-size: 1.8vh; backdrop-filter: blur(6px); }
.bm-fs { position: fixed; right: 2vh; top: 2vh; z-index: 10; background: rgba(255, 255, 255, 0.12); color: #fff; border: 0; width: 44px; height: 44px; border-radius: 10px; cursor: pointer; display: grid; place-items: center; transition: opacity 0.3s; }
body.idle-mouse .bm-fs { opacity: 0; }
body.idle-mouse { cursor: none; }

/* ----- small screens ----- */
@media (max-width: 1100px) {
  .slides-ed { grid-template-columns: 170px minmax(0, 1fr); }
  .slides-ed.has-props { grid-template-columns: 170px minmax(0, 1fr) 260px; }
  .thumb-stage { width: 128px; height: 72px; }
  .thumb-stage .stage { transform: scale(0.08); }
  .tgrid { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  .topbar { gap: 8px; padding: 0 10px; }
  .topbar .logo > span:not(.ic), .tab > span:not(.ic), .people, .presentwrap .lbl, .topbar .badge { display: none; }
  .tab { padding: 6px 10px; }
  .presentwrap .btn { padding: 6px 10px; }
  .presentwrap .pill.live { font-size: 0; gap: 0; padding: 8px; }
  .teamchip { max-width: 120px; }
  .tabs { margin-left: 0; }
  .slides-ed, .slides-ed.has-props { grid-template-columns: 1fr; grid-template-rows: auto auto auto; overflow: auto; align-content: start; }
  .sedit { min-height: 0; }
  .scanvas-host { flex: none; height: 60vw; }
  .snotes { height: 70px; }
  .sempty { position: static; padding: 16px 0; }
  .addmenu { position: fixed; left: 12px; right: 12px; top: 110px; width: auto; }
  .slist { border-right: 0; border-bottom: 1px solid var(--line); }
  .slist-items { display: flex; overflow-x: auto; padding-bottom: 6px; }
  .thumb { grid-template-columns: 1fr; }
  .thumb-num { display: none; }
  .sprops { border-left: 0; }
  .btools { top: auto; bottom: 14px; left: 50%; transform: translateX(-50%); flex-direction: row; max-width: calc(100% - 20px); overflow-x: auto; }
  .bzoom { bottom: 70px; }
  .notes .ql-editor { padding: 20px 18px 60px; }
  .notes .ql-editor.ql-blank::before { left: 18px; }
  .pbar { padding: 10px 12px; --pv-h: min(30vh, calc((100vw - 24px) * 9 / 16)); }
  .pbar.small { --pv-h: 0px; }
  .pbar-in { grid-template-columns: 1fr; grid-template-rows: auto auto; height: auto; gap: 10px; }
  .pbar-stage { justify-self: center; }
  .pbar.small .pbar-stage { display: none; }
  .pbar-notes { max-height: 72px; font-size: 14px; }
  .livebanner { top: auto; bottom: 16px; font-size: 13px; max-width: calc(100% - 24px); }
  .livebanner > span:nth-child(4) { display: none; }
  .vs-card { align-self: flex-end; }
}
