:root {
    --bg-app: #f8fafc;
    --bg-surface: rgba(255, 255, 255, 0.92);
    --bg-surface-solid: #ffffff;
    --bg-subtle: #f1f5f9;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-soft: #eff6ff;
    --success: #16a34a;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --warning: #d97706;
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 8px 28px rgba(15, 23, 42, 0.10);
    --shadow-lg: 0 18px 48px rgba(15, 23, 42, 0.16);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-pill: 9999px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-app);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

/* Auth & Dashboard Layout */
.page-shell {
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 16%, rgba(37, 99, 235, 0.08), transparent 36%),
        radial-gradient(circle at 88% 82%, rgba(99, 102, 241, 0.08), transparent 40%),
        var(--bg-app);
    display: flex;
    flex-direction: column;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: var(--bg-surface);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 40;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 17px;
    letter-spacing: -0.01em;
}

.brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 15px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lang-select {
    appearance: none;
    background: var(--bg-surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    min-height: 38px;
}

.lang-select:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    min-height: 42px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.12s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.24);
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--bg-surface-solid);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.btn-secondary:hover {
    background: var(--bg-subtle);
}

.btn-danger {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: #fecaca;
}

.btn-danger:hover {
    background: #fee2e2;
}

.btn-sm {
    padding: 6px 12px;
    min-height: 34px;
    font-size: 12.5px;
}

/* Auth Card */
.auth-center {
    flex: 1;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-lg);
}

.auth-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.5;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: #fff;
    font-size: 14.5px;
    color: var(--text-primary);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.alert-error {
    background: var(--danger-soft);
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
}

.alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
}

.auth-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 13.5px;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.w-full {
    width: 100%;
}

/* Dashboard */
.dashboard-main {
    max-width: 1180px;
    width: 100%;
    margin: 0 auto;
    padding: 28px 24px 64px;
}

.hero-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.hero-title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.hero-sub {
    color: var(--text-muted);
    font-size: 14.5px;
    margin-top: 4px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.panel-card {
    background: var(--bg-surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.panel-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 4px;
}

.panel-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 18px;
}

.rooms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 16px;
}

.room-card {
    background: var(--bg-surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.room-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: #93c5fd;
}

.room-code-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-pill);
    padding: 4px 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.06em;
}

.room-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12.5px;
    color: var(--text-muted);
}

.room-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* =========================================================
   HeyPuter-Inspired Infinite Collaborative Whiteboard UI
   ========================================================= */
.wb-body {
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    background: #f8fafc;
}

.wb-viewport {
    position: fixed;
    inset: 0;
    overflow: hidden;
}

#wbCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
}

#remoteCursorsLayer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 15;
}

.remote-cursor {
    position: absolute;
    transform: translate(-2px, -2px);
    pointer-events: none;
    display: flex;
    align-items: flex-start;
    gap: 4px;
    transition: left 45ms linear, top 45ms linear;
}

.remote-cursor-label {
    background: #2563eb;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
}

/* Floating HeyPuter Glass Pills */
.wb-pill {
    position: fixed;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(203, 213, 225, 0.85);
    border-radius: 18px;
    padding: 6px 8px;
    box-shadow: var(--shadow-md);
}

.wb-top-left {
    top: 14px;
    left: 14px;
}

.wb-top-right {
    top: 14px;
    right: 14px;
}

.wb-bottom-center {
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    padding: 7px 10px;
    border-radius: 22px;
}

.wb-bottom-left {
    bottom: 16px;
    left: 14px;
}

.wb-bottom-right {
    bottom: 16px;
    right: 14px;
}

.wb-props-bar {
    position: fixed;
    bottom: 82px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 29;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(203, 213, 225, 0.85);
    border-radius: 16px;
    padding: 7px 12px;
    box-shadow: var(--shadow-md);
}

.wb-props-bar.hidden {
    display: none;
}

.wb-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 2px;
}

.wb-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.14s ease, color 0.14s ease, transform 0.1s ease;
    position: relative;
}

.wb-icon-btn:hover {
    background: var(--bg-subtle);
    color: var(--text-primary);
}

.wb-icon-btn.active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}

.wb-chip-btn {
    height: 36px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-surface-solid);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: background-color 0.14s ease;
}

.wb-chip-btn:hover {
    background: var(--bg-subtle);
}

.wb-room-title {
    border: 1px solid transparent;
    background: transparent;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: 8px;
    max-width: 190px;
}

.wb-room-title:hover,
.wb-room-title:focus {
    background: var(--bg-subtle);
    border-color: var(--border-strong);
    outline: none;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #f59e0b;
    display: inline-block;
}

.status-dot.connected {
    background: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
}

.status-dot.disconnected {
    background: #dc2626;
}

.color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.12s ease;
}

.color-swatch:hover {
    transform: scale(1.12);
}

.color-swatch.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px #fff inset;
}

.wb-slider {
    width: 92px;
    accent-color: var(--accent);
    cursor: pointer;
}

.wb-popover {
    position: fixed;
    top: 66px;
    right: 14px;
    width: 310px;
    max-height: 70vh;
    overflow-y: auto;
    background: var(--bg-surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-lg);
    z-index: 45;
    display: none;
}

.wb-popover.open {
    display: block;
}

.wb-popover h3 {
    font-size: 14.5px;
    font-weight: 700;
    margin-bottom: 10px;
}

.participant-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 10px;
    background: var(--bg-subtle);
    margin-bottom: 6px;
    font-size: 13px;
}

.badge-mini {
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
}

.badge-mini.android {
    background: #dcfce7;
    color: #15803d;
}

/* Custom In-App Modals & Toast (Zero native alert/prompt/confirm) */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    z-index: 60;
    display: none;
    place-items: center;
    padding: 20px;
}

.modal-backdrop.open {
    display: grid;
}

.modal-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.toast-banner {
    position: fixed;
    top: 72px;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    opacity: 0;
    pointer-events: none;
    z-index: 70;
    background: #0f172a;
    color: #fff;
    padding: 10px 18px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast-banner.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.timer-pill {
    position: fixed;
    top: 68px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 35;
    display: none;
    align-items: center;
    gap: 10px;
    background: #0f172a;
    color: #fff;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-lg);
    font-variant-numeric: tabular-nums;
}

.timer-pill.open {
    display: flex;
}

.timer-readout {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.swatch-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.color-picker-input {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    cursor: pointer;
}

.width-readout {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    min-width: 34px;
}

.page-indicator {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    padding: 0 6px;
    font-variant-numeric: tabular-nums;
}

.wb-icon-btn-light {
    color: #fff;
}

.popover-hint {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-bottom: 10px;
    line-height: 1.4;
}

.style-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.popover-footer-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.text-modal-area {
    margin-top: 10px;
    resize: vertical;
}

.participant-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.participant-badges {
    display: flex;
    align-items: center;
    gap: 6px;
}

.room-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.room-card-title {
    font-size: 15.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rooms-section-heading {
    margin-bottom: 14px;
}

.hint-foot {
    margin-top: 16px;
    margin-bottom: 0;
}

.no-margin {
    margin: 0;
}

.push-end {
    margin-inline-start: auto;
}

/* =========================================================
   Pro Whiteboard Studio Extensions (Shapes, Stickers, Chat,
   Minimap, Selection Contextual Bar, Spotlight, Curtain)
   ========================================================= */
.wb-context-bar {
    position: fixed;
    z-index: 36;
    display: none;
    align-items: center;
    gap: 4px;
    background: #0f172a;
    color: #fff;
    padding: 5px 8px;
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    transform: translate(-50%, -100%);
}

.wb-context-bar.open {
    display: flex;
}

.wb-ctx-btn {
    height: 30px;
    padding: 0 9px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #f8fafc;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.wb-ctx-btn:hover {
    background: rgba(255, 255, 255, 0.16);
}

.wb-ctx-btn.danger:hover {
    background: rgba(239, 68, 68, 0.35);
    color: #fecaca;
}

.wb-float-picker {
    position: fixed;
    bottom: 84px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 44;
    background: var(--bg-surface-solid);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 12px;
    box-shadow: var(--shadow-lg);
    display: none;
    min-width: 280px;
    max-width: 380px;
}

.wb-float-picker.open {
    display: block;
}

.picker-header {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.shapes-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}

.shape-tile {
    height: 44px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-subtle);
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background-color 0.12s ease, border-color 0.12s ease;
}

.shape-tile:hover,
.shape-tile.active {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}

.stickers-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
}

.sticker-tile {
    height: 38px;
    border: none;
    border-radius: 10px;
    background: transparent;
    font-size: 21px;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.sticker-tile:hover {
    background: var(--bg-subtle);
    transform: scale(1.15);
}

.stroke-style-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mini-toggle-btn {
    height: 28px;
    padding: 0 8px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-secondary);
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
}

.mini-toggle-btn.active {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}

/* Live Chat Drawer */
.wb-chat-drawer {
    position: fixed;
    top: 68px;
    right: 14px;
    bottom: 76px;
    width: 320px;
    background: var(--bg-surface-solid);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    z-index: 46;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.wb-chat-drawer.open {
    display: flex;
}

.chat-header {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 14px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f8fafc;
}

.chat-bubble {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px 10px;
    font-size: 13px;
    line-height: 1.4;
}

.chat-bubble.mine {
    background: var(--accent-soft);
    border-color: #bfdbfe;
}

.chat-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 3px;
    font-weight: 600;
}

.chat-form {
    padding: 10px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 6px;
    background: #fff;
}

.chat-input {
    flex: 1;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border-strong);
    padding: 0 10px;
    font-size: 13px;
}

.unread-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    display: none;
    align-items: center;
    justify-content: center;
}

.unread-dot.show {
    display: inline-flex;
}

/* Minimap Navigator */
.wb-minimap-card {
    position: fixed;
    right: 14px;
    bottom: 76px;
    width: 192px;
    height: 122px;
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    box-shadow: var(--shadow-md);
    z-index: 28;
    overflow: hidden;
    display: none;
}

.wb-minimap-card.open {
    display: block;
}

#minimapCanvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: pointer;
}

/* Pages Overview Drawer */
.wb-pages-drawer {
    position: fixed;
    left: 14px;
    top: 68px;
    bottom: 76px;
    width: 240px;
    background: var(--bg-surface-solid);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    z-index: 46;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.wb-pages-drawer.open {
    display: flex;
}

.pages-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.page-thumb-card {
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 10px;
    background: #f8fafc;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
}

.page-thumb-card.active {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

/* Classroom Spotlight & Screen Curtain Overlays */
#spotlightOverlay {
    position: fixed;
    inset: 0;
    z-index: 22;
    pointer-events: none;
    display: none;
}

#spotlightOverlay.open {
    display: block;
}

#curtainOverlay {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    height: 45vh;
    background: linear-gradient(180deg, #0f172a, #1e293b);
    z-index: 24;
    display: none;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

#curtainOverlay.open {
    display: flex;
}

.curtain-handle {
    width: 140px;
    height: 28px;
    margin-bottom: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: ns-resize;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

/* Presentation Mode hides non-essential chrome */
.wb-body.presentation-mode .wb-top-left,
.wb-body.presentation-mode .wb-props-bar,
.wb-body.presentation-mode .wb-bottom-left,
.wb-body.presentation-mode .wb-minimap-card {
    opacity: 0.14;
    transition: opacity 0.2s ease;
}

.wb-body.presentation-mode .wb-top-left:hover,
.wb-body.presentation-mode .wb-props-bar:hover,
.wb-body.presentation-mode .wb-bottom-left:hover {
    opacity: 1;
}

.timer-presets {
    display: flex;
    gap: 4px;
}

.timer-preset-btn {
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 8px;
    padding: 3px 7px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.timer-preset-btn:hover {
    background: rgba(255, 255, 255, 0.24);
}

.hidden-file-input {
    display: none;
}

.modal-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.dice-result-box {
    text-align: center;
    padding: 20px;
    font-size: 42px;
    font-weight: 800;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 16px;
    margin: 12px 0;
}

@media (max-width: 820px) {
    .wb-room-title { max-width: 110px; }
    .wb-bottom-left { bottom: 76px; left: 10px; }
    .wb-bottom-right { bottom: 76px; right: 10px; }
    .wb-props-bar { bottom: 136px; max-width: calc(100vw - 20px); overflow-x: auto; }
    .wb-bottom-center { max-width: calc(100vw - 16px); overflow-x: auto; }
}

/* ---- Brand Logos (IN Whiteboard Official Assets) ---- */
.brand-logo-full {
    height: 30px;
    width: auto;
    display: block;
    object-fit: contain;
}

.wb-logo-link {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.14s ease;
}

.wb-logo-link:hover {
    transform: scale(1.05);
}

.wb-logo-img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    border-radius: 8px;
}

/* ---- Left Vertical Navigation Rail Portal Shell ---- */
.portal-shell {
    min-height: 100vh;
    display: flex;
    background: var(--bg-app);
}

.portal-rail {
    width: 86px;
    flex-shrink: 0;
    background: #ffffff;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 8px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 30;
}

[dir="rtl"] .portal-rail {
    border-right: none;
    border-left: 1px solid var(--border);
}

.rail-brand {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    transition: transform 0.15s ease;
}

.rail-brand:hover {
    transform: scale(1.04);
}

.rail-logo-img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 10px;
}

.rail-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    flex: 1;
}

.rail-item {
    width: 68px;
    min-height: 62px;
    padding: 8px 4px;
    border-radius: 16px;
    text-decoration: none;
    color: #64748b;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.rail-item:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.rail-item.active {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.30);
}

.rail-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.rail-label {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.15;
    text-align: center;
    max-width: 66px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rail-footer {
    width: 100%;
    border-top: 1px solid var(--border);
    padding-top: 12px;
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.rail-avatar {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: linear-gradient(135deg, #06b6d4, #2563eb);
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.28);
    border: 2px solid #e0f2fe;
}

.portal-content-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* ---- Portal Modules: KPI Stats, Filters, Folders, Templates, Tables, Settings ---- */
.hero-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.folder-pill {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
}

.filter-bar-card {
    margin-bottom: 18px;
    padding: 16px;
}

.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-search-input {
    flex: 2 1 240px;
}

.filter-folder-select {
    flex: 1 1 170px;
}

.folder-chips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.folder-card {
    background: var(--bg-surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s ease, transform 0.12s ease;
}

.folder-card:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.template-card {
    background: var(--bg-surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.template-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.template-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.template-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.45;
    flex: 1;
}

.template-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}

.form-input-sm {
    padding: 8px 11px;
    font-size: 13px;
}

.endpoint-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    margin-bottom: 10px;
}

.endpoint-code {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--accent);
    word-break: break-all;
}

.steps-list {
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.table-card {
    overflow-x: auto;
}

.portal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.portal-table th,
.portal-table td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.portal-table th {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
}

.table-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.users-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 18px;
    align-items: start;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-mini-avatar {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.role-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
}

.role-badge.role-admin {
    background: #dbeafe;
    color: #1d4ed8;
}

.role-badge.role-member {
    background: #f1f5f9;
    color: #475569;
}

.settings-server-box {
    margin-top: 20px;
    padding: 14px;
    border-radius: 12px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.endpoint-mini {
    font-size: 12.5px;
    color: var(--text-secondary);
    word-break: break-all;
}

/* ---- Excalidraw Shortcut Badges & Modal ---- */
.tool-kbd {
    position: absolute;
    right: 3px;
    bottom: 2px;
    font-size: 9px;
    font-weight: 700;
    opacity: 0.65;
    line-height: 1;
    pointer-events: none;
}

.modal-card-wide {
    max-width: 520px;
}

.shortcuts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 14px;
    margin: 14px 0 18px;
}

.shortcut-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 10px;
    background: var(--bg-subtle);
    font-size: 12.5px;
    color: var(--text-primary);
}

.shortcut-kbd {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 6px;
    background: #ffffff;
    border: 1px solid var(--border-strong);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-primary);
}

@media (max-width: 960px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .users-layout { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .portal-shell { flex-direction: column; padding-bottom: 72px; }
    .portal-rail {
        width: 100%;
        height: 68px;
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        flex-direction: row;
        border-right: none;
        border-top: 1px solid var(--border);
        padding: 4px 8px;
        justify-content: space-around;
    }
    .rail-brand, .rail-avatar { display: none; }
    .rail-nav { flex-direction: row; justify-content: space-around; gap: 2px; }
    .rail-footer { width: auto; border-top: none; padding-top: 0; margin-top: 0; flex-direction: row; }
    .rail-item { width: auto; min-width: 54px; min-height: 52px; padding: 6px 8px; border-radius: 12px; }
    .shortcuts-grid { grid-template-columns: 1fr; }
}

/* =====================================================================
 * ENHANCED PORTAL UI/UX (SaaS / Material 3 Elevation, Visual Previews)
 * ===================================================================== */
.auth-bg {
    background:
        radial-gradient(circle at 15% 20%, rgba(37, 99, 235, 0.12), transparent 42%),
        radial-gradient(circle at 85% 80%, rgba(99, 102, 241, 0.12), transparent 45%),
        linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
}

.topbar-glass {
    background: rgba(255, 255, 255, 0.84);
    backdrop-filter: blur(12px);
}

.auth-card-elevated {
    max-width: 450px;
    padding: 34px 32px;
    border-radius: 24px;
    box-shadow: 0 24px 56px rgba(15, 23, 42, 0.10), 0 4px 12px rgba(37, 99, 235, 0.06);
}

.auth-brand-head {
    text-align: center;
    margin-bottom: 18px;
}

.auth-app-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    margin: 0 auto 12px;
    display: block;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
}

.auth-feature-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 22px;
}

.feature-chip {
    font-size: 11.5px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #dbeafe;
}

.btn-lg {
    padding: 12px 18px;
    font-size: 14.5px;
    border-radius: 12px;
}

.hero-banner {
    background: linear-gradient(135deg, #ffffff 0%, #f1f5ff 100%);
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 22px 24px;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.04);
}

.hero-eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #2563eb;
    margin-bottom: 4px;
}

.hero-banner-text .hero-title {
    margin-bottom: 4px;
}

.stat-card {
    flex-direction: row;
    align-items: center;
    gap: 14px;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.stat-icon-blue { background: #dbeafe; }
.stat-icon-indigo { background: #e0e7ff; }
.stat-icon-emerald { background: #dcfce7; }
.stat-icon-violet { background: #f3e8ff; }

.stat-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.panel-card-modern {
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.05);
}

.panel-head-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.panel-head-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    flex-shrink: 0;
}

.panel-head-blue { background: #dbeafe; color: #1d4ed8; }
.panel-head-emerald { background: #dcfce7; color: #15803d; }
.panel-head-violet { background: #f3e8ff; color: #7e22ce; }

.panel-form-body {
    margin-top: 6px;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-input-code {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    letter-spacing: 0.12em;
    font-weight: 700;
    font-size: 16px;
}

.android-tip-card {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.android-tip-icon {
    font-size: 20px;
}

.section-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 26px 0 14px;
}

.section-link {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
}

.section-link:hover {
    text-decoration: underline;
}

.empty-state-card {
    background: var(--bg-surface-solid);
    border: 1.5px dashed #cbd5e1;
    border-radius: 20px;
    padding: 36px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.empty-state-icon {
    font-size: 36px;
}

/* Visual Room & Canvas Thumbnail Cards */
.room-card-visual {
    padding: 0;
    overflow: hidden;
    border-radius: 18px;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.room-card-visual:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.09);
    border-color: #bfdbfe;
}

.room-thumb {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 12px;
    height: 92px;
    text-decoration: none;
    border-bottom: 1px solid var(--border);
}

.room-thumb-dots {
    background-color: #ffffff;
    background-image: radial-gradient(#cbd5e1 1.3px, transparent 1.3px);
    background-size: 14px 14px;
}

.room-thumb-grid {
    background-color: #ffffff;
    background-image:
        linear-gradient(to right, rgba(148, 163, 184, 0.22) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(148, 163, 184, 0.22) 1px, transparent 1px);
    background-size: 16px 16px;
}

.room-thumb-ruled {
    background-color: #ffffff;
    background-image: linear-gradient(to bottom, rgba(59, 130, 246, 0.2) 1px, transparent 1px);
    background-size: 100% 16px;
}

.room-thumb-white {
    background-color: #ffffff;
}

.room-thumb-cream {
    background-color: #fffdf5;
}

.room-thumb-dark {
    background-color: #121212;
    background-image: radial-gradient(rgba(148, 163, 184, 0.28) 1.2px, transparent 1.2px);
    background-size: 14px 14px;
}

.room-thumb-folder {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: #334155;
    border: 1px solid #e2e8f0;
}

.room-card-body {
    padding: 14px 16px 16px;
}

.folder-tab-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.folder-tab-pill {
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-secondary);
    background: var(--bg-subtle);
    border: 1px solid transparent;
    transition: background-color 0.14s ease, color 0.14s ease;
}

.folder-tab-pill:hover {
    background: #e2e8f0;
    color: var(--text-primary);
}

.folder-tab-pill.active {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.folder-card-left {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.template-card-visual {
    padding: 0;
    overflow: hidden;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.template-card-visual:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.09);
}

.tpl-preview {
    height: 116px;
    background-color: #ffffff;
    background-image: radial-gradient(#e2e8f0 1.2px, transparent 1.2px);
    background-size: 14px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.tpl-svg {
    width: 100%;
    height: 100%;
    max-width: 220px;
}

.template-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.live-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-size: 13px;
    font-weight: 700;
}

.steps-cards {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.steps-cards li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--bg-subtle);
    font-size: 13.5px;
    color: var(--text-primary);
}

.step-num {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: #2563eb;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.profile-hero-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-avatar-lg {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    background: linear-gradient(135deg, #06b6d4, #2563eb);
    color: #ffffff;
    font-size: 22px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
    flex-shrink: 0;
}

.canvas-style-picker {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.canvas-style-option {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.canvas-style-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.canvas-style-preview {
    width: 100%;
    height: 44px;
    border-radius: 10px;
    border: 2px solid var(--border);
    display: block;
    transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.canvas-style-option input:checked + .canvas-style-preview {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22);
}

.canvas-style-name {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* =====================================================================
 * EXCALIDRAW INSPECTOR, LIBRARY, CONTEXT MENU, COMMAND PALETTE, ZEN MODE
 * ===================================================================== */
.ex-inspector {
    position: fixed;
    top: 72px;
    left: 14px;
    width: 222px;
    max-height: calc(100vh - 154px);
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
    z-index: 32;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ex-inspector.hidden {
    display: none;
}

.ex-sec {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ex-sec.hidden {
    display: none;
}

.ex-sec-title {
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ex-val-badge {
    font-size: 11px;
    color: #2563eb;
    font-weight: 700;
}

.ex-swatch-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.swatch-transparent {
    background-image: linear-gradient(45deg, #cbd5e1 25%, transparent 25%, transparent 75%, #cbd5e1 75%),
                      linear-gradient(45deg, #cbd5e1 25%, #ffffff 25%, #ffffff 75%, #cbd5e1 75%);
    background-size: 8px 8px;
    background-position: 0 0, 4px 4px;
    border-color: #cbd5e1;
}

.ex-btn-group {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.ex-opt-btn {
    flex: 1 1 auto;
    min-width: 28px;
    height: 30px;
    padding: 0 6px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #f8fafc;
    color: #334155;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.ex-opt-btn:hover {
    background: #eef2ff;
    border-color: #a5b4fc;
}

.ex-opt-btn.active {
    background: #e0e7ff;
    color: #3730a3;
    border-color: #6366f1;
}

.ex-range {
    width: 100%;
    accent-color: #4f46e5;
    cursor: pointer;
}

.ex-arrow-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

.ex-mini-select {
    width: 100%;
    padding: 4px 6px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #f8fafc;
    font-size: 11px;
    font-weight: 600;
    color: #1e293b;
}

.ex-mt-6 { margin-top: 6px; }
.ex-mt-12 { margin-top: 12px; }

/* Excalidraw Shape Library Drawer */
.wb-library-drawer {
    position: fixed;
    top: 72px;
    right: 14px;
    bottom: 84px;
    width: 296px;
    background: var(--bg-surface-solid);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    z-index: 44;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.wb-library-drawer.open {
    display: flex;
}

.library-actions-row {
    padding: 10px 12px 6px;
}

.library-section-label {
    padding: 8px 12px 4px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.library-grid {
    padding: 6px 12px 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    overflow-y: auto;
}

.library-tile {
    border: 1px solid var(--border);
    background: #f8fafc;
    border-radius: 12px;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: border-color 0.14s ease, background-color 0.14s ease;
}

.library-tile:hover {
    border-color: #6366f1;
    background: #eef2ff;
}

.library-tile-icon {
    font-size: 22px;
}

.library-tile-name {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
}

.library-tile-actions {
    display: flex;
    gap: 4px;
}

.library-empty {
    grid-column: 1 / -1;
    font-size: 12px;
    color: var(--text-secondary);
    padding: 10px;
    text-align: center;
    background: var(--bg-subtle);
    border-radius: 10px;
}

/* Excalidraw Right-Click Context Menu */
.ex-context-menu {
    position: fixed;
    min-width: 210px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 6px;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
    z-index: 75;
    display: none;
    flex-direction: column;
    gap: 2px;
}

.ex-context-menu.open {
    display: flex;
}

.ex-ctx-item {
    border: none;
    background: transparent;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.ex-ctx-item:hover {
    background: #eff6ff;
    color: #1d4ed8;
}

.ex-ctx-item.danger:hover {
    background: #fee2e2;
    color: #b91c1c;
}

.ex-ctx-item kbd {
    font-size: 10.5px;
    color: var(--text-secondary);
    font-family: ui-monospace, monospace;
}

.ex-ctx-sep {
    height: 1px;
    background: var(--border);
    margin: 4px 6px;
}

/* Excalidraw Command Palette */
.cmd-list {
    margin-top: 10px;
    max-height: 340px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cmd-item {
    width: 100%;
    border: none;
    background: #f8fafc;
    padding: 9px 12px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
}

.cmd-item:hover {
    background: #eef2ff;
    color: #3730a3;
}

.export-options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--bg-subtle);
}

/* Zen Mode & View Mode */
.wb-zen-exit {
    position: fixed;
    bottom: 18px;
    right: 18px;
    z-index: 50;
    display: none;
}

.wb-body.zen-mode .wb-top-left,
.wb-body.zen-mode .wb-top-right,
.wb-body.zen-mode .wb-bottom-left,
.wb-body.zen-mode .wb-bottom-right,
.wb-body.zen-mode .wb-minimap-card,
.wb-body.zen-mode .ex-inspector,
.wb-body.view-mode .wb-bottom-center,
.wb-body.view-mode .wb-bottom-left,
.wb-body.view-mode .ex-inspector {
    display: none;
}

.wb-body.zen-mode .wb-zen-exit,
.wb-body.view-mode .wb-zen-exit {
    display: block;
}

@media (max-width: 820px) {
    .ex-inspector { width: 196px; top: 68px; max-height: calc(100vh - 200px); }
    .form-row-2 { grid-template-columns: 1fr; }
    .canvas-style-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* =====================================================================
 * OFFICIAL @excalidraw/excalidraw FULL-SCREEN SHELL + ANDROID COLLAB BAR
 * ===================================================================== */
.ex-body {
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

.excalidraw-mount,
.excalidraw-host-root {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #ffffff;
}

.ex-collab-bar {
    height: 52px;
    flex-shrink: 0;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    z-index: 40;
}

.ex-collab-left,
.ex-collab-center,
.ex-collab-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ex-page-pill {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-primary);
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--bg-subtle);
    white-space: nowrap;
}

.excalidraw-canvas-wrap {
    flex: 1;
    width: 100%;
    min-height: 0;
    position: relative;
}

.ex-collab-popover {
    top: 60px;
    right: 14px;
    z-index: 60;
}

.ex-collab-chat {
    top: 60px;
    bottom: 14px;
    z-index: 60;
}

@media (max-width: 820px) {
    .ex-collab-center { display: none; }
    .ex-collab-bar { padding: 0 8px; gap: 6px; }
}

/* =====================================================================
 * EXCALIDRAW BOTTOM TOOLBAR, NO NUMBERS, CUSTOM LABELS & HIDE-LABELS SETTING
 * ===================================================================== */
.ex-bottom-toolbar .excalidraw .shapes-section {
    position: fixed !important;
    bottom: 14px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    top: auto !important;
    z-index: 25 !important;
    max-width: calc(100vw - 24px);
}

.ex-bottom-toolbar .excalidraw .App-toolbar-container {
    width: auto !important;
}

.ex-bottom-toolbar .excalidraw .App-toolbar .ToolIcon__keybinding {
    display: none !important;
}

.ex-bottom-toolbar .excalidraw .App-toolbar label.ToolIcon,
.ex-bottom-toolbar .excalidraw .App-toolbar button.ToolIcon,
.ex-bottom-toolbar .excalidraw .App-toolbar button.App-toolbar__extra-tools-trigger {
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    height: auto !important;
    min-height: 46px !important;
    min-width: 44px !important;
    padding: 4px 5px !important;
    gap: 2px !important;
}

.ex-bottom-toolbar .excalidraw .App-toolbar .ToolIcon__icon {
    width: 24px !important;
    height: 24px !important;
}

.ex-tool-caption {
    font-size: 10px;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.01em;
    color: #475569;
    white-space: nowrap;
    max-width: 48px;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

.excalidraw.theme--dark .ex-tool-caption {
    color: #cbd5e1;
}

.ex-bottom-toolbar .excalidraw .App-toolbar .ToolIcon__icon[aria-checked="true"] + .ex-tool-caption,
.ex-bottom-toolbar .excalidraw .App-toolbar input:checked ~ .ex-tool-caption {
    color: #3730a3;
    font-weight: 700;
}

/* Hide toolbar labels when user enables Hide Toolbar Labels setting */
.ex-hide-labels .ex-tool-caption {
    display: none !important;
}

.ex-hide-labels .excalidraw .App-toolbar label.ToolIcon,
.ex-hide-labels .excalidraw .App-toolbar button.ToolIcon,
.ex-hide-labels .excalidraw .App-toolbar button.App-toolbar__extra-tools-trigger {
    min-height: 38px !important;
    min-width: 38px !important;
    padding: 4px !important;
}

/* Open extra-tools dropdown & HintViewer UPWARDS above bottom dock */
.ex-bottom-toolbar .excalidraw .App-toolbar__extra-tools-dropdown {
    bottom: calc(100% + 10px) !important;
    top: auto !important;
    margin-top: 0 !important;
}

.ex-bottom-toolbar .excalidraw .HintViewer {
    top: auto !important;
    bottom: calc(100% + 8px) !important;
    margin-top: 0 !important;
}

/* Remove Help (?), external Excalidraw links, Mermaid, Web Embed & paid AI triggers */
.excalidraw .help-icon,
.excalidraw .HelpDialog__header,
.excalidraw .layer-ui__wrapper__footer-right,
.excalidraw [data-testid="toolbar-magicframe"],
.excalidraw [data-testid="toolbar-embeddable"],
.excalidraw [data-testid="mermaid-to-excalidraw"],
.excalidraw .ex-hidden-item,
.excalidraw a[href*="excalidraw.com"],
.excalidraw a[href*="github.com/excalidraw"],
.excalidraw a[href*="mermaid.js.org"] {
    display: none !important;
}

/* Lift Zoom/Undo/Help cleanly so they never collide with bottom center toolbar */
.ex-bottom-toolbar .excalidraw .App-menu_bottom {
    bottom: 16px !important;
}

/* Classroom Spotlight, Curtain & Presentation Mode in Excalidraw Shell */
.ex-page-pill-btn {
    border: 1px solid var(--border);
    cursor: pointer;
}

.ex-page-pill-btn:hover {
    background: #e2e8f0;
}

.ex-spotlight-canvas {
    position: fixed;
    inset: 0;
    z-index: 35;
    pointer-events: none;
}

.ex-curtain-overlay {
    position: fixed;
    left: 0;
    right: 0;
    top: 52px;
    background: linear-gradient(180deg, #0f172a, #1e293b);
    z-index: 36;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.ex-present-mode .ex-collab-bar {
    opacity: 0.12;
    transition: opacity 0.2s ease;
}

.ex-present-mode .ex-collab-bar:hover {
    opacity: 1;
}

.settings-toggle-card {
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    align-items: flex-start;
    gap: 10px;
}

.settings-toggle-title {
    display: block;
    font-size: 13.5px;
    color: var(--text-primary);
}

@media (max-width: 1120px) {
    .ex-bottom-toolbar .excalidraw .App-menu_bottom {
        bottom: 82px !important;
    }
}

/* ---- QR Join Modal, Host Lock Banner, Online Pills & Room Badges ---- */
.qr-mini-tag {
    font-size: 10px;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 6px;
    background: #dbeafe;
    color: #1d4ed8;
}

.qr-modal-card {
    text-align: center;
}

.qr-frame {
    display: inline-flex;
    padding: 12px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin: 8px 0 12px;
}

.qr-img {
    width: 210px;
    height: 210px;
    display: block;
}

.qr-code-hero {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 0.16em;
    color: var(--accent);
    margin-bottom: 12px;
}

.ex-locked-banner {
    background: #fef3c7;
    color: #92400e;
    border-bottom: 1px solid #fde68a;
    text-align: center;
    padding: 6px 12px;
    font-size: 12.5px;
    font-weight: 700;
    z-index: 38;
}

.room-card-badges {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.online-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-size: 11px;
    font-weight: 700;
}

/* ---- Bottom-Right Floating Page & Tab Switcher (Android-Style) ---- */
.ex-page-dock-br {
    position: fixed;
    bottom: 14px;
    right: 14px;
    z-index: 30;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 4px 6px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    display: flex;
    align-items: center;
    gap: 4px;
}

.ex-page-dock-pill {
    border: 1px solid var(--border);
    background: var(--bg-subtle);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 5px 10px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.ex-page-dock-pill:hover {
    background: #eef2ff;
    border-color: #a5b4fc;
    color: #3730a3;
}

.ex-tab-badge {
    font-size: 11px;
    font-weight: 800;
    padding: 1px 7px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- Android-Style Tabs & Pages Manager Modal ---- */
.tabs-manager-card {
    width: 100%;
    max-width: 680px;
    max-height: 82vh;
    background: #ffffff;
    border-radius: 22px;
    border: 1px solid var(--border);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tabs-manager-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.tabs-strip {
    padding: 12px 20px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
}

.tab-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text-secondary);
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.tab-chip:hover {
    border-color: #93c5fd;
    color: var(--text-primary);
}

.tab-chip.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}

.tab-chip.active .badge-mini {
    background: rgba(255, 255, 255, 0.24);
    color: #ffffff;
}

.tabs-toolbar-row {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.tabs-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.tabs-pages-grid {
    padding: 16px 20px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 12px;
    flex: 1;
}

.tab-page-card {
    border: 2px solid var(--border);
    border-radius: 14px;
    background: #ffffff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.tab-page-card.active {
    border-color: #2563eb;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.16);
}

.tab-page-card.selected {
    border-color: #dc2626;
    background: #fff5f5;
}

.tab-page-preview {
    height: 74px;
    background-color: #ffffff;
    background-image: radial-gradient(#cbd5e1 1.2px, transparent 1.2px);
    background-size: 12px 12px;
    border-bottom: 1px solid var(--border);
    padding: 8px 10px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    cursor: pointer;
}

.tab-page-body {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tab-page-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.tab-page-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.tab-move-select {
    flex: 1;
    min-width: 82px;
    padding: 3px 6px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #f8fafc;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
}

.delete-confirm-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #fee2e2;
    color: #dc2626;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

@media (max-width: 1120px) {
    .ex-page-dock-br {
        bottom: 82px;
        right: 10px;
    }
}

/* ---- Auto-Save Pill & 3-Mode Eraser Dock + Overlay ---- */
.autosave-pill {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    white-space: nowrap;
}

.autosave-pill.saving {
    background: #fef3c7;
    color: #b45309;
}

.ex-eraser-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 12;
    pointer-events: none;
}

.excalidraw-canvas-wrap.ex-eraser-precision canvas.excalidraw__canvas.interactive {
    cursor: none !important;
}

.excalidraw-canvas-wrap.ex-eraser-region canvas.excalidraw__canvas.interactive {
    cursor: crosshair !important;
}

.ex-eraser-dock {
    position: fixed;
    bottom: 92px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 34;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
}

.ex-eraser-pill-btn {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    white-space: nowrap;
}

.ex-eraser-pill-btn:hover {
    background: var(--bg-subtle);
    color: var(--text-primary);
}

.ex-eraser-pill-btn.active {
    background: #2563eb;
    color: #ffffff;
}

.ex-eraser-popover {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    width: 310px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 14px;
    box-shadow: 0 20px 46px rgba(15, 23, 42, 0.18);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ex-eraser-pop-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-primary);
}

.ex-eraser-card {
    width: 100%;
    border: 1.5px solid var(--border);
    background: #f8fafc;
    border-radius: 12px;
    padding: 9px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.14s ease, background-color 0.14s ease;
}

.ex-eraser-card:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}

.ex-eraser-card.active {
    border-color: #2563eb;
    background: #eff6ff;
}

.ex-eraser-card-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.ex-eraser-card-icon.icon-blue { background: #dbeafe; color: #2563eb; }
.ex-eraser-card-icon.icon-purple { background: #f3e8ff; color: #7c3aed; }
.ex-eraser-card-icon.icon-amber { background: #fef3c7; color: #d97706; }

.ex-eraser-card-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ex-eraser-card-text strong {
    font-size: 12.5px;
    color: var(--text-primary);
}

.ex-eraser-card-text span {
    font-size: 11px;
    color: var(--text-secondary);
}

.ex-eraser-size-row {
    padding: 6px 4px 2px;
}

@media (max-width: 820px) {
    .autosave-pill { display: none; }
}

/* =====================================================================
 * Live Flying Emoji Reactions (FigJam-Style), Quick Polls, MD Mindmap & Snapshots
 * ===================================================================== */
.mode-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.md-mindmap-area {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    line-height: 1.5;
}

.reaction-stage {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 90;
    overflow: hidden;
}

.reaction-burst {
    position: absolute;
    bottom: 92px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    animation: reactionFloatUp 2.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.reaction-burst-emoji {
    font-size: 38px;
    filter: drop-shadow(0 6px 12px rgba(15, 23, 42, 0.2));
}

.reaction-burst-name {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.78);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

@keyframes reactionFloatUp {
    0% { transform: translateY(0) scale(0.6); opacity: 0; }
    15% { transform: translateY(-28px) scale(1.12); opacity: 1; }
    80% { transform: translateY(-240px) scale(1); opacity: 0.95; }
    100% { transform: translateY(-330px) scale(0.92); opacity: 0; }
}

.reaction-picker-bar {
    position: fixed;
    top: 64px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 65;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

.reaction-btn {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: none;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
    transition: transform 0.14s ease, background 0.14s ease;
}

.reaction-btn:hover {
    background: #eff6ff;
    transform: scale(1.22);
}

.poll-widget {
    position: fixed;
    top: 68px;
    right: 16px;
    width: min(320px, calc(100vw - 32px));
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 14px;
    box-shadow: var(--shadow-lg);
    z-index: 62;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.poll-widget-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    font-size: 13.5px;
    color: var(--text-primary);
}

.poll-options-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.poll-option-btn {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    border-radius: 11px;
    border: 1px solid var(--border);
    background: #f8fafc;
    cursor: pointer;
    text-align: left;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
}

.poll-option-btn.voted {
    border-color: var(--accent);
    background: #eff6ff;
}

.poll-bar-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: rgba(37, 99, 235, 0.15);
    transition: width 0.25s ease;
    pointer-events: none;
}

.poll-option-label,
.poll-option-pct {
    position: relative;
    z-index: 1;
}

.poll-option-pct {
    font-size: 11.5px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.poll-widget-foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.snapshot-save-form {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.snapshots-list {
    max-height: 260px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.snapshot-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #f8fafc;
    font-size: 13px;
}

.snapshot-meta {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.snapshot-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* =====================================================================
 * Android Feature Parity Studio (Calculator, Ruler/Protractor/SetSquare,
 * Math Grapher, Chart Builder, 3D Shapes, Flashcards, Split Zones, Themes)
 * ===================================================================== */
.at-tools-popover {
    width: min(370px, calc(100vw - 24px));
    max-height: calc(100vh - 110px);
    overflow-y: auto;
}

.at-section-lbl {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin: 10px 0 6px;
}

.modal-card-wide {
    width: min(640px, calc(100vw - 28px));
    max-height: calc(100vh - 48px);
    overflow-y: auto;
}

.at-bg-svg,
.at-bg-pattern {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.42;
}

.at-pat-dots {
    background-image: radial-gradient(#94a3b8 1.4px, transparent 1.4px);
    background-size: 24px 24px;
}

.at-pat-grid {
    background-image:
        linear-gradient(to right, #cbd5e1 1px, transparent 1px),
        linear-gradient(to bottom, #cbd5e1 1px, transparent 1px);
    background-size: 28px 28px;
}

.at-pat-ruled {
    background-image: linear-gradient(to bottom, transparent 31px, #93c5fd 31px, #93c5fd 32px);
    background-size: 100% 32px;
}

.at-pat-iso {
    background-image:
        linear-gradient(30deg, #cbd5e1 1px, transparent 1px),
        linear-gradient(150deg, #cbd5e1 1px, transparent 1px);
    background-size: 32px 56px;
}

.at-float-card {
    position: fixed;
    z-index: 64;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.at-calc-card {
    width: 288px;
}

.at-flashcard-card {
    right: 18px;
    bottom: 92px;
    width: min(330px, calc(100vw - 32px));
}

.at-float-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: grab;
    font-size: 13px;
    user-select: none;
}

.at-head-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.at-calc-screen {
    background: #0f172a;
    color: #f8fafc;
    border-radius: 12px;
    padding: 10px 12px;
    text-align: right;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.at-calc-expr {
    font-size: 12px;
    color: #94a3b8;
    min-height: 16px;
    word-break: break-all;
}

.at-calc-res {
    font-size: 22px;
    font-weight: 800;
    margin-top: 2px;
}

.at-calc-sci-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
}

.at-calc-num-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.at-calc-key {
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8fafc;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
}

.at-calc-key.sci {
    height: 30px;
    font-size: 11px;
    background: #eff6ff;
    color: #1d4ed8;
}

.at-calc-key.op {
    background: #dbeafe;
    color: #1d4ed8;
}

.at-calc-key.danger {
    background: #fee2e2;
    color: #dc2626;
}

.at-calc-actions {
    display: flex;
    gap: 6px;
    justify-content: space-between;
}

.at-geom-wrap {
    position: fixed;
    z-index: 60;
    transform-origin: center center;
    cursor: grab;
    user-select: none;
}

.at-geom-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.88);
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    margin-bottom: 6px;
    width: fit-content;
}

.at-geom-svg {
    display: block;
    filter: drop-shadow(0 8px 18px rgba(15, 23, 42, 0.18));
}

.at-preview-canvas {
    width: 100%;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
    display: block;
    margin-top: 8px;
}

.at-3d-canvas {
    cursor: grab;
}

.at-preset-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.at-inline-range {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-left: auto;
}

.at-formula-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
    margin: 8px 0;
}

.at-formula-card {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #f8fafc;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
}

.at-formula-card:hover {
    border-color: var(--accent);
    background: #eff6ff;
}

.at-fc-stage {
    min-height: 124px;
    border-radius: 14px;
    border: 2px solid #bfdbfe;
    background: #eff6ff;
    padding: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    text-align: center;
}

.at-fc-stage.flipped {
    border-color: #86efac;
    background: #f0fdf4;
}

.at-fc-badge {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

.at-fc-text {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text-primary);
}

.at-fc-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.at-split-overlay {
    position: absolute;
    inset: 0;
    z-index: 9;
    pointer-events: none;
    display: flex;
}

.at-split-pane {
    flex: 1;
    border-right: 2px dashed rgba(37, 99, 235, 0.45);
    position: relative;
}

.at-split-pane:last-of-type {
    border-right: none;
}

.at-split-tag {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 12px;
    border-radius: 999px;
    color: #fff;
    font-size: 11.5px;
    font-weight: 800;
    box-shadow: var(--shadow-sm);
}

.at-split-exit-btn {
    position: absolute;
    top: 10px;
    right: 12px;
    pointer-events: auto;
    border: none;
    background: rgba(15, 23, 42, 0.85);
    color: #fff;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
}

.at-camera-video {
    width: 100%;
    max-height: 320px;
    border-radius: 12px;
    background: #0f172a;
    object-fit: cover;
}

.at-theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin: 10px 0;
}

.at-theme-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px;
    border-radius: 14px;
    border: 1.5px solid var(--border);
    background: #fff;
    cursor: pointer;
    font-size: 12px;
}

.at-theme-tile.active {
    border-color: var(--accent);
    background: #eff6ff;
}

.at-theme-swatch {
    width: 100%;
    height: 46px;
    border-radius: 10px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

/* Live Active Drawers Pill (Shows which Android/Web device is actively drawing) */
.ex-active-drawers-bar {
    position: fixed;
    top: 62px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 58;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    pointer-events: none;
}

.ex-drawer-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 13px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.88);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.22);
    backdrop-filter: blur(8px);
}

.ex-drawer-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85);
}

/* 60fps Ultra-Low-Latency Direct Live Ink Layer */
.ex-live-ink-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 11;
    pointer-events: none;
}

/* Android 11-Pen Suite Dock, Popover & Left Floating Pen Bar */
.ex-pen-dock {
    position: fixed;
    bottom: 92px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 34;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 4px;
    display: flex;
    align-items: center;
    gap: 3px;
    max-width: calc(100vw - 24px);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
}

.ex-pen-dock-sep {
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 0 2px;
}

.ex-pen-popover {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    width: min(420px, calc(100vw - 24px));
    max-height: calc(100vh - 190px);
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 14px;
    box-shadow: 0 20px 46px rgba(15, 23, 42, 0.18);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ex-pen-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.ex-pen-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 4px;
    border-radius: 12px;
    border: 1.5px solid var(--border);
    background: #f8fafc;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-primary);
}

.ex-pen-tile.active {
    border-color: var(--accent);
    background: #eff6ff;
    color: var(--accent);
}

.ex-pen-tile-icon { font-size: 18px; }
.ex-pen-tile-name { white-space: nowrap; }

.ex-pen-colors-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
}

.ex-pen-context-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.ex-pen-math-row {
    display: flex;
    gap: 6px;
}

.ex-pen-math-preview {
    font-size: 13px;
    font-weight: 800;
    color: #16a34a;
}

.ex-math-sym-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.ex-floating-pen-bar {
    position: fixed;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 33;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

.ex-float-pen-btn {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: none;
    background: transparent;
    font-size: 17px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ex-float-pen-btn:hover { background: #f1f5f9; }
.ex-float-pen-btn.active { background: #2563eb; color: #ffffff; }

/* Periodic Table, Quiz, Media Player & Hide/Reveal Cards */
.at-elem-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid var(--border);
    margin: 10px 0;
}

.at-elem-hero {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 900;
    flex-shrink: 0;
}

.at-ptable-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
    gap: 6px;
    max-height: 280px;
    overflow-y: auto;
}

.at-ptable-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 4px;
    border-radius: 10px;
    border: 1.5px solid transparent;
    cursor: pointer;
    font-size: 11px;
}

.at-ptable-cell.active { border-color: #0f172a; box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25); }
.at-pt-num { font-size: 9.5px; opacity: 0.7; }
.at-pt-name { font-size: 9.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

.cat-nonmetal { background: #dbeafe; color: #1e3a8a; }
.cat-noble { background: #f3e8ff; color: #581c87; }
.cat-alkali { background: #fee2e2; color: #991b1b; }
.cat-alkaline { background: #ffedd5; color: #9a3412; }
.cat-metalloid { background: #dcfce7; color: #166534; }
.cat-halogen { background: #fef9c3; color: #854d0e; }
.cat-metal { background: #e2e8f0; color: #1e293b; }
.cat-transition { background: #fce7f3; color: #831843; }
.cat-actinide { background: #cffafe; color: #155e75; }

.at-quiz-card { left: 18px; bottom: 92px; width: min(340px, calc(100vw - 32px)); }
.at-quiz-q { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.poll-option-btn.quiz-correct { background: #dcfce7; border-color: #16a34a; color: #14532d; }
.poll-option-btn.quiz-wrong { background: #fee2e2; border-color: #dc2626; color: #991b1b; }

.at-media-card { right: 18px; top: 74px; width: min(350px, calc(100vw - 32px)); }
.at-reveal-card { left: 18px; top: 74px; width: min(320px, calc(100vw - 32px)); }

.at-reveal-pill {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1.5px solid #cbd5e1;
    background: #1e293b;
    color: #f8fafc;
    cursor: pointer;
    text-align: left;
    font-size: 13px;
}

.at-reveal-pill.revealed {
    background: #ecfdf5;
    border-color: #10b981;
    color: #064e3b;
}

.timer-preset-btn.active-chip {
    background: #2563eb;
    color: #ffffff;
}

@media (max-width: 820px) {
    .ex-pen-lbl { display: none; }
}

/* =====================================================================
 * Modern SaaS Portal UI/UX Elevation Layer (Dashboard, Rooms, Workspace,
 * Devices, Users, Settings & Login)
 * ===================================================================== */
.portal-shell {
    background:
        radial-gradient(900px 420px at 14% -8%, rgba(37, 99, 235, 0.08), transparent 65%),
        radial-gradient(760px 360px at 88% -6%, rgba(124, 58, 237, 0.07), transparent 60%),
        #f4f7fb;
}

.portal-rail {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(18px);
    border-right: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 2px 0 24px rgba(15, 23, 42, 0.03);
}

.rail-item {
    position: relative;
    transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.rail-item:hover {
    transform: translateY(-1px);
}

.rail-item.active {
    background: linear-gradient(135deg, #eff6ff 0%, #e0e7ff 100%);
    color: #1d4ed8;
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.22);
}

.rail-item.active::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 12px;
    bottom: 12px;
    width: 3.5px;
    border-radius: 0 4px 4px 0;
    background: linear-gradient(180deg, #2563eb, #4f46e5);
}

.topbar {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.88);
    padding: 0 24px;
    gap: 16px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
    flex: 1;
}

.topbar-search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f1f5f9;
    border: 1.5px solid transparent;
    border-radius: 12px;
    padding: 0 10px 0 12px;
    height: 38px;
    width: min(340px, 100%);
    transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.topbar-search-form:focus-within {
    background: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.topbar-search-icon {
    font-size: 13px;
    opacity: 0.65;
}

.topbar-search-input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 13px;
    color: var(--text-primary);
    width: 100%;
    min-width: 0;
}

.topbar-kbd {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 1px 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.topbar-user-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 11px 4px 5px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 12.5px;
    font-weight: 700;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.topbar-user-pill:hover {
    background: #eff6ff;
    border-color: #93c5fd;
}

.topbar-user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.hero-banner {
    background:
        radial-gradient(460px 220px at 88% 18%, rgba(96, 165, 250, 0.28), transparent 70%),
        linear-gradient(135deg, #0f172a 0%, #1e3a8a 58%, #2563eb 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 22px;
    padding: 26px 28px;
    color: #ffffff;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #dbeafe;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}

.hero-title {
    color: #ffffff;
    font-size: clamp(22px, 2.4vw, 29px);
    letter-spacing: -0.02em;
}

.hero-sub {
    color: rgba(226, 232, 240, 0.9);
    font-size: 14px;
}

.hero-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
}

.hero-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.24);
}

.hero-actions .btn-primary {
    background: #ffffff;
    color: #1d4ed8;
    border-color: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.2);
}

.hero-actions .btn-primary:hover {
    background: #eff6ff;
}

.stat-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 18px;
    padding: 18px 20px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
    border-color: #cbd5e1;
}

.stat-value {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.panel-card,
.panel-card-modern {
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 20px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
}

.room-card-visual {
    border-radius: 20px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    overflow: hidden;
}

.room-card-visual:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.09);
    border-color: #93c5fd;
}

.room-thumb {
    min-height: 112px;
    transition: transform 0.22s ease;
}

.room-card-visual:hover .room-thumb {
    transform: scale(1.015);
}

.online-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
    font-size: 11px;
    font-weight: 800;
}

.folder-tab-pill {
    border-radius: 999px;
    font-weight: 700;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.folder-tab-pill.active {
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.25);
}

.form-input {
    border-radius: 12px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.btn {
    border-radius: 12px;
    font-weight: 700;
    transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.22);
}

.btn-primary:hover {
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.3);
}

@media (max-width: 960px) {
    .topbar-search-form { display: none; }
    .topbar-user-name { display: none; }
    .topbar-new-btn { display: none; }
}

/* =====================================================================
 * Enhanced Android Pen Studio UI (Live Preview, Pro Color Picker, Size Dots, Opacity)
 * ===================================================================== */
.ex-pen-live-preview {
    width: 100%;
    height: 62px;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: block;
    background: #f8fafc;
}

.ex-slot-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    border: 1.5px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.25);
    display: inline-block;
    flex-shrink: 0;
}

.ex-slot-dot-lg {
    width: 12px;
    height: 12px;
}

.ex-pen-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.ex-pen-sec-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ex-hex-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ex-custom-color-btn {
    position: relative;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ex-custom-color-btn input[type="color"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.ex-rainbow-ring {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: conic-gradient(#ef4444, #f59e0b, #eab308, #22c55e, #06b6d4, #3b82f6, #8b5cf6, #ec4899, #ef4444);
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.22);
}

.ex-hex-input {
    width: 78px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid var(--border);
    padding: 0 7px;
    font-size: 12px;
    font-weight: 700;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: var(--text-primary);
    background: #f8fafc;
}

.ex-recent-colors-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ex-recent-lbl {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
}

.color-swatch-sm {
    width: 20px;
    height: 20px;
}

.ex-size-dots-row {
    display: flex;
    align-items: center;
    gap: 5px;
}

.ex-size-dot-btn {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1.5px solid var(--border);
    background: #f8fafc;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.ex-size-dot-btn.active {
    border-color: var(--accent);
    background: #eff6ff;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.16);
}

.ex-size-dot-core {
    border-radius: 999px;
    display: inline-block;
}

/* =====================================================================
 * CLEAN, CALM MINIMALIST ROOM WORKSPACE UI/UX (ZERO CLUTTER)
 * ===================================================================== */

/* Pin Excalidraw Library button cleanly to top-right corner instead of mid-canvas */
.ex-bottom-toolbar .excalidraw .layer-ui__wrapper__top-right {
    position: fixed !important;
    top: 66px !important;
    right: 16px !important;
    z-index: 24 !important;
}

/* Hide redundant Excalidraw left Stroke/Opacity panel while our Android Pen Engine is active
   so there are NEVER two conflicting color pickers on screen */
.ex-pen-active .excalidraw .App-menu__left,
.ex-pen-active .excalidraw .App-menu_left,
.ex-pen-active .excalidraw .selected-shape-actions,
.ex-pen-active .excalidraw .HintViewer,
.ex-eraser-active .excalidraw .HintViewer {
    display: none !important;
}

/* Compact, calm room header bar */
.ex-collab-bar {
    height: 54px;
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06);
}

.ex-room-code-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #0f172a;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.ex-room-code-pill:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.ex-save-indicator {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    padding: 2px 6px;
    white-space: nowrap;
}

.ex-save-indicator.saving {
    color: #d97706;
}

/* Center 3-pill segmented workspace navigation */
.ex-nav-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px;
    border-radius: 12px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

.ex-header-menu-wrap {
    position: relative;
}

.ex-nav-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border-radius: 9px;
    border: none;
    background: transparent;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

.ex-nav-pill:hover {
    background: rgba(255, 255, 255, 0.85);
    color: #0f172a;
}

.ex-nav-pill.active {
    background: #ffffff;
    color: #2563eb;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.10);
}

.ex-nav-ic {
    font-size: 14px;
    line-height: 1;
}

.ex-nav-caret {
    font-size: 10px;
    opacity: 0.65;
    margin-left: -1px;
}

.ex-nav-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #10b981;
}

/* Crisp dropdown menus under Insert / Board */
.ex-header-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    width: 340px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.16), 0 2px 6px rgba(15, 23, 42, 0.06);
    z-index: 80;
}

.ex-header-dropdown-sm {
    width: 248px;
}

.ex-header-drop-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    padding: 2px 6px 8px;
}

.ex-header-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.ex-header-menu-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 10px;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
    background: #f8fafc;
    text-align: left;
    cursor: pointer;
    transition: background 0.14s ease, border-color 0.14s ease, transform 0.12s ease;
}

.ex-header-menu-item:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    transform: translateY(-1px);
}

.ex-header-menu-item.ex-hm-accent {
    background: linear-gradient(135deg, #eef2ff, #eff6ff);
    border-color: #c7d2fe;
}

.ex-hm-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.ex-header-menu-item strong {
    display: block;
    font-size: 12.5px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.ex-header-menu-item small {
    display: block;
    font-size: 10.5px;
    color: #64748b;
    margin-top: 2px;
}

.ex-header-menu-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ex-header-menu-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: #1e293b;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s ease;
}

.ex-header-menu-row:hover {
    background: #f1f5f9;
}

.ex-header-menu-row.danger {
    color: #dc2626;
}

.ex-header-menu-row.danger:hover {
    background: #fef2f2;
}

.ex-hm-row-label {
    flex: 1;
}

.ex-hm-badge {
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    background: #dcfce7;
    color: #15803d;
}

.ex-hm-badge.warn {
    background: #fef3c7;
    color: #b45309;
}

.ex-header-menu-sep {
    height: 1px;
    background: #e2e8f0;
    margin: 5px 4px;
}

/* Primary Share button & compact language select */
.ex-share-cta {
    height: 34px;
    padding: 0 14px;
    border-radius: 10px;
    border: none;
    background: #2563eb;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
    transition: background 0.14s ease, transform 0.12s ease;
}

.ex-share-cta:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.lang-select-compact {
    max-width: 108px;
    height: 34px;
    padding: 0 8px;
    font-size: 12px;
    border-radius: 10px;
}

/* Compact Floating Pen Bar with Instant Quick Color Dots */
.ex-pen-dock {
    bottom: 78px;
    padding: 5px 8px;
    gap: 5px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12), 0 1px 3px rgba(15, 23, 42, 0.06);
}

.ex-brush-trigger {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.ex-quick-colors {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0 2px;
}

.ex-quick-color-dot {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.18);
    cursor: pointer;
    padding: 0;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.ex-quick-color-dot:hover {
    transform: scale(1.16);
}

.ex-quick-color-dot.active {
    transform: scale(1.15);
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #2563eb;
}

@media (max-width: 960px) {
    .ex-save-indicator { display: none; }
    .ex-quick-colors { display: none; }
}

/* Downward Chevron Badge on Bottom Bar Buttons with Option Dropdowns (Pen, Eraser, More Tools) */
.ex-bottom-toolbar .excalidraw .App-toolbar .ex-has-dropdown {
    position: relative !important;
}

.ex-tool-dropdown-caret {
    position: absolute;
    right: 3px;
    bottom: 3px;
    width: 12px;
    height: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    pointer-events: none;
    line-height: 1;
    transition: color 0.14s ease, transform 0.14s ease;
}

.ex-bottom-toolbar .excalidraw .App-toolbar .ex-has-dropdown:hover .ex-tool-dropdown-caret,
.ex-bottom-toolbar .excalidraw .App-toolbar .ToolIcon__icon[aria-checked="true"] ~ .ex-tool-dropdown-caret,
.ex-bottom-toolbar .excalidraw .App-toolbar input:checked ~ .ex-tool-dropdown-caret {
    color: #2563eb;
}

.excalidraw.theme--dark .ex-tool-dropdown-caret {
    color: #94a3b8;
}

/* =====================================================================
 * NEARBY DEVICES ORBIT RADAR (IN-ROOM MODAL & /DEVICES PORTAL CARD)
 * ===================================================================== */
.ex-radar-top-btn.active {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.ex-radar-modal {
    width: min(860px, calc(100vw - 28px));
    max-width: 860px;
    padding: 18px 20px;
    text-align: left;
}

.ex-radar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 1px solid #e2e8f0;
}

.ex-radar-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ex-radar-badge-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0f172a, #1e3a8a);
    color: #38bdf8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.ex-radar-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ex-radar-body {
    display: grid;
    grid-template-columns: 1.22fr 0.98fr;
    gap: 16px;
    align-items: stretch;
}

.ex-radar-canvas-shell {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    background: #040b16;
    border: 1.5px solid #1e293b;
    display: flex;
    flex-direction: column;
    min-height: 340px;
}

.ex-radar-canvas {
    width: 100%;
    height: 340px;
    display: block;
    cursor: crosshair;
    touch-action: none;
}

.ex-radar-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 8px 12px;
    background: rgba(15, 23, 42, 0.92);
    border-top: 1px solid rgba(56, 189, 248, 0.14);
    font-size: 11.5px;
    font-weight: 600;
    color: #cbd5e1;
}

.ex-radar-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ex-radar-legend i {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    display: inline-block;
}

.ex-radar-legend .dot-green { background: #10b981; }
.ex-radar-legend .dot-amber { background: #f59e0b; }
.ex-radar-legend .dot-cyan { background: #38bdf8; }

.ex-radar-sidebar {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 2px;
}

.ex-radar-sec-label {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
}

.ex-mt-10 { margin-top: 10px; }

.ex-radar-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.ex-radar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 13px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: border-color 0.14s ease, background 0.14s ease;
}

.ex-radar-row.selected,
.ex-radar-row:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}

.ex-radar-row.self {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.ex-radar-row-ic {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.ex-radar-row-info {
    flex: 1;
    min-width: 0;
}

.ex-radar-row-info strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ex-radar-row-info small {
    display: block;
    font-size: 11.5px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ex-radar-empty {
    padding: 16px 12px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    color: #64748b;
    font-size: 12px;
    line-height: 1.45;
}

.btn-xs {
    padding: 5px 10px;
    font-size: 11.5px;
    border-radius: 8px;
}

.portal-radar-card {
    margin-bottom: 20px;
}

.portal-radar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
}

.portal-radar-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.portal-radar-select {
    width: auto;
    min-width: 190px;
    height: 36px;
    padding: 0 10px;
    font-size: 12.5px;
}

/* Strict Android zoom parity (30% min .. 200% max) button boundary states */
.excalidraw-canvas-wrap.ex-zoom-at-min .excalidraw .zoom-out-button,
.excalidraw-canvas-wrap.ex-zoom-at-max .excalidraw .zoom-in-button {
    opacity: 0.36;
    cursor: not-allowed;
    pointer-events: none;
}

@media (max-width: 780px) {
    .ex-radar-body {
        grid-template-columns: 1fr;
    }
}

/* ============================================================================
   IN One Smart QR Login UI — Branded with IN Whiteboard Royal Blue (#2563eb)
   Derived via Single-Hex Dynamic Brand Color Generator (r=37, g=99, b=235)
   ============================================================================ */
body.inone-login-body {
    --theme-primary: #2563eb;
    --theme-hover: #1e51c0;
    --theme-light: rgba(37, 99, 235, 0.08);
    --theme-border: rgba(37, 99, 235, 0.22);
    --theme-text-dark: #163b8d;
    --theme-ring: rgba(37, 99, 235, 0.25);
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;

    background-color: #f1f5f9;
    font-family: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    color: var(--text-primary);
    min-height: 100vh;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px 16px;
}

.inone-login-body .is-hidden {
    display: none !important;
}

.inone-lang-corner {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 20;
}

.inone-lang-select {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 6px 10px;
    font-size: 12.5px;
    color: #334155;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.login-wrapper {
    width: 100%;
    max-width: 400px;
    position: relative;
}

.login-card {
    background: var(--card-bg);
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
    padding: 32px 24px;
    width: 100%;
    border-radius: 20px;
    text-align: center;
    position: relative;
}

.login-brand-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 22px;
}

.login-logo-flex {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.login-logo-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    object-fit: contain;
    display: block;
}

.login-logo-text {
    font-family: 'Nunito', 'Inter', 'Roboto', sans-serif;
    font-weight: 900;
    font-size: 21px;
    color: #0f172a;
    letter-spacing: 0.10em;
}

.segment-tab-container {
    display: flex;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 22px;
    gap: 4px;
}

.segment-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 14px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.segment-tab svg {
    width: 16px;
    height: 16px;
    transition: color 0.2s ease;
}

.segment-tab:hover:not(.active) {
    color: #1e293b;
}

.segment-tab.active {
    background: #ffffff;
    color: var(--theme-primary);
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.segment-tab.active svg {
    color: var(--theme-primary);
}

.approve-number-card {
    background: var(--theme-light);
    border: 1px solid var(--theme-border);
    border-radius: 14px;
    padding: 12px 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.approve-number-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--theme-text-dark);
    letter-spacing: -0.01em;
}

.approve-number-code {
    font-size: 28px;
    font-weight: 900;
    color: var(--theme-primary);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    letter-spacing: 0.05em;
    line-height: 1;
}

.qr-card-container {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.06), 0 0 1px rgba(0, 0, 0, 0.08);
    position: relative;
    margin-bottom: 18px;
    min-width: 236px;
    min-height: 236px;
}

#qrLoginCanvas {
    display: block;
    border-radius: 8px;
}

.qr-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.94);
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(2px);
    z-index: 10;
}

.qr-overlay-loading-text {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-top: 10px;
}

.qr-overlay-approved-text {
    font-size: 13px;
    font-weight: 700;
    color: #059669;
    margin-top: 10px;
}

.qr-overlay-expired-msg {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin: 8px 0 12px;
    text-align: center;
}

.btn-qr-refresh-sm {
    width: auto;
    height: 32px;
    padding: 0 16px;
    font-size: 12px;
}

.qr-scanned-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
    background: #f59e0b;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    padding: 3px 8px;
    border-radius: 9999px;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.35);
    z-index: 5;
}

.qr-scanned-badge .ping-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffffff;
    animation: inone-pulse-ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.qr-radar-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 6px;
}

.radar-dot-wrap {
    position: relative;
    display: inline-flex;
    width: 8px;
    height: 8px;
    flex-shrink: 0;
}

.radar-ping {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #10b981;
    opacity: 0.75;
    animation: inone-radar-ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.radar-core {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #10b981;
}

@keyframes inone-radar-ping {
    75%, 100% {
        transform: scale(2.4);
        opacity: 0;
    }
}

@keyframes inone-pulse-ping {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.qr-radar-text {
    font-size: 13px;
    font-weight: 500;
    color: #475569;
}

.qr-expiry-line {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 18px;
}

.qr-expiry-line strong {
    color: #475569;
    font-weight: 600;
}

.qr-refresh-btn {
    background: transparent;
    border: none;
    color: var(--theme-primary);
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    font-size: 12px;
    transition: color 0.15s ease;
}

.qr-refresh-btn:hover {
    text-decoration: underline;
    color: var(--theme-hover);
}

.totp-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.15s ease;
    margin-bottom: 8px;
}

.totp-toggle-btn:hover {
    color: var(--theme-primary);
}

.totp-toggle-btn svg {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
}

.totp-toggle-btn.expanded svg {
    transform: rotate(180deg);
}

.totp-fallback-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px;
    text-align: left;
    margin-top: 6px;
    margin-bottom: 16px;
}

.totp-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.totp-input-text {
    width: 100%;
    height: 38px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    color: #1e293b;
    background: #ffffff;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    margin-bottom: 12px;
}

.totp-input-text:focus {
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 3px var(--theme-ring);
}

.totp-input-code {
    width: 100%;
    height: 44px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 800;
    text-align: center;
    letter-spacing: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    color: #0f172a;
    background: #ffffff;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    margin-bottom: 14px;
}

.totp-input-code:focus {
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 3px var(--theme-ring);
}

.btn-theme-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 42px;
    background: var(--theme-primary);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

.btn-theme-submit:hover {
    background: var(--theme-hover);
}

.btn-theme-submit:active {
    transform: translateY(1px);
}

.btn-theme-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.form-group-custom {
    position: relative;
    margin-bottom: 16px;
    text-align: left;
}

.input-field-custom {
    width: 100%;
    height: 42px;
    padding: 8px 38px 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    color: #1e293b;
    background: #ffffff;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-field-custom:focus {
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 3px var(--theme-ring);
}

.input-icon-right {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-icon-right.interactive {
    cursor: pointer;
}

.input-icon-btn {
    background: transparent;
    border: none;
    padding: 4px;
}

.input-icon-btn:hover {
    color: var(--theme-primary);
}

.form-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    font-size: 13px;
}

.checkbox-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: #475569;
    font-size: 13px;
}

.checkbox-wrap input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--theme-primary);
    border-radius: 4px;
}

.forgot-link {
    color: var(--theme-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: color 0.15s ease;
}

.forgot-link:hover {
    color: var(--theme-hover);
    text-decoration: underline;
}

.alert-box {
    font-size: 13px;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 18px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.4;
}

.alert-box-icon {
    flex-shrink: 0;
}

.alert-box-danger {
    color: #991b1b;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
}

.alert-box-success {
    color: #166534;
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.legal-footer {
    font-size: 12.5px;
    color: #64748b;
    line-height: 1.5;
    margin-top: 18px;
}

.legal-footer a {
    color: var(--theme-primary);
    text-decoration: none;
    font-weight: 600;
}

.legal-footer a:hover {
    color: var(--theme-hover);
    text-decoration: underline;
}

.spinner-svg {
    animation: inone-spin 1s linear infinite;
}

@keyframes inone-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
