/* ================================================================
   LIVE CLASS — teacher panel, student-work gallery + viewer,
   student live pill / write lock (js/tools/LiveClassManager.js)
   ================================================================ */

.lc-panel, .lc-student-pill, .lc-join-banner {
    --lc-bg: #ffffff;
    --lc-fg: #0f172a;
    --lc-muted: #64748b;
    --lc-line: #e2e8f0;
    --lc-soft: #f1f5f9;
    --lc-accent: #4f46e5;
    --lc-live: #ef4444;
    --lc-ok: #10b981;
    font-family: 'Outfit', 'Inter', 'Cairo', sans-serif;
    color: var(--lc-fg);
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}
.lc-panel * { box-sizing: border-box; }
.lc-panel button, .lc-join-banner button {
    font: inherit;
    touch-action: manipulation;
    cursor: pointer;
}

/* ---------- shared bits ---------- */
.lc-dot {
    width: 10px; height: 10px; flex: none;
    border-radius: 50%;
    background: var(--lc-live, #ef4444);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
    animation: lc-pulse 1.6s infinite;
}
@keyframes lc-pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55); }
    70% { box-shadow: 0 0 0 9px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
.lc-icon-btn {
    width: 44px; height: 44px; flex: none;
    display: inline-grid; place-items: center;
    border: none; border-radius: 14px;
    background: var(--lc-soft); color: var(--lc-fg);
    font-size: 1rem;
    transition: background 0.15s, transform 0.12s;
}
.lc-icon-btn:hover { background: var(--lc-line); }
.lc-icon-btn:active { transform: scale(0.94); }
.lc-icon-btn:disabled { opacity: 0.35; cursor: default; }
.lc-btn {
    min-height: 48px; padding: 0 18px;
    border: none; border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-weight: 700; font-size: 0.95rem;
    transition: background 0.15s, transform 0.12s;
}
.lc-btn:active { transform: scale(0.97); }
.lc-btn--primary { background: var(--lc-accent); color: #fff; }
.lc-btn--danger { background: #fef2f2; color: #dc2626; }
.lc-btn--danger:hover { background: #fee2e2; }
.lc-panel :focus-visible, .lc-dock :focus-visible { outline: 3px solid rgba(79, 70, 229, 0.5); outline-offset: 2px; }

.lc-av {
    --h: 262;
    width: 40px; height: 40px; flex: none;
    border-radius: 50%;
    display: inline-grid; place-items: center;
    font-weight: 800; font-size: 0.82rem; letter-spacing: 0.02em;
    color: hsl(var(--h) 60% 28%);
    background: hsl(var(--h) 85% 92%);
    border: 2px solid #fff;
    position: relative;
    padding: 0;
}
.lc-av::after {
    content: ''; position: absolute; right: -1px; bottom: -1px;
    width: 11px; height: 11px; border-radius: 50%;
    background: #cbd5e1; border: 2px solid #fff;
}
.lc-av.is-on::after { background: var(--lc-ok, #10b981); }
.lc-av.is-writing { box-shadow: 0 0 0 3px hsl(var(--h) 80% 60%); animation: lc-ink 1s ease-in-out infinite alternate; }
@keyframes lc-ink { to { box-shadow: 0 0 0 5px hsl(var(--h) 80% 70% / 0.5); } }
.lc-av--sm { width: 30px; height: 30px; font-size: 0.68rem; }
.lc-av--sm::after { width: 9px; height: 9px; }

/* ---------- top-bar Live button ---------- */
#btn-live-class { position: relative; }
#btn-live-class.lc-hidden { display: none !important; }
#btn-live-class i { color: #ef4444; }
#btn-live-class.is-live { background: #ef4444 !important; }
#btn-live-class.is-live i { color: #fff; animation: lc-blink 1.6s infinite; }
@keyframes lc-blink { 50% { opacity: 0.55; } }
.lc-live-badge {
    position: absolute; top: -6px; right: -6px;
    min-width: 20px; height: 20px; padding: 0 5px;
    border-radius: 999px;
    background: #fff; color: #ef4444;
    font: 800 0.66rem/20px 'Outfit', 'Inter', sans-serif;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    text-align: center;
}

/* ---------- teacher panel ---------- */
.lc-panel {
    position: fixed;
    right: 16px;
    bottom: calc(230px + env(safe-area-inset-bottom));
    z-index: 2147483000;
    width: 340px;
    max-width: calc(100% - 32px);
    max-height: calc(var(--app-vh, 100vh) - 180px);
    overflow-y: auto;
    padding: 14px;
    border-radius: 24px;
    background: var(--lc-bg);
    border: 1px solid var(--lc-line);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
    display: flex; flex-direction: column; gap: 12px;
    transform: translateY(16px) scale(0.98);
    opacity: 0;
    transition: transform 0.25s cubic-bezier(0.34, 1.3, 0.64, 1), opacity 0.2s;
}
.lc-panel.show { transform: none; opacity: 1; }
.lc-head { display: flex; align-items: center; gap: 10px; padding: 2px 2px 0 6px; }
.lc-head b { font-size: 0.85rem; letter-spacing: 0.12em; color: var(--lc-live); }
.lc-clock { font-variant-numeric: tabular-nums; color: var(--lc-muted, #64748b); font-weight: 600; font-size: 0.9rem; flex: 1; }

.lc-toggles { display: flex; flex-direction: column; gap: 8px; }
.lc-toggle {
    display: flex; align-items: center; gap: 12px;
    width: 100%; min-height: 60px; padding: 8px 12px;
    border: 1px solid var(--lc-line); border-radius: 16px;
    background: var(--lc-bg); color: var(--lc-fg); text-align: start;
    transition: border-color 0.15s, background 0.15s;
}
.lc-toggle.is-on { border-color: rgba(79, 70, 229, 0.35); background: #eef2ff; }
.lc-toggle-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--lc-soft); color: var(--lc-muted); flex: none; }
.lc-toggle.is-on .lc-toggle-ic { background: var(--lc-accent); color: #fff; }
.lc-toggle-txt { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.lc-toggle-txt b { font-size: 0.92rem; }
.lc-toggle-txt small { font-size: 0.75rem; color: var(--lc-muted); line-height: 1.3; }
.lc-switch { width: 50px; height: 30px; border-radius: 999px; background: #cbd5e1; position: relative; flex: none; transition: background 0.2s; }
.lc-switch span { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); transition: transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1); }
.lc-toggle.is-on .lc-switch { background: var(--lc-accent); }
.lc-toggle.is-on .lc-switch span { transform: translateX(20px); }
[dir="rtl"] .lc-toggle.is-on .lc-switch span { transform: translateX(-20px); }

.lc-roster-head { display: flex; justify-content: space-between; align-items: center; font-size: 0.82rem; font-weight: 700; color: var(--lc-muted); margin-bottom: 8px; }
.lc-roster-head i { margin-inline-end: 4px; }
.lc-avatars { display: flex; flex-wrap: wrap; gap: 6px; max-height: 140px; overflow-y: auto; padding: 4px 2px; }
.lc-avatars .lc-av { width: 44px; height: 44px; cursor: pointer; }
.lc-empty-sm { font-size: 0.82rem; color: var(--lc-muted); padding: 6px 0; }

.lc-code { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 14px; border-radius: 14px; background: var(--lc-soft); font-size: 0.8rem; color: var(--lc-muted); }
.lc-code b { flex: 1; font-size: 1.05rem; letter-spacing: 0.25em; color: var(--lc-fg); font-variant-numeric: tabular-nums; }
.lc-code .lc-icon-btn { background: #fff; width: 40px; height: 40px; }
.lc-end { width: 100%; }

/* ---------- student dock (teacher board, GoodNotes-style) — one slim row ---------- */
.lc-dock {
    --lc-fg: #0f172a; --lc-muted: #64748b; --lc-line: rgba(15, 23, 42, 0.08); --lc-soft: rgba(15, 23, 42, 0.05);
    --lc-accent: #4f46e5; --lc-live: #ef4444; --lc-ok: #10b981;
    position: fixed;
    left: 50%;
    bottom: calc(82px + env(safe-area-inset-bottom));
    z-index: 2147482900;
    display: flex; align-items: center; gap: 6px;
    width: max-content;
    max-width: min(900px, calc(100% - 20px));
    height: 60px;
    padding: 0 6px 0 8px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.86);
    -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 10px 34px rgba(15, 23, 42, 0.16), 0 0 0 1px var(--lc-line);
    font-family: 'Outfit', 'Inter', 'Cairo', sans-serif;
    color: var(--lc-fg);
    transform: translate(-50%, 18px) scale(0.98); opacity: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.3, 0.64, 1), opacity 0.2s, box-shadow 0.25s;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}
.lc-dock *, .lc-dock *::before, .lc-dock *::after { box-sizing: border-box; }
.lc-dock.show { transform: translate(-50%, 0) scale(1); opacity: 1; }
.lc-dock.is-viewing { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 10px 34px rgba(79, 70, 229, 0.22), 0 0 0 2px rgba(79, 70, 229, 0.55); }
.lc-dock button { font: inherit; cursor: pointer; touch-action: manipulation; }

/* left */
.lc-dock-lead { display: flex; align-items: center; gap: 8px; flex: none; min-width: 0; max-width: 220px; padding-inline-end: 8px; border-inline-end: 1px solid var(--lc-line); height: 40px; }
.lc-dock-lead.lc-swap { animation: lc-swap 0.28s ease; }
@keyframes lc-swap { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.lc-live-chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; border-radius: 999px; background: rgba(239, 68, 68, 0.1); color: var(--lc-live); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.1em; }
.lc-live-chip .lc-dot { width: 7px; height: 7px; }
.lc-live-chip .lc-clock { color: var(--lc-live); opacity: 0.75; font-weight: 700; letter-spacing: 0; font-size: 0.72rem; flex: none; }
.lc-lead-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.lc-lead-txt b { font-size: 0.86rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-lead-txt small { font-size: 0.7rem; color: var(--lc-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-dock.is-viewing .lc-lead-txt small { color: var(--lc-accent); font-weight: 600; }
.lc-on-count { color: #059669; }
.lc-of { color: var(--lc-muted); font-weight: 600; }

/* middle */
.lc-dock-mid { display: flex; align-items: center; gap: 2px; flex: 1 1 auto; min-width: 0; }
.lc-dock-arrow {
    width: 26px; height: 40px; flex: none;
    border: none; border-radius: 10px;
    background: transparent; color: var(--lc-muted);
    display: grid; place-items: center; font-size: 0.8rem;
    transition: background 0.15s, color 0.15s;
}
.lc-dock-arrow:hover { background: var(--lc-soft); color: var(--lc-fg); }
.lc-strip {
    flex: 1; min-width: 0;
    display: flex; gap: 2px;
    overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x proximity; scrollbar-width: none;
    padding: 6px 2px;
    -webkit-overflow-scrolling: touch;
    mask-image: linear-gradient(90deg, transparent 0, #000 10px, #000 calc(100% - 10px), transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 10px, #000 calc(100% - 10px), transparent 100%);
}
.lc-strip::-webkit-scrollbar { display: none; }
.lc-strip-empty { display: flex; align-items: center; gap: 7px; height: 40px; padding: 0 10px; color: var(--lc-muted); font-size: 0.78rem; white-space: nowrap; }
.lc-stu {
    position: relative; overflow: visible;
    flex: none; width: 48px;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 2px 0 0;
    border: none; border-radius: 12px; background: transparent; color: var(--lc-fg);
    scroll-snap-align: center;
    will-change: transform;
}
.lc-stu .lc-av { width: 34px; height: 34px; font-size: 0.72rem; border-width: 2px; transition: transform 0.2s cubic-bezier(0.34, 1.6, 0.64, 1), box-shadow 0.25s, filter 0.3s, opacity 0.3s; }
.lc-stu .lc-av::after { width: 9px; height: 9px; right: -2px; bottom: -2px; transition: background 0.3s; }
.lc-stu:hover .lc-av { transform: translateY(-2px); }
.lc-stu:active .lc-av { transform: scale(0.9); }
.lc-stu-name { max-width: 48px; font-size: 0.62rem; font-weight: 700; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.3s; }
.lc-stu.is-cur .lc-av { transform: translateY(-3px) scale(1.06); box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--lc-accent), 0 6px 14px rgba(79, 70, 229, 0.35); }
.lc-stu.is-cur .lc-stu-name { color: var(--lc-accent); }
/* selection underline */
.lc-stu::after { content: ''; position: absolute; left: 50%; bottom: -5px; width: 0; height: 3px; border-radius: 3px; background: var(--lc-accent); transform: translateX(-50%); transition: width 0.25s cubic-bezier(0.2, 0.8, 0.2, 1); }
.lc-stu.is-cur::after { width: 18px; }
/* offline */
.lc-stu.is-away .lc-av { filter: grayscale(1); opacity: 0.5; border-style: dashed; border-color: #cbd5e1; }
.lc-stu.is-away .lc-av::after { background: #cbd5e1; }
.lc-stu.is-away .lc-stu-name { color: #94a3b8; font-weight: 600; }
.lc-stu-off { display: none !important; }
/* little pips */
.lc-work-dot { position: absolute; left: -3px; top: -3px; width: 11px; height: 11px; border-radius: 50%; background: var(--lc-accent); border: 2px solid #fff; display: none; }
.lc-av.has-work .lc-work-dot { display: block; animation: lc-pip 0.35s cubic-bezier(0.34, 1.8, 0.64, 1); }
@keyframes lc-pip { from { transform: scale(0); } to { transform: scale(1); } }
.lc-stu .lc-hand-badge { width: 18px; height: 18px; right: -7px; top: -8px; font-size: 0.6rem; }
.lc-av.has-hand .lc-hand-badge { animation: lc-hand-in 0.45s cubic-bezier(0.34, 1.8, 0.64, 1), lc-wave 1.4s 0.45s ease-in-out infinite; }
@keyframes lc-hand-in { from { transform: scale(0) rotate(-30deg); } to { transform: scale(1); } }
.lc-av.has-hand { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #f59e0b; }

/* motion */
.lc-stu.lc-enter { animation: lc-enter 0.38s cubic-bezier(0.34, 1.5, 0.64, 1); }
@keyframes lc-enter { from { opacity: 0; transform: scale(0.5) translateY(8px); } to { opacity: 1; transform: none; } }
.lc-av.lc-came-online { animation: lc-online 0.8s ease-out; }
@keyframes lc-online { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); transform: scale(0.9); } 40% { transform: scale(1.08); } 100% { box-shadow: 0 0 0 12px rgba(16, 185, 129, 0); transform: scale(1); } }
.lc-av.lc-hand-up { animation: lc-handup 0.7s cubic-bezier(0.34, 1.6, 0.64, 1); }
@keyframes lc-handup { 0% { transform: translateY(0); } 35% { transform: translateY(-6px); } 100% { transform: translateY(0); } }
/* tap ripple */
.lc-stu.lc-tap::before {
    content: ''; position: absolute; left: var(--rx, 50%); top: var(--ry, 50%);
    width: 8px; height: 8px; border-radius: 50%;
    background: rgba(79, 70, 229, 0.35);
    transform: translate(-50%, -50%) scale(0);
    animation: lc-ripple 0.5s ease-out forwards;
    pointer-events: none;
}
@keyframes lc-ripple { to { transform: translate(-50%, -50%) scale(9); opacity: 0; } }

/* right */
.lc-dock-tools { display: flex; align-items: center; gap: 4px; flex: none; padding-inline-start: 6px; border-inline-start: 1px solid var(--lc-line); height: 40px; }
.lc-tool {
    width: 36px; height: 36px;
    border: none; border-radius: 11px;
    background: transparent; color: var(--lc-muted);
    display: grid; place-items: center; font-size: 0.88rem;
    transition: background 0.15s, color 0.15s, transform 0.12s;
}
.lc-tool:hover { background: var(--lc-soft); color: var(--lc-fg); }
.lc-tool:active { transform: scale(0.9); }
.lc-tool--hand { background: #fef3c7; }
.lc-done {
    display: inline-flex; align-items: center; gap: 6px;
    height: 36px; padding: 0 14px;
    border: none; border-radius: 11px;
    background: var(--lc-accent); color: #fff;
    font-weight: 700; font-size: 0.82rem;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
    transition: transform 0.12s, background 0.15s;
}
.lc-done:hover { background: #4338ca; }
.lc-done:active { transform: scale(0.95); }

@media (max-width: 640px) {
    .lc-dock { bottom: calc(74px + env(safe-area-inset-bottom)); height: 56px; padding: 0 4px 0 6px; max-width: calc(100% - 12px); width: calc(100% - 12px); }
    .lc-dock-lead { max-width: 120px; }
    .lc-lead-txt small { display: none; }
    .lc-live-chip .lc-clock { display: none; }
    .lc-dock-arrow { display: none; }
    .lc-done span { display: none; }
    .lc-done { padding: 0 11px; }
}
@media (prefers-reduced-motion: reduce) {
    .lc-stu, .lc-stu .lc-av, .lc-dock-lead, .lc-av.has-hand .lc-hand-badge { animation: none !important; transition: none !important; }
}

/* ---------- student: live pill + write lock ---------- */
.lc-student-pill {
    position: fixed;
    top: calc(64px + env(safe-area-inset-top));
    left: 50%;
    z-index: 2147482000;
    display: flex; align-items: center; gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.88);
    color: #fff;
    font-size: 0.82rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    pointer-events: none;
    transform: translate(-50%, -16px); opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
    white-space: nowrap;
    max-width: calc(100% - 24px);
}
.lc-student-pill.show { transform: translate(-50%, 0); opacity: 1; }
.lc-student-pill b { letter-spacing: 0.06em; color: #fecaca; }
.lc-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); font-weight: 600; }
.lc-chip--off { background: rgba(245, 158, 11, 0.25); color: #fde68a; }
@media (max-width: 520px) { .lc-chip { font-size: 0.72rem; } }

.lc-write-blocker { position: absolute; inset: 0; z-index: 50; cursor: not-allowed; background: transparent; touch-action: none; }
/* while writing is paused, drawing tools look unavailable */
body.lc-write-off #mainToolbar .tool-btn:not(#tool-select):not(#tool-pan):not(.mini) { opacity: 0.4; }

.lc-join-banner {
    position: fixed;
    left: 50%; bottom: calc(18px + env(safe-area-inset-bottom));
    z-index: 2147483300;
    width: min(440px, calc(100% - 32px));
    display: flex; align-items: center; gap: 12px;
    padding: 12px 12px 12px 16px;
    border-radius: 20px;
    background: #0f172a; color: #fff;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    transform: translate(-50%, 140%);
    transition: transform 0.4s cubic-bezier(0.34, 1.3, 0.64, 1);
}
.lc-join-banner.show { transform: translate(-50%, 0); }
.lc-jb-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.lc-jb-text b { font-size: 0.98rem; color: #fff; }
.lc-jb-text small { color: #cbd5e1; font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- phones ---------- */
@media (max-width: 640px) {
    .lc-panel {
        left: 0; right: 0; bottom: 0;
        width: 100%; max-width: none;
        border-radius: 24px 24px 0 0;
        padding-bottom: calc(14px + env(safe-area-inset-bottom));
        max-height: 75vh;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lc-dot, .lc-av.is-writing, #btn-live-class.is-live i { animation: none; }
    .lc-panel, .lc-dock, .lc-join-banner, .lc-student-pill { transition: none; }
}

/* elements toggled with the hidden attribute */
.lc-dock-arrow[hidden], .lc-live-badge[hidden] { display: none !important; }


/* ---------- raise hand ---------- */
/* students see ✋ only while a live class is on */
body.is-student:not(.lc-live-student) #btn-raise-hand { display: none !important; }
#btn-raise-hand.is-raised { background: #f59e0b !important; color: #fff !important; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.35); }
#btn-raise-hand.is-raised i { color: #fff !important; animation: lc-wave 1.2s ease-in-out infinite; transform-origin: 70% 90%; }
@keyframes lc-wave { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-14deg); } 75% { transform: rotate(10deg); } }
.lc-hand-badge {
    position: absolute; right: -8px; top: -10px;
    width: 24px; height: 24px; border-radius: 50%;
    display: none; place-items: center;
    background: #f59e0b; border: 2px solid #fff;
    font-size: 0.78rem; font-style: normal; line-height: 1;
    box-shadow: 0 3px 8px rgba(245, 158, 11, 0.45);
    animation: lc-wave 1.2s ease-in-out infinite;
}
.lc-av.has-hand .lc-hand-badge { display: grid; }
.lc-av.has-hand { box-shadow: 0 0 0 3px #f59e0b; }
.lc-chip-btn--hand { background: #fef3c7 !important; color: #92400e !important; }
.lc-btn--hands { width: 100%; background: #fef3c7; color: #92400e; }
.lc-dock-pill .lc-pill-hand { color: #b45309; font-weight: 800; }
.lc-dock-pill.has-hand { box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.5), 0 12px 30px rgba(15, 23, 42, 0.2); }
@media (prefers-reduced-motion: reduce) { .lc-hand-badge, #btn-raise-hand.is-raised i { animation: none; } }


/* ---------- activity inside the live lesson (students) ---------- */
.lc-activity {
    position: fixed; inset: 0;
    z-index: 2147483400;
    display: flex; flex-direction: column;
    background: #0f172a;
    opacity: 0; transform: translateY(14px);
    transition: opacity 0.2s, transform 0.25s;
    font-family: 'Outfit', 'Inter', 'Cairo', sans-serif;
}
.lc-activity.show { opacity: 1; transform: none; }
.lc-act-bar {
    display: flex; align-items: center; gap: 10px;
    padding: calc(8px + env(safe-area-inset-top)) 12px 8px 16px;
    background: #0f172a; color: #fff;
}
.lc-act-bar b { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.98rem; color: #fff; }
.lc-act-back {
    min-height: 40px; padding: 0 14px;
    border: none; border-radius: 12px;
    background: rgba(255, 255, 255, 0.12); color: #fff;
    font: 700 0.85rem 'Outfit', 'Inter', 'Cairo', sans-serif;
    display: inline-flex; align-items: center; gap: 8px;
    cursor: pointer; touch-action: manipulation;
}
[dir="rtl"] .lc-act-back i { transform: scaleX(-1); }
.lc-act-frame { flex: 1; width: 100%; border: 0; background: #fff; }
.lc-student-pill.has-action { pointer-events: auto; }
.lc-chip--rejoin { border: none; cursor: pointer; background: #4f46e5; color: #fff; font: inherit; font-weight: 700; }

/* ---------- live settings: QR next to the code ---------- */
.lc-code { gap: 12px; padding: 8px 8px 8px 8px; }
.lc-qr { width: 92px; height: 92px; flex: none; padding: 4px; border-radius: 12px; background: #fff; cursor: zoom-in; display: grid; place-items: center; border: 1px solid #e2e8f0; }
.lc-qr img, .lc-qr canvas { width: 84px !important; height: 84px !important; }
.lc-code-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lc-code-txt b { font-size: 1.2rem; letter-spacing: 0.25em; color: #0f172a; font-variant-numeric: tabular-nums; }
.lc-code-txt small { font-size: 0.72rem; color: #64748b; }


/* ---------- offline students (styles live in the dock section) ---------- */
.lc-on-count { color: #059669; font-weight: 800; }
.lc-off-count { color: #94a3b8; font-weight: 700; }
.lc-off-tag { font-style: normal; font-size: 0.7rem; font-weight: 800; color: #64748b; background: #f1f5f9; padding: 2px 8px; border-radius: 999px; margin-inline-start: 6px; vertical-align: middle; }


/* ---------- fixed-size dock: arrows never move, ~6 students per page ---------- */
.lc-dock {
    width: min(760px, calc(100% - 20px));
    max-width: none;
}
.lc-dock-lead { width: 176px; max-width: none; flex: 0 0 176px; }
.lc-dock-mid { flex: 1 1 0; min-width: 0; }
.lc-dock-tools { flex: 0 0 auto; width: 176px; justify-content: flex-end; }
.lc-strip { justify-content: flex-start; scroll-snap-type: none; }
.lc-stu { width: 50px; }
.lc-dock-arrow[hidden] { display: grid !important; }
.lc-dock-arrow:disabled { opacity: 0.25; cursor: default; background: transparent !important; }
@media (max-width: 640px) {
    .lc-dock { width: calc(100% - 12px); }
    .lc-dock-lead { width: 92px; flex-basis: 92px; }
    .lc-dock-tools { width: auto; min-width: 84px; }
    .lc-dock-arrow { display: grid !important; width: 22px; }
}


/* ---------- minimised: the pill sits where the bar was (bottom centre), never hidden in a corner ---------- */
.lc-dock-pill {
    position: fixed;
    display: inline-flex; align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.7); border-radius: 999px;
    color: #0f172a;
    font-family: 'Outfit', 'Inter', 'Cairo', sans-serif; font-weight: 700;
    cursor: pointer; touch-action: manipulation; white-space: nowrap;
    opacity: 0;
    -webkit-tap-highlight-color: transparent;
}
.lc-dock-pill b { color: #ef4444; letter-spacing: 0.1em; font-size: 0.74rem; }
.lc-dock-pill i { color: #64748b; }
.lc-dock-pill .lc-dot { width: 8px; height: 8px; }
.lc-dock-pill .lc-pill-sep { width: 1px; height: 16px; background: rgba(15, 23, 42, 0.12); }
.lc-dock-pill .lc-pill-up { margin-inline-start: 2px; color: #4f46e5; }
.lc-dock-pill .lc-pill-hand { color: #b45309; font-weight: 800; }
.lc-dock-pill.has-hand { box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.5), 0 10px 30px rgba(15, 23, 42, 0.2) !important; }
.lc-dock.lc-shrinking { transform: translate(-50%, 6px) scale(0.6, 0.7); opacity: 0; transition: transform 0.22s ease-in, opacity 0.2s ease-in; }
.lc-dock-pill {
    left: 50% !important;
    right: auto !important;
    bottom: calc(82px + env(safe-area-inset-bottom)) !important;
    z-index: 2147483300 !important;
    transform: translate(-50%, 10px) scale(0.85);
    min-height: 42px; padding: 0 14px; gap: 8px;
    font-size: 0.84rem;
    background: rgba(255, 255, 255, 0.9) !important;
    -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.2), 0 0 0 1px rgba(15, 23, 42, 0.08) !important;
    transition: transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1), opacity 0.2s;
}
.lc-dock-pill.show { transform: translate(-50%, 0) scale(1); opacity: 1; }
.lc-dock-pill:hover { transform: translate(-50%, -2px) scale(1.03); }
.lc-dock-pill:active { transform: translate(-50%, 0) scale(0.96); }
@media (max-width: 640px) { .lc-dock-pill { bottom: calc(74px + env(safe-area-inset-bottom)) !important; } }

/* phones: LIVE chip only on the left, so the strip gets the room */
@media (max-width: 640px) {
    .lc-dock-lead { width: auto; flex: 0 0 auto; max-width: 130px; padding-inline-end: 6px; }
    .lc-dock:not(.is-viewing) .lc-lead-txt { display: none; }
    .lc-dock.is-viewing .lc-lead-txt b { max-width: 78px; }
    .lc-live-chip { padding: 0 8px; }
    .lc-dock-tools { min-width: 0; width: auto; padding-inline-start: 4px; }
    .lc-tool { width: 32px; height: 32px; }
}
