:root {
    --brand-primary: #6366F1;
    --brand-primary-hover: #4F46E5;
    --bg-primary: #F8FAFC;
    --bg-secondary: #FFFFFF;
    --bg-card: #FFFFFF;
    --border-color: #E2E8F0;
    --text-primary: #0F172A;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;
    --border-radius-sm: 6px;
    --border-radius-md: 10px;
    --border-radius-lg: 16px;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
body.animations-paused *,
body.animations-paused *::before,
body.animations-paused *::after {
  animation-play-state: paused !important;
  transition: none !important;
}

#whiteboard-canvas {
  image-rendering: auto;
}

.sidebar,
#notebook-panel,
#section-panel,
#settings-modal,
#pages-panel {
  content-visibility: auto;
  contain-intrinsic-size: 0 500px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body.zen-mode .sidebar,
body.zen-mode header,
body.zen-mode #floating-toolbar,
body.zen-mode #btn-open-sidebar,
body.zen-mode .workspace-header {
    display: none !important;
}

body.zen-mode #whiteboard-container {
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
}

.btn-exit-zen {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
    background: rgba(15, 23, 42, 0.88);
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.btn-exit-zen:hover {
    background: #6366F1;
    transform: translateY(-2px);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.85);
    backdrop-filter: none;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s ease;
}

.modal.show,
.modal.active {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.modal-content {
    background: var(--bg-card, #FFFFFF);
    border: 1px solid var(--border-color, #E2E8F0);
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 520px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.95) translateY(10px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 90vh;
    overflow-y: auto;
    color: var(--text-primary, #1E293B);
}

.modal.show .modal-content,
.modal.active .modal-content {
    transform: scale(1) translateY(0);
}

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

:root {
    --bg-primary: #F8FAFC;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #F1F5F9;
    --bg-glass: rgba(255, 255, 255, 0.82);
    --bg-glass-dark: rgba(15, 23, 42, 0.85);
    
    --brand-primary: #6366F1; 
    --brand-dark: #4338CA;
    --brand-light: #818CF8;
    --brand-accent: #10B981; 
    --brand-accent-glow: rgba(99, 102, 241, 0.3);
    
    --text-primary: #0F172A;
    --text-secondary: #334155;
    --text-muted: #64748B;
    
    --border-color: #E2E8F0;
    --border-focus: #6366F1;
    --border-glass: rgba(255, 255, 255, 0.6);
    
    --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 14px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 12px 28px -4px rgba(15, 23, 42, 0.12), 0 4px 10px -2px rgba(15, 23, 42, 0.06);
    --shadow-xl: 0 20px 40px -6px rgba(15, 23, 42, 0.16), 0 8px 16px -4px rgba(15, 23, 42, 0.08);
    --shadow-glow: 0 0 22px rgba(99, 102, 241, 0.35);
    --shadow-indigo-glow: 0 0 22px rgba(99, 102, 241, 0.35);

    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 20px;
    --border-radius-pill: 9999px;

    --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.preset-btn {
    position: relative;
    overflow: hidden;
}

.preset-color-border {
    position: absolute;
    right: 3px;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 22px;
    border-radius: 4px;
    box-shadow: 0 0 4px rgba(0,0,0,0.2);
}

.preset-divider {
    width: 26px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    margin: 2px 0;
}

.vertical-slider-group {
    align-items: center;
    gap: 6px;
}

.vertical-slider-wrapper {
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vertical-slider {
    appearance: none;
    -webkit-appearance: none;
    writing-mode: vertical-lr;
    direction: rtl;
    width: 18px;
    height: 110px;
    cursor: pointer;
    accent-color: var(--brand-primary);
}

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

html {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(99, 102, 241, 0.16), transparent 28%),
        radial-gradient(circle at bottom right, rgba(16, 185, 129, 0.14), transparent 26%),
        linear-gradient(135deg, #f8faff 0%, #f5f7ff 48%, #eef3ff 100%);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

body::before,
body::after {
    content: '';
    position: fixed;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    opacity: 0.25;
    pointer-events: none;
    z-index: -1;
}

body::before {
    top: -180px;
    left: -120px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, transparent 70%);
}

body::after {
    right: -140px;
    bottom: -200px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.25) 0%, transparent 70%);
}

*::selection {
    background: rgba(99, 102, 241, 0.24);
    color: var(--text-primary);
}

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.28) transparent;
}

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.35), rgba(99, 102, 241, 0.18));
    border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.5), rgba(99, 102, 241, 0.3));
}

.screen {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

#dashboard-screen {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

#dashboard-screen.active {
    display: flex;
    flex-direction: row;
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

#toast-container {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    color: var(--text-primary);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-left: 4px solid var(--brand-primary);
    padding: 14px 22px;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-xl);
    font-size: 14px;
    font-weight: 500;
    min-width: 280px;
    animation: toast-slide-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast.warning {
    border-left-color: #F59E0B;
}

.toast.error {
    border-left-color: #EF4444;
}

.toast.success {
    border-left-color: #10B981;
}

@keyframes toast-slide-in {
    from { transform: translateX(120%) scale(0.9); opacity: 0; }
    to { transform: translateX(0) scale(1); opacity: 1; }
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    border: none;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,0.18) 50%, transparent 100%);
    transform: translateX(-120%);
    transition: transform 0.45s ease;
}

.btn:hover::after {
    transform: translateX(120%);
}

.btn-primary {
    background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #818CF8 0%, #6366F1 100%);
    box-shadow: var(--shadow-glow), 0 6px 18px rgba(99, 102, 241, 0.45);
    transform: translateY(-1px);
}

.btn-secondary {
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    color: var(--text-primary);
    border: 1px solid rgba(99, 102, 241, 0.16);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
}

.btn-secondary:hover {
    background-color: #E2E8F0;
    transform: translateY(-1px);
}

.btn-icon {
    background: transparent;
    padding: 9px;
    border-radius: 50%;
    color: var(--text-secondary);
}

.btn-icon:hover {
    background-color: rgba(99, 102, 241, 0.12);
    color: var(--brand-primary);
    transform: scale(1.08);
}

.btn-text {
    background: transparent;
    color: var(--brand-primary);
    padding: 6px 14px;
}

.btn-text:hover {
    background-color: rgba(99, 102, 241, 0.1);
    border-radius: var(--border-radius-sm);
}

#login-screen {
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at 50% 35%, #1E1B4B 0%, #0F172A 60%, #020617 100%);
    position: relative;
    overflow: hidden;
}

#login-screen::before {
    content: '';
    position: absolute;
    width: 650px;
    height: 650px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.28) 0%, rgba(16, 185, 129, 0.15) 50%, transparent 70%);
    top: -120px;
    left: -120px;
    pointer-events: none;
}

#login-screen::after {
    content: '';
    position: absolute;
    width: 550px;
    height: 550px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.22) 0%, rgba(99, 102, 241, 0.15) 50%, transparent 70%);
    bottom: -120px;
    right: -120px;
    pointer-events: none;
}

@keyframes ambient-float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(40px, 30px) scale(1.1); }
}

.login-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 52px 44px;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.9);
    width: 100%;
    max-width: 440px;
    text-align: center;
    position: relative;
    z-index: 10;
}

.nestpad-brand-mark {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.nestpad-logo-badge {
    background: linear-gradient(135deg, #818CF8 0%, #6366F1 50%, #4338CA 100%);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.5);
    position: relative;
    transition: transform 0.3s ease;
}

.nestpad-logo-badge:hover {
    transform: scale(1.05) rotate(2deg);
}

.app-logo-img {
    object-fit: contain;
    border-radius: 14px;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.18));
}

.app-logo-img.large {
    width: 76px;
    height: 76px;
}

.app-logo-img.small {
    width: 34px;
    height: 34px;
    border-radius: 9px;
}

.login-card h2 {
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(135deg, #312E81 0%, #6366F1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.login-card .subtitle {
    color: var(--text-secondary);
    margin-bottom: 36px;
    font-size: 15px;
    line-height: 1.6;
}

.btn-login {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--border-radius-md);
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
    transition: var(--transition-normal);
}

.btn-login:hover {
    background: linear-gradient(135deg, #1E293B 0%, #334155 100%);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.35);
    transform: translateY(-2px);
}

.login-footer {
    margin-top: 36px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.app-header {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.97) 100%);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    color: white;
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    position: relative;
    overflow: hidden;
}

.app-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.16), transparent 40%, rgba(16, 185, 129, 0.14));
    pointer-events: none;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.3px;
    flex-shrink: 0;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    background: rgba(255, 255, 255, 0.12);
    padding: 6px 14px 6px 8px;
    border-radius: var(--border-radius-pill);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.user-profile span {
    font-size: 13px;
    font-weight: 700;
    color: #FFFFFF;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.user-profile .btn-icon,
.app-header .btn-icon {
    color: #FFFFFF !important;
    background: rgba(255, 255, 255, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
    width: 34px !important;
    height: 34px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    font-size: 15px !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.user-profile .btn-icon:hover,
.app-header .btn-icon:hover {
    color: #FFFFFF !important;
    background: #6366F1 !important;
    border-color: #818CF8 !important;
    box-shadow: 0 0 14px rgba(99, 102, 241, 0.7) !important;
    transform: scale(1.12) !important;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

/* ==============================================================
   NESTPAD 2.0 CREATIVE STUDIO DASHBOARD
   ============================================================== */

/* --- STUDIO LEFT SIDEBAR --- */
.studio-sidebar {
    width: 280px;
    min-width: 280px;
    max-width: 280px;
    height: 100vh;
    background: #FFFFFF;
    border-right: 1px solid rgba(226, 232, 240, 0.9);
    display: flex !important;
    flex-direction: column;
    padding: 20px 16px 16px;
    gap: 16px;
    z-index: 100;
    box-shadow: 2px 0 16px rgba(15, 23, 42, 0.03);
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    flex-shrink: 0;
}

/* Sidebar Brand Header */
.studio-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 6px 6px;
}

.studio-brand-badge {
    display: flex;
    align-items: center;
    gap: 10px;
}

.studio-brand-badge .app-logo-img {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.22);
    transition: transform 0.25s ease;
}

.studio-brand-badge:hover .app-logo-img {
    transform: rotate(-6deg) scale(1.06);
}

.studio-brand-meta {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.studio-brand-name {
    font-size: 17px;
    font-weight: 800;
    color: #0F172A;
    letter-spacing: -0.4px;
    line-height: 1.2;
}

.studio-version-tag {
    font-size: 10px;
    font-weight: 700;
    color: #10B981;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    letter-spacing: 0.2px;
}

/* Studio New Notebook Action Button */
.studio-sidebar-action {
    padding: 0 4px;
}

.btn-studio-create {
    width: 100%;
    background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
    color: #FFFFFF;
    border: none;
    border-radius: 12px;
    padding: 11px 16px;
    font-size: 13.5px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 6px 18px -2px rgba(99, 102, 241, 0.38);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-studio-create:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px -2px rgba(99, 102, 241, 0.48);
}

.btn-studio-create span {
    flex: 1;
    text-align: left;
}

.studio-kbd {
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    padding: 1px 6px;
    font-size: 11px;
    font-family: inherit;
    font-weight: 700;
    color: #FFFFFF;
}

/* Studio Nav Menu */
.studio-nav-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px 0;
}

.studio-nav-section-label {
    font-size: 10.5px;
    font-weight: 700;
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    padding: 4px 10px 4px;
}

.studio-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    background: transparent;
    border: none;
    color: #64748B;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: left;
    width: 100%;
}

.studio-nav-item:hover {
    background: #F1F5F9;
    color: #0F172A;
}

.studio-nav-item.active {
    background: rgba(99, 102, 241, 0.09);
    color: #6366F1;
    font-weight: 700;
}

.studio-nav-item .nav-item-icon {
    width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.studio-nav-item.active .nav-item-icon {
    color: #6366F1;
}

.studio-nav-item .nav-item-label {
    flex: 1;
}

.nav-count-badge {
    background: #F1F5F9;
    color: #64748B;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 100px;
    min-width: 20px;
    text-align: center;
    transition: all 0.2s ease;
}

.studio-nav-item.active .nav-count-badge {
    background: rgba(99, 102, 241, 0.16);
    color: #6366F1;
}

/* Sidebar Storage Telemetry Widget */
.studio-storage-widget {
    background: linear-gradient(180deg, #F8FAFC 0%, #F1F5F9 100%);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}

.studio-storage-widget .storage-widget-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.studio-storage-widget .storage-icon-badge {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: linear-gradient(135deg, #6366F1 0%, #4338CA 100%);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
    flex-shrink: 0;
}

.studio-storage-widget .storage-widget-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.studio-storage-widget #storage-plan-info {
    font-size: 12px;
    font-weight: 700;
    color: #0F172A;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.studio-storage-widget #storage-used-text {
    font-size: 11px;
    font-weight: 500;
    color: #64748B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.studio-storage-widget .storage-badge-pill {
    padding: 2px 7px;
    border-radius: 100px;
    font-size: 10px;
    font-weight: 800;
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.3);
    white-space: nowrap;
    flex-shrink: 0;
}

.studio-storage-widget .storage-badge-pill.warning {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
    border-color: rgba(245, 158, 11, 0.3);
}

.studio-storage-widget .storage-badge-pill.danger {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.3);
}

.studio-storage-widget .storage-progress-wrapper {
    width: 100%;
    height: 6px;
    background: rgba(226, 232, 240, 0.95);
    border-radius: 999px;
    overflow: hidden;
}

.studio-storage-widget .storage-progress-bar {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #10B981 0%, #6366F1 50%, #8B5CF6 100%);
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.studio-storage-widget .storage-progress-bar.warning {
    background: linear-gradient(90deg, #6366F1 0%, #F59E0B 100%);
}

.studio-storage-widget .storage-progress-bar.danger {
    background: linear-gradient(90deg, #F59E0B 0%, #EF4444 100%);
}

.btn-storage-upgrade {
    background: #FFFFFF;
    border: 1px solid rgba(226, 232, 240, 0.95);
    color: #6366F1;
    font-size: 11.5px;
    font-weight: 700;
    padding: 7px 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.btn-storage-upgrade:hover {
    background: #6366F1;
    color: #FFFFFF;
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

/* Studio User Profile Dock */
.studio-user-dock {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(226, 232, 240, 0.9);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.studio-user-dock .user-identity-box {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    flex: 1;
    background: transparent;
    padding: 0;
    border: none;
}

.studio-user-dock .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #6366F1;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.25);
    flex-shrink: 0;
}

.studio-user-dock .user-meta-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.studio-user-dock #user-display-name {
    font-size: 12.5px;
    font-weight: 700;
    color: #0F172A;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.studio-user-dock .user-role-label {
    font-size: 10.5px;
    font-weight: 500;
    color: #94A3B8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dock-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.btn-dock-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: #FFFFFF;
    color: #64748B;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12.5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-dock-icon:hover {
    background: #F1F5F9;
    color: #0F172A;
    border-color: #CBD5E1;
}

.btn-dock-icon.logout:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #EF4444;
    border-color: rgba(239, 68, 68, 0.3);
}

/* --- STUDIO MAIN CANVAS --- */
.studio-main {
    flex: 1 1 0%;
    min-width: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #F8FAFC;
    position: relative;
}

/* Studio Top Control Bar */
.studio-top-bar {
    height: 64px;
    min-height: 64px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.85);
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    z-index: 40;
    flex-shrink: 0;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-menu-mobile {
    display: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: #FFFFFF;
    color: #475569;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-menu-mobile:hover {
    background: #F1F5F9;
    color: #0F172A;
}

/* Workspace Segmented Tabs Control */
.workspace-tabs-control {
    display: inline-flex;
    align-items: center;
    background: #EEF2F6;
    border-radius: 12px;
    padding: 3px;
    gap: 3px;
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.workspace-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 15px;
    border-radius: 9px;
    border: none;
    background: transparent;
    color: #64748B;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.workspace-tab-btn:hover {
    color: #0F172A;
}

.workspace-tab-btn.active {
    background: #FFFFFF;
    color: #0F172A;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.workspace-tab-btn .tab-badge {
    background: rgba(99, 102, 241, 0.12);
    color: #6366F1;
    font-size: 11px;
    font-weight: 800;
    padding: 1px 7px;
    border-radius: 100px;
    transition: all 0.2s ease;
}

.workspace-tab-btn.active .tab-badge {
    background: #6366F1;
    color: #FFFFFF;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.studio-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.studio-search-wrapper .search-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #94A3B8;
    font-size: 13px;
    pointer-events: none;
    transition: color 0.2s ease;
}

.studio-search-wrapper #dashboard-search-input {
    padding: 8px 14px 8px 36px;
    border-radius: 10px;
    border: 1px solid rgba(203, 213, 225, 0.85);
    background: #FFFFFF;
    font-size: 12.5px;
    font-weight: 500;
    color: #0F172A;
    outline: none;
    width: 210px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

.studio-search-wrapper #dashboard-search-input:focus {
    width: 260px;
    border-color: #6366F1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16);
}

.studio-search-wrapper #dashboard-search-input:focus + .search-icon {
    color: #6366F1;
}

/* Studio Body Canvas */
.studio-body,
.dashboard-content {
    flex: 1 1 0%;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 28px 32px 60px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
}

.workspace-tab-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: tab-fade-in 0.25s ease-out;
}

@keyframes tab-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.panel-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.panel-title-group h2 {
    font-size: 20px;
    font-weight: 800;
    color: #0F172A;
    letter-spacing: -0.4px;
    margin: 0 0 2px 0;
}

.panel-subtitle {
    font-size: 13px;
    color: #64748B;
    font-weight: 500;
}

/* Fallback/compatibility */
.dashboard-welcome-banner {
    display: none !important;
}

/* Media queries for Studio Dashboard */
@media (max-width: 900px) {
    #dashboard-screen.active {
        flex-direction: column;
    }

    .studio-sidebar {
        position: fixed !important;
        top: 0;
        bottom: 0;
        left: 0;
        width: 280px;
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: 0 0 35px rgba(0, 0, 0, 0.25);
    }

    .studio-sidebar.mobile-open {
        transform: translateX(0);
    }

    .btn-menu-mobile {
        display: inline-flex !important;
    }

    .studio-top-bar {
        padding: 0 16px;
    }

    .studio-body,
    .dashboard-content {
        padding: 20px 16px 40px;
    }

    .studio-search-wrapper #dashboard-search-input {
        width: 140px;
    }

    .studio-search-wrapper #dashboard-search-input:focus {
        width: 180px;
    }

    .workspace-tab-btn span:not(.tab-badge) {
        display: none;
    }
}

/* NOTEBOOK VIEW SWITCHER */
.notebook-view-switcher {
    display: inline-flex;
    align-items: center;
    background: #F1F5F9;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 12px;
    padding: 3px;
    gap: 3px;
}

.view-switch-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 9px;
    border: none;
    background: transparent;
    color: #64748B;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.view-switch-btn:hover {
    color: #0F172A;
}

.view-switch-btn.active {
    background: #FFFFFF;
    color: #6366F1;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

/* NOTEBOOKS GRID & CARDS (DEFAULT / CARDS VIEW) */
.notebooks-grid,
.notebooks-grid.view-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

.notebook-card {
    background: #FFFFFF;
    border-radius: 20px;
    box-shadow: 0 8px 24px -4px rgba(15, 23, 42, 0.06), 0 0 0 1px rgba(226, 232, 240, 0.85);
    border: 1px solid rgba(226, 232, 240, 0.85);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    animation: card-rise-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.notebook-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 38px -8px rgba(15, 23, 42, 0.12), 0 0 20px -2px rgba(99, 102, 241, 0.16);
    border-color: rgba(99, 102, 241, 0.45);
}

/* Notebook Cover & Inner Details */
.notebook-cover {
    height: 140px;
    width: 100%;
    position: relative;
    overflow: hidden;
    transition: transform 0.35s ease;
}

.notebook-cover::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.22) 1px, transparent 1px);
    background-size: 14px 14px;
    opacity: 0.65;
    pointer-events: none;
}

.notebook-cover::after {
    content: '';
    position: absolute;
    inset: -30% -10% auto auto;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.32) 0%, transparent 65%);
    transform: rotate(25deg);
    pointer-events: none;
}

.notebook-card:hover .notebook-cover {
    transform: scale(1.02);
}

/* Realistic Notebook Spine Effect */
.notebook-spine {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 14px;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.12) 50%, transparent 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.15);
    z-index: 3;
    pointer-events: none;
}

/* Notebook Decorative Bookmark Ribbon */
.notebook-bookmark-ribbon {
    position: absolute;
    top: 0;
    right: 22px;
    width: 13px;
    height: 30px;
    background: rgba(255, 255, 255, 0.95);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
    z-index: 3;
    pointer-events: none;
}

/* Notebook Center Glyph Badge */
.notebook-glyph-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-size: 18px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 2;
    pointer-events: none;
}

.notebook-card:hover .notebook-glyph-badge {
    transform: translate(-50%, -50%) scale(1.12);
    background: rgba(255, 255, 255, 0.28);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.notebook-cover-tag {
    position: absolute;
    top: 14px;
    left: 22px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 4px 11px;
    border-radius: 100px;
    font-size: 10px;
    font-weight: 800;
    color: #0F172A;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.5);
    z-index: 4;
}

.notebook-size-tag {
    position: absolute;
    bottom: 12px;
    right: 12px;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.96);
    background: rgba(15, 23, 42, 0.72);
    padding: 3px 10px;
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2;
}

.notebook-card-body {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #FFFFFF;
    flex: 1;
}

.notebook-title {
    font-size: 16px;
    font-weight: 700;
    color: #0F172A;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.2px;
}

.notebook-subtitle {
    font-size: 12px;
    color: #64748B;
    font-weight: 600;
}

.notebook-meta-sublabel {
    font-size: 11px;
    font-weight: 600;
    color: #94A3B8;
    display: flex;
    align-items: center;
    gap: 6px;
}

.notebook-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 10px;
    border-top: 1px solid #F1F5F9;
    padding-top: 12px;
}

.notebook-card-actions button {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 12px;
    border: 1px solid rgba(226, 232, 240, 0.85);
    background: #F8FAFC;
    color: #64748B;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.notebook-card-actions button:hover {
    background: #6366F1;
    color: #FFFFFF;
    border-color: #6366F1;
    transform: scale(1.06);
}

.notebook-card-actions button.btn-delete-nb:hover {
    background: #EF4444;
    color: #FFFFFF;
    border-color: #EF4444;
}

/* ==============================================================
   LAYOUT 2: LIST VIEW (.notebooks-grid.view-list)
   ============================================================== */
.notebooks-grid.view-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notebooks-grid.view-list .notebook-card {
    flex-direction: row;
    align-items: center;
    border-radius: 16px;
    padding: 12px 20px;
    gap: 16px;
    min-height: 72px;
    background: linear-gradient(315deg, 
        color-mix(in srgb, var(--nb-border-color, #6366F1) 85%, transparent) 0%, 
        color-mix(in srgb, var(--nb-border-color, #6366F1) 75%, transparent) 33.3%, 
        color-mix(in srgb, var(--nb-border-color, #6366F1) 30%, transparent) 48%, 
        transparent 66%), #FFFFFF;
    border-right: 5px solid var(--nb-border-color, #6366F1);
    box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.04), 0 0 0 1px rgba(226, 232, 240, 0.85);
    position: relative;
    overflow: hidden;
    transition: all 0.9s ease;
}

.notebooks-grid.view-list .notebook-card:hover {
    transform: translateX(4px);
    background: linear-gradient(225deg, 
        color-mix(in srgb, var(--nb-border-color, #6366F1) 95%, transparent) 0%, 
        color-mix(in srgb, var(--nb-border-color, #6366F1) 85%, transparent) 33.3%, 
        color-mix(in srgb, var(--nb-border-color, #6366F1) 40%, transparent) 50%, 
        transparent 68%), #FFFFFF;
    box-shadow: 0 10px 24px -4px rgba(15, 23, 42, 0.1), 0 0 20px color-mix(in srgb, var(--nb-border-color, #6366F1) 35%, transparent);
}

.notebooks-grid.view-list .notebook-cover {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    flex-shrink: 0;
}

.notebooks-grid.view-list .notebook-spine {
    width: 8px;
}

.notebooks-grid.view-list .notebook-bookmark-ribbon,
.notebooks-grid.view-list .notebook-cover-tag,
.notebooks-grid.view-list .notebook-size-tag {
    display: none;
}

.notebooks-grid.view-list .notebook-glyph-badge {
    width: 28px;
    height: 28px;
    font-size: 13px;
    border-radius: 8px;
}

.notebooks-grid.view-list .notebook-card-body {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    flex: 1;
    gap: 20px;
    background: transparent;
}

.notebooks-grid.view-list .notebook-info-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.notebooks-grid.view-list .notebook-meta-badges {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.notebooks-grid.view-list .notebook-card-actions {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    flex-shrink: 0;
    z-index: 2;
}

.notebooks-grid.view-list .notebook-card-actions button {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    color: #0F172A;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.notebooks-grid.view-list .notebook-card-actions button:hover {
    background: #FFFFFF;
    color: var(--nb-border-color, #6366F1);
    border-color: #FFFFFF;
    transform: scale(1.12);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

/* ==============================================================
   LAYOUT 3: TABS VIEW (.notebooks-grid.view-tabs)
   ============================================================== */
.notebooks-grid.view-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.notebooks-grid.view-tabs .notebook-card {
    border-radius: 14px;
    padding: 14px 18px;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    min-height: 58px;
    position: relative;
    background: var(--nb-border-color, #6366F1);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    color: #FFFFFF;
}

.notebooks-grid.view-tabs .notebook-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px -4px rgba(15, 23, 42, 0.16), 0 0 18px color-mix(in srgb, var(--nb-border-color, #6366F1) 45%, transparent);
}

.notebooks-grid.view-tabs .notebook-cover {
    display: none;
}

.notebooks-grid.view-tabs .notebook-card-body {
    padding: 0;
    background: transparent;
    flex: 1;
    min-width: 0;
    gap: 4px;
}

.notebooks-grid.view-tabs .notebook-title {
    font-size: 14px;
    font-weight: 700;
    color: #FFFFFF !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
}

.notebooks-grid.view-tabs .notebook-subtitle {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.88) !important;
    font-weight: 600;
}

.notebooks-grid.view-tabs .notebook-meta-sublabel {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.88) !important;
    font-weight: 600;
}

.notebooks-grid.view-tabs .notebook-meta-sublabel i {
    color: rgba(255, 255, 255, 0.95) !important;
}

.notebooks-grid.view-tabs .notebook-card-actions {
    display: none;
}

.notebooks-grid.view-tabs .notebook-card:hover .notebook-card-actions {
    display: flex;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 4px;
    border-radius: 9px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.25);
    margin-top: 0;
    border-top: none;
    z-index: 10;
}

.notebooks-grid.view-tabs .notebook-card-actions button {
    background: rgba(255, 255, 255, 0.18);
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.notebooks-grid.view-tabs .notebook-card-actions button:hover {
    background: #FFFFFF;
    color: #0F172A;
}

.notebooks-grid.view-tabs .notebook-card-actions button.btn-delete-nb:hover {
    background: #EF4444;
    color: #FFFFFF;
    border-color: #EF4444;
}


/* EMPTY STATES */
.empty-text {
    padding: 40px 24px;
    text-align: center;
    background: #F8FAFC;
    border: 2px dashed rgba(203, 213, 225, 0.7);
    border-radius: 20px;
    color: #64748B;
    font-size: 14px;
    font-weight: 600;
    grid-column: 1 / -1;
}

/* DASHBOARD FOOTER */
.dashboard-footer {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid rgba(226, 232, 240, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
}

#app-screen {
    flex-direction: row;
    height: 100vh;
}

/* ==============================================================
   WORKSPACE TOP FLOATING BAR & OVERHAULED NOTEBOOK SIDEBAR
   ============================================================== */

/* --- WORKSPACE TOP FLOATING BAR --- */
.workspace-top-bar {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 150;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 100px;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(255, 255, 255, 0.6);
    pointer-events: auto;
    max-width: calc(100% - 48px);
    white-space: nowrap;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.workspace-top-bar:hover {
    box-shadow: 0 8px 28px -4px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(99, 102, 241, 0.2);
}

.top-bar-left-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.top-bar-brand {
    display: flex;
    align-items: center;
    gap: 7px;
}

.top-bar-logo {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.25);
    transition: transform 0.2s ease;
}

.top-bar-brand:hover .top-bar-logo {
    transform: rotate(-6deg) scale(1.08);
}

.top-bar-brand-name {
    font-size: 14.5px;
    font-weight: 800;
    color: #0F172A;
    letter-spacing: -0.3px;
}

.top-bar-pill {
    font-size: 10px;
    font-weight: 800;
    padding: 1px 7px;
    border-radius: 100px;
    background: rgba(99, 102, 241, 0.1);
    color: #6366F1;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.top-bar-divider {
    width: 1px;
    height: 18px;
    background: rgba(226, 232, 240, 0.95);
    margin: 0 2px;
}

.top-bar-context {
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 220px;
}

.top-bar-context-icon {
    font-size: 11px;
    color: #6366F1;
}

.top-bar-context-title {
    font-size: 12.5px;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-bar-center-group {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.top-bar-zelleo.zelleo-powered-footer {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    color: #64748B;
    background: #F8FAFC;
    padding: 3px 10px 3px 12px;
    border-radius: 100px;
    border: 1px solid rgba(226, 232, 240, 0.9);
}

.top-bar-zelleo .zelleo-footer-img {
    height: 24px;
    width: auto;
    max-width: 65px;
}

.top-bar-right-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.top-bar-user-pill {
    display: flex;
    align-items: center;
    gap: 7px;
    background: #F8FAFC;
    padding: 3px 10px 3px 4px;
    border-radius: 100px;
    border: 1px solid rgba(226, 232, 240, 0.9);
}

.top-bar-user-pill .avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1.5px solid #6366F1;
    box-shadow: 0 1px 4px rgba(99, 102, 241, 0.2);
}

.top-bar-user-pill #workspace-user-name {
    font-size: 12px;
    font-weight: 700;
    color: #0F172A;
    max-width: 110px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-bar-action-btn {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: #F8FAFC;
    color: #64748B;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.top-bar-action-btn:hover {
    background: #6366F1;
    color: #FFFFFF;
    border-color: #6366F1;
    transform: scale(1.06);
    box-shadow: 0 3px 10px rgba(99, 102, 241, 0.3);
}

/* --- OVERHAULED NOTEBOOK SIDEBAR --- */
.sidebar {
    width: 320px;
    background: #FFFFFF;
    border-left: 1px solid rgba(226, 232, 240, 0.9);
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 28px rgba(15, 23, 42, 0.04);
    order: 2;
    z-index: 100;
    transition: margin-right 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar.collapsed {
    margin-right: -320px;
    opacity: 0;
    pointer-events: none;
}

.sidebar-header {
    padding: 16px 18px 14px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.85);
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #FFFFFF;
}

.sidebar-nav-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.btn-sidebar-back {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border-radius: 8px;
    background: #F8FAFC;
    border: 1px solid rgba(226, 232, 240, 0.95);
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-sidebar-back:hover {
    background: rgba(99, 102, 241, 0.08);
    color: #6366F1;
    border-color: rgba(99, 102, 241, 0.25);
    transform: translateX(-2px);
}

.sidebar-header-tools {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-sidebar-tool {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: #FFFFFF;
    color: #64748B;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-sidebar-tool:hover {
    background: #F1F5F9;
    color: #0F172A;
    border-color: #CBD5E1;
}

/* Notebook Identity Hero Card */
.notebook-identity-card {
    background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 12px;
    padding: 12px 14px;
    position: relative;
    overflow: hidden;
    display: flex;
    gap: 10px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.03);
}

.notebook-identity-color-stripe {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--brand-primary, #6366F1);
}

.notebook-identity-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
    padding-left: 2px;
}

.notebook-identity-tag {
    font-size: 10px;
    font-weight: 700;
    color: #6366F1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.notebook-title-display {
    font-size: 15px;
    font-weight: 800;
    color: #0F172A;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.3px;
    line-height: 1.25;
}

/* Hierarchy Navigation Body */
.hierarchy-container {
    flex: 1;
    overflow-y: auto;
    padding: 14px 14px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tree-search-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.tree-search-wrapper input {
    width: 100%;
    padding: 7px 12px 7px 32px;
    border-radius: 8px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    background: #F8FAFC;
    font-size: 12px;
    font-weight: 500;
    color: #0F172A;
    outline: none;
    transition: all 0.2s ease;
}

.tree-search-wrapper input:focus {
    border-color: #6366F1;
    background: #FFFFFF;
    box-shadow: 0 0 0 2.5px rgba(99, 102, 241, 0.15);
}

.tree-search-wrapper .search-icon {
    position: absolute;
    left: 10px;
    color: #94A3B8;
    font-size: 12px;
    pointer-events: none;
}

.tree-section-header {
    font-size: 10.5px;
    font-weight: 800;
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    padding: 4px 4px 2px;
    margin: 0;
}

.tree-root {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.tree-item {
    display: flex;
    flex-direction: column;
}

.tree-row {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    min-height: 42px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: #475569;
    transition: all 0.18s ease;
    gap: 8px;
    position: relative;
    user-select: none;
    margin: 1px 0;
    border: 1px solid transparent;
}

.tree-row:hover {
    background: #F8FAFC;
    color: #0F172A;
    border-color: rgba(226, 232, 240, 0.85);
    transform: translateX(2px);
}

.tree-row.active {
    background: rgba(99, 102, 241, 0.08);
    color: #6366F1;
    font-weight: 700;
    border-color: rgba(99, 102, 241, 0.25);
    box-shadow: inset 3px 0 0 #6366F1;
}

.tree-row.drag-over {
    border-bottom: 2px solid #6366F1;
    background-color: rgba(99, 102, 241, 0.12);
}

.tree-row .expander {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94A3B8;
    transition: transform 0.2s ease;
}

.tree-row .expander.expanded {
    transform: rotate(90deg);
}

.tree-row-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.tree-row-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 1px;
}

.tree-row-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}

.tree-row-date {
    font-size: 10.5px;
    color: #94A3B8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tree-row-actions {
    display: none;
    align-items: center;
    gap: 3px;
    margin-left: auto;
}

.tree-row:hover .tree-row-actions {
    display: flex;
}

.tree-row-actions button {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: #FFFFFF;
    color: #64748B;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tree-row-actions button:hover {
    background: #6366F1;
    color: #FFFFFF;
    border-color: #6366F1;
}

.tree-row-actions button.btn-tree-delete:hover {
    background: #EF4444;
    color: #FFFFFF;
    border-color: #EF4444;
}

.tree-children {
    display: none;
    flex-direction: column;
    border-left: 1.5px solid rgba(226, 232, 240, 0.85);
    margin-left: 18px;
    padding-left: 6px;
    gap: 1px;
}

.tree-children.expanded {
    display: flex;
}

.tree-item.level-section > .tree-row { padding-left: 10px; }
.tree-item.level-section > .tree-children .tree-row { padding-left: 8px; }
.tree-item.level-chapter > .tree-children .tree-row { padding-left: 8px; }

/* Add Section Card Row */
.btn-add-section-card {
    border: 1.5px dashed rgba(99, 102, 241, 0.35);
    background: rgba(99, 102, 241, 0.04);
    border-radius: 10px;
    padding: 9px 14px;
    color: #6366F1;
    font-size: 12.5px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.btn-add-section-card:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: #6366F1;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(99, 102, 241, 0.12);
}

/* Sidebar Status Footer */
.sidebar-footer {
    padding: 10px 16px;
    border-top: 1px solid rgba(226, 232, 240, 0.85);
    background: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-status-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #64748B;
}

.banner-pulse-dot.mini {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #22C55E;
    box-shadow: 0 0 6px #22C55E;
}

/* Open Sidebar Floating Trigger */
.sidebar-open-trigger {
    position: absolute;
    top: 16px;
    right: 18px;
    z-index: 250;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    display: none;
    align-items: center;
    justify-content: center;
    color: #6366F1;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-open-trigger:hover {
    transform: scale(1.08);
    background: #6366F1;
    color: #FFFFFF;
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.3);
}

@media (max-width: 768px) {
    .workspace-top-bar {
        padding: 5px 12px;
        gap: 10px;
        max-width: calc(100% - 24px);
    }

    .top-bar-context {
        display: none;
    }

    .top-bar-divider {
        display: none;
    }

    .top-bar-zelleo span {
        display: none;
    }
}

.workspace {
    flex: 1;
    height: 100%;
    position: relative;
    overflow: hidden;
    order: 1; 
}

.whiteboard-container {
    width: 100%;
    height: 100%;
    position: relative;
    background-color: #FFFFFF;
    touch-action: none;
}

#whiteboard-canvas,
canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    touch-action: none;
}

.floating-toolbar {
    position: absolute;
    top: 50%;
    left: 24px;
    transform: translateY(-50%);
    background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(248,250,252,0.96) 100%);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid rgba(226, 232, 240, 0.7);
    box-shadow: 0 16px 35px rgba(15, 23, 42, 0.12);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    padding: 8px;
    gap: 4px;
    z-index: 200;
    transition: left 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow var(--transition-fast), transform var(--transition-fast);
}

/* In PDF Studio: Float beside thumbnail sidebar when visible */
body.in-pdf-studio .floating-toolbar {
    left: calc(220px + 20px);
}

/* When thumbnail sidebar is collapsed in PDF Studio: Return to original position */
body.in-pdf-studio.pdf-sidebar-collapsed .floating-toolbar {
    left: 24px;
}

body.in-pdf-studio #bottom-right-controls {
    display: none !important;
}

/* In PDF Studio: Hide floating canvas top bar so only the combined studio top bar is shown */
body.in-pdf-studio #workspace-top-bar {
    display: none !important;
}




.floating-toolbar:hover {
    transform: translateY(-50%) translateY(-3px);
}

.floating-toolbar:hover {
    box-shadow: var(--shadow-xl), var(--shadow-glow);
}

.drag-handle-bar {
    text-align: center;
    color: var(--text-muted);
    font-size: 10px;
    padding: 2px 0;
    cursor: move;
}

.tool-buttons {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tool-btn {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    border: 1px solid transparent;
    background: transparent;
    color: #0F172A;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast), background var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
    position: relative;
}

.tool-btn:hover {
    background-color: rgba(99, 102, 241, 0.12);
    color: var(--brand-dark);
    transform: scale(1.05);
}

.tool-btn.active {
    background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
    color: white;
    box-shadow: 0 8px 18px rgba(99, 102, 241, 0.35);
    transform: scale(1.06);
}

.tool-options-container {
    position: absolute;
    left: 68px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255, 255, 255, 0.6);
    border-radius: 32px; 
    width: 56px;
    max-height: 80vh;
    overflow-y: auto;
    scrollbar-width: none; 
    padding: 12px 6px;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 210;
    animation: dock-pop-in 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes dock-pop-in {
    from { opacity: 0; transform: translateY(-50%) translateX(-10px) scale(0.95); }
    to { opacity: 1; transform: translateY(-50%) translateX(0) scale(1); }
}

.tool-options-container::-webkit-scrollbar {
    display: none;
}

.shape-picker-bar {
    position: absolute;
    left: 135px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-xl), 0 0 20px rgba(16, 185, 129, 0.2);
    border-radius: 32px;
    width: 56px;
    max-height: 80vh;
    overflow-y: auto;
    scrollbar-width: none;
    padding: 12px 6px;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 220;
    animation: dock-pop-in 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.shape-picker-bar.show {
    display: flex;
}

.options-panel {
    display: none;
    width: 100%;
}

.options-panel.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.options-panel h4 {
    display: none; 
}

.option-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.option-group label {
    display: none; 
}

.color-presets {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform var(--transition-fast), border-color var(--transition-fast);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

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

.color-swatch.active {
    border-color: var(--brand-primary);
    transform: scale(1.12);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35);
}

.color-picker-wrapper {
    position: relative;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: conic-gradient(from 0deg, #ff0000, #ff8000, #ffff00, #00ff00, #00ffff, #0000ff, #8000ff, #ff00ff, #ff0000);
    border: 2px solid var(--border-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.color-picker-wrapper:hover {
    transform: scale(1.18);
    border-color: var(--brand-primary);
}

.color-picker-icon {
    font-size: 11px;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    z-index: 2;
}

.custom-color-picker {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    border-radius: 50%;
    border: none;
}

.shape-type-select {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.shape-picker-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.shape-type-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.shape-type-btn:hover {
    background-color: rgba(99, 102, 241, 0.12);
    color: var(--brand-primary);
}

.shape-type-btn.active {
    background-color: var(--brand-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.slider {
    width: 100%;
    accent-color: var(--brand-primary);
}

.dropdown-style {
    width: 100%;
    padding: 6px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background-color: white;
}

.font-style-row {
    display: flex;
    gap: 4px;
}

.text-format-btn {
    flex: 1;
    padding: 6px;
    border: 1px solid var(--border-color);
    background: transparent;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
}

.text-format-btn.active {
    background-color: rgba(99, 102, 241, 0.15);
    color: var(--brand-primary);
}

.eraser-mode-select {
    display: flex;
    gap: 6px;
}

.canvas-controls {
    position: absolute;
    bottom: 28px;
    right: 28px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 100;
}

.control-btn {
    background: rgba(255,255,255,0.98);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #0F172A;
    font-size: 16px;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.control-btn:hover {
    color: #4F46E5;
    background-color: #FFFFFF;
    border-color: #6366F1;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
    transform: translateY(-2px);
}

.control-btn.active {
    background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
    color: #FFFFFF;
    border-color: #4338CA;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.5);
}

.zoom-controls-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
    border-radius: 16px;
    overflow: hidden;
    padding: 3px;
}

.zoom-controls-wrapper .control-btn {
    box-shadow: none;
    border: none;
    background: transparent;
    width: 36px;
    height: 36px;
}

.zoom-display {
    padding: 0 14px;
}

.timer-visual-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 950;
}

.timer-visual-overlay.show {
    opacity: 1;
    background: radial-gradient(circle at center, rgba(239, 68, 68, 0.18) 0%, rgba(239, 68, 68, 0) 52%);
}

.timer-alert-modal-content {
    border: 1px solid rgba(239, 68, 68, 0.18);
    background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(254,242,242,0.95) 100%);
}

.alert-badge {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.12);
    color: #DC2626;
    font-size: 20px;
}

.timer-alert-controls .btn {
    min-width: 130px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    border-radius: 999px;
    background-color: #d1d5db;
    transition: 0.25s ease;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    border-radius: 50%;
    transition: 0.25s ease;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

input:checked + .slider {
    background-color: #6366F1;
}

input:checked + .slider:before {
    transform: translateX(22px);
}

@keyframes timerPulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.04); opacity: 1; }
}

.control-btn#btn-toggle-timer.active {
    animation: timerPulse 1.2s ease-in-out infinite;
}

.autosave-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-md);
    border-radius: var(--border-radius-pill);
    font-size: 13px;
    font-weight: 600;
}

.autosave-indicator.unsaved {
    color: #EF4444;
}

.autosave-indicator.saving {
    color: #D97706;
}

.autosave-indicator.synced {
    color: #10B981;
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    bottom: 54px;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-xl);
    width: 190px;
    padding: 8px 0;
    display: none;
    flex-direction: column;
    animation: modal-zoom 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.dropdown-menu.show {
    display: flex;
}

.dropdown-header {
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.dropdown-item {
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.dropdown-item:hover {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--brand-dark);
}

.dropdown-item.active {
    background-color: rgba(99, 102, 241, 0.15);
    color: var(--brand-primary);
    font-weight: 700;
}

.dropdown-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 6px 0;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(248,250,252,0.97) 100%);
    padding: 28px 32px;
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,0.8);
    box-shadow: 0 25px 60px -12px rgba(15, 23, 42, 0.28);
    width: 100%;
    max-width: 440px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: modal-zoom 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#modal-watermark-settings .modal-content {
    max-height: 380px;
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
}

#modal-watermark-settings .modal-actions {
    position: sticky;
    bottom: -24px;
    background: #FFFFFF;
    padding-top: 14px;
    padding-bottom: 4px;
    margin-top: 12px;
    border-top: 1px solid var(--border-color);
    z-index: 10;
}

.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.4);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.7);
}

@keyframes modal-zoom {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-content h3 {
    margin-bottom: 20px;
    color: var(--brand-dark);
    font-size: 20px;
    font-weight: 800;
}

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

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

.form-group input[type="text"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 12px;
    font-size: 14px;
    background: rgba(255,255,255,0.95);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.55);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
    transform: translateY(-1px);
}

.form-group input:focus {
    outline: none;
    border-color: var(--border-focus);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.shortcuts-modal-content {
    max-width: 520px;
}

.shortcuts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}

.shortcut-item {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.shortcut-item .key {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: monospace;
    font-weight: bold;
    font-size: 11px;
}

.share-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.share-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
    width: 100%;
}

.share-input-row input[type="email"] {
    flex: 1 1 65%;
    min-width: 0;
}

.share-input-row select {
    flex: 0 0 110px;
    padding: 10px 8px;
}

.share-list-section {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    max-height: 200px;
    overflow-y: auto;
}

.share-list-section h4 {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.share-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.share-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px;
    background-color: var(--bg-primary);
    border-radius: var(--border-radius-sm);
    font-size: 13px;
}

.share-email {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
}

.share-badge {
    background-color: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.share-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.empty-state-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-primary);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    z-index: 50;
}

.empty-state-overlay.active {
    display: flex;
}

.empty-state-overlay i {
    font-size: 64px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.empty-state-overlay h3 {
    font-size: 20px;
    color: var(--brand-dark);
    margin-bottom: 8px;
}

.empty-state-overlay p {
    color: var(--text-secondary);
    max-width: 320px;
    line-height: 1.5;
    font-size: 14px;
}

.connection-status {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-lg);
}

.connection-status.offline {
    background-color: #FEF2F2;
    border: 1px solid #FCA5A5;
    color: #DC2626;
}

.bg-color-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
    align-items: center;
}

.bg-color-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

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

.bg-color-swatch.active {
    border-color: var(--brand-primary);
    transform: scale(1.1);
}

.screen-glow-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    box-shadow: inset 0 0 0 0px transparent;
    opacity: 0;
    transition: opacity 0.2s ease;
}

@keyframes screen-glow-red-anim {
    0% {
        opacity: 0;
        box-shadow: inset 0 0 0 0px rgba(239, 68, 68, 0);
    }
    25% {
        opacity: 1;
        box-shadow: inset 0 0 65px 20px rgba(239, 68, 68, 0.95), inset 0 0 130px 40px rgba(220, 38, 38, 0.6);
    }
    75% {
        opacity: 0.85;
        box-shadow: inset 0 0 50px 15px rgba(239, 68, 68, 0.8), inset 0 0 100px 30px rgba(220, 38, 38, 0.45);
    }
    100% {
        opacity: 0;
        box-shadow: inset 0 0 0 0px rgba(239, 68, 68, 0);
    }
}

.screen-glow-overlay.ripple-red {
    animation: screen-glow-red-anim 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes screen-glow-yellow-anim {
    0% {
        opacity: 0;
        box-shadow: inset 0 0 0 0px rgba(245, 158, 11, 0);
    }
    25% {
        opacity: 1;
        box-shadow: inset 0 0 65px 20px rgba(245, 158, 11, 0.95), inset 0 0 130px 40px rgba(217, 119, 6, 0.6);
    }
    75% {
        opacity: 0.85;
        box-shadow: inset 0 0 50px 15px rgba(245, 158, 11, 0.8), inset 0 0 100px 30px rgba(217, 119, 6, 0.45);
    }
    100% {
        opacity: 0;
        box-shadow: inset 0 0 0 0px rgba(245, 158, 11, 0);
    }
}

.screen-glow-overlay.ripple-yellow {
    animation: screen-glow-yellow-anim 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.floating-text-controls {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(99, 102, 241, 0.18);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
    border-radius: 999px;
    z-index: 550;
    transform: translateY(-100%) translateY(-8px);
}

.text-size-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.text-size-btn:hover {
    background: var(--brand-primary);
    color: white;
    border-color: var(--brand-primary);
}

.text-size-val {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 32px;
    text-align: center;
}

.app-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.app-loading-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.loading-spinner-card {
    position: relative;
    border-radius: 20px;
    padding: 3px;
    overflow: hidden;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 0, 123, 0.3);
    text-align: center;
    width: 340px;
    max-width: 90vw;
    animation-play-state: paused;
}

.loading-spinner-card::before {
    content: '';
    position: absolute;
    inset: -200% -100%; 
    background: conic-gradient(
        #ff007b, 
        #00a8ff, 
        #000000, 
        #ff007b
    );
    animation: rotate-conic-glow 4s linear infinite;
    animation-play-state: paused;
    z-index: 0;
}

.app-loading-overlay.active .loading-spinner-card::before {
    animation-play-state: running;
}

@keyframes rotate-conic-glow {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.loading-spinner-card-inner {
    position: relative;
    z-index: 1;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 17px;
    padding: 32px 36px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.loading-spinner-badge {
    width: 56px;
    height: 56px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-logo-spin {
    width: 48px;
    height: 48px;
    object-fit: contain;
    animation: logo-pulse-glow 1.5s infinite ease-in-out;
}

@keyframes logo-pulse-glow {
    0%, 100% {
        transform: scale(0.95);
        filter: drop-shadow(0 0 6px rgba(99, 102, 241, 0.4));
    }
    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 18px rgba(255, 0, 123, 0.8));
    }
}

.loading-spinner-card h4 {
    font-size: 17px;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 6px;
}

.loading-spinner-card p {
    font-size: 13px;
    color: #94A3B8;
}

.mobile-only {
    display: none !important;
}

.desktop-only {
    display: flex !important;
}

.mobile-app-brand-label {
    display: none;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--brand-dark);
}

@media (max-width: 768px) {
    #btn-shortcuts-help,
    #btn-new-notebook,
    .tree-row-actions {
        display: none !important;
    }

    .notebooks-grid {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-wrap: wrap;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform var(--transition-normal);
        max-width: 85vw;
        margin-right: 0;
        opacity: 1;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .mobile-sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        opacity: 0;
        transition: opacity var(--transition-fast);
    }

    .sidebar.mobile-open + .mobile-sidebar-backdrop,
    .mobile-sidebar-backdrop.show {
        display: block;
        opacity: 1;
    }

    #btn-open-sidebar {
        display: flex !important;
    }

    #btn-dashboard-menu.desktop-only {
        display: none !important;
    }

    #btn-dashboard-menu.mobile-only {
        display: flex !important;
    }

    #dashboard-sidebar {
        display: flex !important;
    }

    #dashboard-sidebar.mobile-open + #dashboard-sidebar-backdrop,
    #dashboard-sidebar-backdrop.show {
        display: block;
        opacity: 1;
    }

    .floating-toolbar {
        top: auto;
        bottom: 12px;
        left: 50%;
        transform: translateX(-50%);
        flex-direction: row;
        width: max-content;
        max-width: 95vw;
        overflow-x: auto;
        padding: 4px;
        border-radius: 20px;
    }

    .floating-toolbar:hover {
        transform: translateX(-50%);
    }

    .tool-buttons {
        flex-direction: row;
        gap: 4px;
    }

    .tool-options-container,
    .shape-picker-bar {
        top: auto;
        bottom: 75px;
        left: 50%;
        transform: translateX(-50%);
        flex-direction: row;
        width: max-content;
        max-width: 90vw;
        height: 56px;
        padding: 6px 12px;
        border-radius: 24px;
        overflow-x: auto;
    }

    .options-panel.active,
    .shape-picker-list,
    .option-group,
    .color-presets {
        flex-direction: row;
    }

    .notebook-card-actions {
        display: flex !important;
    }

    .mobile-app-brand-label {
        display: flex !important;
    }

    .canvas-controls #btn-undo,
    .canvas-controls #btn-redo,
    .canvas-controls #btn-toggle-ruler,
    .canvas-controls #btn-toggle-timer {
        display: none !important;
    }

    #autosave-indicator span {
        display: none !important;
    }

    #autosave-indicator {
        padding: 6px 10px;
    }
}

.zelleo-powered-footer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted, #64748B);
    user-select: none;
    transition: all 0.25s ease;
}

.zelleo-powered-footer span {
    font-size: 12px;
    letter-spacing: 0.2px;
    opacity: 0.85;
}

.zelleo-footer-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.zelleo-footer-img {
    height: 35px;
    width: auto;
    max-width: 90px;
    object-fit: contain;
    vertical-align: middle;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), filter 0.25s ease;
}

.zelleo-footer-link:hover .zelleo-footer-img {
    transform: scale(1.12) translateY(-1px);
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.6));
}

.zelleo-powered-footer:hover {
    color: var(--brand-primary, #6366F1);
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary, #FFFFFF);
    margin-top: auto;
}

.sidebar.collapsed .sidebar-footer {
    display: none;
}

.dashboard-footer {
    padding: 24px 0 16px 0;
    margin-top: 32px;
    border-top: 1px solid var(--border-color, rgba(0, 0, 0, 0.06));
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.loading-footer {
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    color: #94A3B8;
}

.loading-footer .zelleo-footer-img {
    filter: brightness(1.2);
}

.loading-footer:hover .zelleo-footer-img {
    filter: brightness(1.4) drop-shadow(0 0 10px rgba(99, 102, 241, 0.8));
}

.tree-row.drag-over-above {
    border-top: 2.5px solid #6366F1 !important;
    background-color: rgba(99, 102, 241, 0.12) !important;
    position: relative;
}
.tree-row.drag-over-above::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #6366F1;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.9);
}

.tree-row.drag-over-below {
    border-bottom: 2.5px solid #6366F1 !important;
    background-color: rgba(99, 102, 241, 0.12) !important;
    position: relative;
}
.tree-row.drag-over-below::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #6366F1;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.9);
}

.tree-row.drag-over-into {
    outline: 2px dashed #6366F1 !important;
    outline-offset: -2px;
    background-color: rgba(99, 102, 241, 0.18) !important;
}

.floating-shape-toolbar {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(99, 102, 241, 0.35);
    box-shadow: 0 12px 30px -5px rgba(15, 23, 42, 0.22), 0 0 15px rgba(99, 102, 241, 0.25);
    border-radius: 14px;
    z-index: 600;
    transform: translate(-50%, 0);
    pointer-events: auto;
    user-select: none;
    animation: float-shape-toolbar-pop 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: opacity 0.2s ease;
}

.floating-text-controls {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(99, 102, 241, 0.35);
    box-shadow: 0 12px 30px -5px rgba(15, 23, 42, 0.22), 0 0 15px rgba(99, 102, 241, 0.25);
    border-radius: 14px;
    z-index: 600;
    transform: translate(-50%, -100%);
    pointer-events: auto;
    user-select: none;
    animation: float-toolbar-pop 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: opacity 0.2s ease;
}

.floating-shape-toolbar.is-transforming,
.floating-text-controls.is-transforming {
    opacity: 0 !important;
    pointer-events: none !important;
    display: none !important;
}

@keyframes float-toolbar-pop {
    from { opacity: 0; transform: translate(-50%, -85%) scale(0.92); }
    to { opacity: 1; transform: translate(-50%, -100%) scale(1); }
}

@keyframes float-shape-toolbar-pop {
    from { opacity: 0; transform: translate(-50%, 15%) scale(0.92); }
    to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

.shape-tb-section {
    display: flex;
    align-items: center;
    gap: 6px;
}

.shape-tb-label {
    font-size: 11px;
    font-weight: 700;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 2px;
}

.shape-tb-swatches {
    display: flex;
    align-items: center;
    gap: 4px;
}

.shape-tb-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5px solid rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.shape-tb-swatch:hover {
    transform: scale(1.22);
}

.shape-tb-swatch.active {
    border-color: #6366F1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.45);
    transform: scale(1.15);
}

.shape-tb-swatch.transparent {
    position: relative;
    background: #FFFFFF !important;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #EF4444;
    font-size: 11px;
}

.shape-tb-divider {
    width: 1px;
    height: 22px;
    background: rgba(0, 0, 0, 0.12);
    margin: 0 3px;
}

.shape-tb-btn,
.text-size-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #FFFFFF;
    color: #0F172A;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.shape-tb-btn:hover,
.text-size-btn:hover {
    background: rgba(99, 102, 241, 0.12);
    color: #6366F1;
    border-color: #6366F1;
}

.shape-tb-btn.danger:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #EF4444;
    border-color: #EF4444;
}

.shape-tb-val,
.text-size-val {
    font-size: 12px;
    font-weight: 700;
    min-width: 26px;
    text-align: center;
    color: #0F172A;
}

.text-size-select {
    padding: 3px 6px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    background: #FFFFFF;
    color: #0F172A;
    cursor: pointer;
    outline: none;
}

.text-font-select {
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    background: #FFFFFF;
    color: #0F172A;
    cursor: pointer;
    outline: none;
    max-width: 130px;
}

.text-style-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #FFFFFF;
    color: #0F172A;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.text-style-btn:hover {
    background: rgba(99, 102, 241, 0.12);
    color: #6366F1;
    border-color: #6366F1;
}

.text-style-btn.active {
    background: #6366F1;
    color: #FFFFFF;
    border-color: #6366F1;
    box-shadow: 0 0 6px rgba(99, 102, 241, 0.4);
}

.text-close-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: #6366F1;
    color: #FFFFFF;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.text-close-btn:hover {
    background: #4F46E5;
    transform: scale(1.06);
}

.sticky-note-editor {
    position: absolute;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.18), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 12px;
    font-family: 'Outfit', 'Inter', sans-serif;
    outline: none;
    z-index: 500;
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.sticky-note-editor:focus {
    box-shadow: 0 16px 35px -5px rgba(0, 0, 0, 0.25), 0 0 0 2px rgba(99, 102, 241, 0.4);
}

.peer-cursor-container {
    position: absolute;
    pointer-events: none;
    z-index: 9000;
    transition: transform 0.08s ease-out;
}

.peer-cursor-pointer {
    width: 18px;
    height: 18px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.peer-cursor-label {
    position: absolute;
    left: 14px;
    top: 14px;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    color: #FFFFFF;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.2px;
}

.vertical-slider-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.vertical-slider-wrapper {
    height: 100px;
    width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 0;
    margin: 2px auto;
    position: relative;
    box-sizing: border-box;
}

.vertical-slider {
    appearance: none;
    -webkit-appearance: none;
    writing-mode: vertical-lr;
    direction: rtl;
    width: 16px;
    height: 95px;
    background: var(--bg-tertiary);
    border-radius: 999px;
    outline: none;
    cursor: pointer;
    margin: 0 auto;
    display: block;
    box-sizing: border-box;
}

.vertical-slider::-webkit-slider-runnable-track {
    width: 6px;
    background: rgba(15, 23, 42, 0.12);
    border-radius: 999px;
}

.vertical-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #6366F1;
    border: 1.5px solid #FFFFFF;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    margin: 0;
}

.whiteboard-container {
    position: relative;
    flex: 1;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.floating-toolbar {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: var(--bg-primary);
    padding: 12px 10px;
    border-radius: 18px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(16px);
    max-height: calc(100vh - 60px);
    pointer-events: auto;
}

.toolbar-scroll-btn {
    width: 32px;
    height: 22px;
    border-radius: 8px;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.15s ease;
    flex-shrink: 0 !important;
    margin: 2px 0;
}

.toolbar-scroll-btn:hover {
    background: var(--accent-color);
    color: #ffffff;
}

.tool-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    scrollbar-width: none;
    scroll-behavior: smooth;
    padding: 4px 0;
}

.tool-buttons::-webkit-scrollbar {
    display: none;
}

.tool-buttons .tool-btn {
    flex-shrink: 0 !important;
}

.tool-buttons .preset-divider {
    flex-shrink: 0 !important;
}

.canvas-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-primary);
    padding: 8px 12px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(16px);
    pointer-events: auto;
}

.vertical-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #6366F1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    cursor: pointer;
}

.timer-screen-alarm {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.35s ease;
    overflow: hidden;
    
    -webkit-mask-image: 
        linear-gradient(to right, #000 0px, #000 6px, transparent 30px),
        linear-gradient(to left, #000 0px, #000 6px, transparent 30px),
        linear-gradient(to bottom, #000 0px, #000 6px, transparent 30px),
        linear-gradient(to top, #000 0px, #000 6px, transparent 30px);
    -webkit-mask-composite: source-over;
    mask-image: 
        linear-gradient(to right, #000 0px, #000 6px, transparent 30px),
        linear-gradient(to left, #000 0px, #000 6px, transparent 30px),
        linear-gradient(to bottom, #000 0px, #000 6px, transparent 30px),
        linear-gradient(to top, #000 0px, #000 6px, transparent 30px);
    mask-composite: add;
    animation-play-state: paused;
}

.timer-screen-alarm.show {
    opacity: 1;
}

.timer-screen-alarm::before {
    content: '';
    position: absolute;
    inset: -100vmax -100vmax;
    background: conic-gradient(
        #ff007b, 
        #00a8ff, 
        #000000, 
        #ff007b
    );
    animation: rotate-conic-glow 3s linear infinite;
    z-index: 0;
}

/* PRICING & SUBSCRIPTION SYSTEM STYLES */
.pricing-view-overlay {
    position: fixed;
    inset: 0;
    background: #070a13;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    color: #ffffff;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
}

.pricing-view-overlay.hidden {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.pricing-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.08);
    position: sticky;
    top: 0;
    z-index: 10;
}

.pricing-nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pricing-brand-name {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.pricing-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #818cf8;
    padding: 2px 8px;
    border-radius: 9999px;
}

.btn-close-pricing {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-close-pricing:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
}

.pricing-main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 48px 32px 96px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pricing-header {
    text-align: center;
    max-width: 640px;
    margin-bottom: 48px;
}

.pricing-header h2 {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 50%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.pricing-header p {
    font-size: 15px;
    color: #94a3b8;
    line-height: 1.6;
}

.active-plan-container {
    margin-top: 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 9999px;
    font-size: 13px;
    color: #a5b4fc;
}

.pulse-indicator {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.pricing-carousel-container {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    gap: 16px;
    margin-top: 16px;
}

.pricing-carousel-viewport {
    overflow: hidden;
    width: 100%;
    max-width: 1080px;
}

.pricing-grid {
    display: flex;
    gap: 24px;
    width: 100%;
    align-items: stretch;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.pricing-card {
    background: rgba(30, 41, 59, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(8px);
    flex: 0 0 calc((100% - 48px) / 3);
    width: calc((100% - 48px) / 3);
    box-sizing: border-box;
}

.carousel-nav-btn {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    flex-shrink: 0;
}

.carousel-nav-btn:hover {
    background: #6366f1;
    border-color: #6366f1;
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.carousel-nav-btn:disabled {
    opacity: 0.2;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    background: rgba(30, 41, 59, 0.2);
    border-color: rgba(255, 255, 255, 0.03);
}

@media (max-width: 1024px) {
    .pricing-card {
        flex: 0 0 calc((100% - 24px) / 2);
        width: calc((100% - 24px) / 2);
    }
}

@media (max-width: 640px) {
    .pricing-card {
        flex: 0 0 100%;
        width: 100%;
    }
}

.pricing-card {
    background: rgba(30, 41, 59, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(8px);
}

.pricing-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
    background: rgba(30, 41, 59, 0.35);
}

.pricing-card.recommended {
    border: 2px solid #6366f1;
    background: rgba(99, 102, 241, 0.03);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.05);
}

.pricing-card.recommended:hover {
    border-color: #818cf8;
    background: rgba(99, 102, 241, 0.05);
}

.badge-recommended {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #6366f1;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 16px;
    border-radius: 9999px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.pricing-card-header h3 {
    font-size: 20px;
    font-weight: 800;
    color: #e2e8f0;
    margin-bottom: 12px;
}

.pricing-card-header .price {
    display: flex;
    align-items: baseline;
    margin-bottom: 16px;
}

.pricing-card-header .price .currency {
    font-size: 24px;
    font-weight: 700;
    color: #818cf8;
    margin-right: 2px;
}

.pricing-card-header .price .amount {
    font-size: 48px;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: -1px;
}

.pricing-card-header .price .period {
    font-size: 14px;
    color: #94a3b8;
    margin-left: 4px;
}

.pricing-card-header .description {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.5;
    margin-bottom: 24px;
    min-height: 38px;
}

.pricing-card .features {
    list-style: none;
    padding: 0;
    margin: 0 0 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pricing-card .features li {
    font-size: 13.5px;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pricing-card .features li i {
    font-size: 12px;
    width: 16px;
    text-align: center;
}

.text-success {
    color: #10b981;
}

.text-danger {
    color: #ef4444;
}

.pricing-card .select-plan-btn {
    width: 100%;
    padding: 12px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Active Card highlighting */
.pricing-card.current-active-card {
    border: 2px solid #10b981;
    background: rgba(16, 185, 129, 0.03);
}

.pricing-card.current-active-card .select-plan-btn {
    background: #10b981 !important;
    color: #ffffff !important;
    border: none !important;
    cursor: default;
    pointer-events: none;
}

/* UPI Payment overlay */
.upi-payment-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999999;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow-y: auto;
}

.upi-payment-overlay.hidden {
    display: none !important;
}

.upi-card {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    width: 100%;
    max-width: 440px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    color: #ffffff;
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
}

.upi-card-header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    padding: 32px 24px;
    text-align: center;
}

.upi-icon-badge {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-size: 24px;
}

.upi-card-header h3 {
    font-size: 20px;
    font-weight: 800;
    margin: 0 0 4px;
}

.upi-card-header p {
    font-size: 13.5px;
    color: #c084fc;
    margin: 0;
}

.upi-card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.upi-info-row {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 16px;
    text-align: center;
}

.upi-info-row.ref-row {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.2);
}

.upi-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94a3b8;
    display: block;
    margin-bottom: 6px;
}

.upi-value-code {
    font-family: monospace;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #ffffff;
}

.upi-copy-btn {
    background: #6366f1;
    border: none;
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.upi-copy-btn:hover {
    background: #4f46e5;
}

.upi-id-display {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
}

.upi-actions {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

/* Subscription Status Banner */
.status-banner {
    width: 100%;
    margin-bottom: 24px;
    border-radius: 20px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    backdrop-filter: none;
    font-family: 'Inter', sans-serif;
}

.status-banner.pending {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: #f59e0b;
}

.status-banner.active {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #10b981;
}

.status-banner-content {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.status-banner-icon {
    font-size: 20px;
    margin-top: 2px;
}

.status-banner-text h4 {
    font-size: 14.5px;
    font-weight: 700;
    margin: 0 0 4px;
}

.status-banner-text p {
    font-size: 12.5px;
    color: #cbd5e1;
    margin: 0;
    line-height: 1.5;
}

.status-banner-btn {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.status-banner.pending .status-banner-btn {
    background: #f59e0b;
    color: #ffffff;
    border: none;
}

.status-banner.pending .status-banner-btn:hover {
    background: #d97706;
}

.status-banner.active .status-banner-btn {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.status-banner.active .status-banner-btn:hover {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

/* Preset item settings styles */
.settings-preset-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-primary);
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}

.settings-preset-color-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.btn-delete-preset {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 4px;
    transition: opacity 0.2s;
}

.btn-delete-preset:hover {
    opacity: 0.8;
}

/* Toolbar Add Preset Quick Button */
.tool-btn.add-preset-btn {
    border: 1px dashed var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border-radius: var(--border-radius-sm);
    transition: all 0.2s ease;
}

.tool-btn.add-preset-btn:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    background: rgba(99, 102, 241, 0.1);
    transform: scale(1.05);
}

.btn-save-pen-preset {
    transition: all 0.2s ease;
}

.btn-save-pen-preset:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    background: rgba(99, 102, 241, 0.08);
}

/* ==========================================================================
   DEDICATED PDF DOCUMENT STUDIO LAYOUT & DESIGN
   ========================================================================== */

.pdf-doc-studio {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #4B5563; /* Studio neutral backdrop */
    z-index: 10;
    overflow: hidden;
}

.pdf-doc-studio.hidden {
    display: none !important;
}

/* PDF Top Document Bar - Unified Studio Header */
.pdf-doc-top-bar {
    height: 54px;
    background: linear-gradient(180deg, #1E293B 0%, #0F172A 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    color: #F9FAFB;
    user-select: none;
    z-index: 50;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    gap: 12px;
}

.pdf-doc-top-bar-left,
.pdf-doc-top-bar-center,
.pdf-doc-top-bar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* PDF Studio Brand in Top Bar */
.pdf-top-brand {
    display: flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
}

.pdf-top-logo {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
    transition: transform 0.2s ease;
}

.pdf-top-brand:hover .pdf-top-logo {
    transform: rotate(-6deg) scale(1.08);
}

.pdf-top-brand-name {
    font-size: 14px;
    font-weight: 800;
    color: #FFFFFF;
    letter-spacing: -0.3px;
}

.pdf-top-brand-pill {
    font-size: 9.5px;
    font-weight: 800;
    padding: 1px 7px;
    border-radius: 100px;
    background: rgba(99, 102, 241, 0.2);
    color: #A5B4FC;
    border: 1px solid rgba(99, 102, 241, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.pdf-top-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.12);
    margin: 0 2px;
    flex-shrink: 0;
}

/* Zelleo in PDF Header */
.pdf-top-zelleo.zelleo-powered-footer {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #94A3B8;
    background: rgba(255, 255, 255, 0.06);
    padding: 3px 10px 3px 12px;
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.pdf-top-zelleo .zelleo-footer-img {
    height: 22px;
    width: auto;
    max-width: 60px;
    filter: brightness(1.08);
}

/* User Pill in PDF Header */
.pdf-top-user-pill {
    display: flex;
    align-items: center;
    gap: 7px;
    background: rgba(255, 255, 255, 0.06);
    padding: 3px 10px 3px 4px;
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.pdf-top-user-pill .avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1.5px solid #6366F1;
    box-shadow: 0 1px 4px rgba(99, 102, 241, 0.25);
}

.pdf-top-user-pill #pdf-workspace-user-name {
    font-size: 12px;
    font-weight: 700;
    color: #F8FAFB;
    max-width: 110px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Return to Dashboard Button in PDF Header */
.pdf-top-action-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
    color: #F1F5F9;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.pdf-top-action-btn:hover {
    background: rgba(99, 102, 241, 0.3);
    border-color: rgba(99, 102, 241, 0.5);
    color: #FFFFFF;
    transform: translateY(-1px);
}

@media (max-width: 1280px) {
    .pdf-top-divider-zelleo,
    .pdf-top-zelleo {
        display: none !important;
    }
}

@media (max-width: 1080px) {
    .pdf-doc-btn-label {
        display: none !important;
    }
    .pdf-top-brand-pill {
        display: none !important;
    }
}

@media (max-width: 820px) {
    .pdf-top-brand-name,
    .pdf-top-user-pill #pdf-workspace-user-name {
        display: none !important;
    }
    .pdf-doc-title-badge {
        max-width: 120px !important;
    }
}

.pdf-doc-title-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #F3F4F6;
    background: rgba(255, 255, 255, 0.08);
    padding: 5px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 240px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* PDF Buttons */
.pdf-doc-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: #F3F4F6;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pdf-doc-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.3);
}

.pdf-doc-btn-primary {
    background: #6366F1;
    border-color: #4F46E5;
    color: #FFFFFF;
}

.pdf-doc-btn-primary:hover {
    background: #4F46E5;
}

.pdf-doc-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: #F3F4F6;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s ease;
}

.pdf-doc-icon-btn:hover {
    background: rgba(255, 255, 255, 0.18);
}

/* PDF Page Stepper */
.pdf-page-stepper {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.25);
    padding: 3px 6px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.pdf-page-input-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 4px;
}

#pdf-page-num-input {
    width: 36px;
    height: 24px;
    text-align: center;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 600;
    outline: none;
}

#pdf-page-num-input:focus {
    border-color: #6366F1;
    background: rgba(255, 255, 255, 0.2);
}

.pdf-page-total-label {
    font-size: 12px;
    color: #9CA3AF;
    font-weight: 500;
}

/* PDF Zoom Controls */
.pdf-doc-zoom-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.25);
    padding: 3px 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.pdf-doc-zoom-dropdown {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 500;
    padding: 3px 6px;
    outline: none;
    cursor: pointer;
}

.pdf-doc-zoom-dropdown option {
    background: #1F2937;
    color: #FFFFFF;
}

/* PDF Studio Body */
.pdf-doc-studio-body {
    display: flex;
    flex: 1;
    height: calc(100% - 54px);
    position: relative;
    overflow: hidden;
}

/* PDF Left Thumbnail Sidebar */
.pdf-thumbnail-sidebar {
    width: 220px;
    background: #111827;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s ease;
    z-index: 25;
    flex-shrink: 0;
}

.pdf-thumbnail-sidebar.collapsed {
    width: 0;
    transform: translateX(-100%);
    overflow: hidden;
    border-right: none;
}

.pdf-thumbnails-header {
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9CA3AF;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pdf-thumbnails-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Thumbnail Item */
.pdf-thumb-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    border-radius: 6px;
    padding: 6px;
    transition: all 0.2s ease;
}

.pdf-thumb-card:hover {
    background: rgba(255, 255, 255, 0.06);
}

.pdf-thumb-card.active {
    background: rgba(99, 102, 241, 0.15);
}

.pdf-thumb-preview-box {
    width: 100%;
    background: #FFFFFF;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 2px solid transparent;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease;
    aspect-ratio: 8.5 / 11;
}

.pdf-thumb-card.active .pdf-thumb-preview-box {
    border-color: #6366F1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.4);
}

.pdf-thumb-canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pdf-thumb-label {
    font-size: 11px;
    font-weight: 600;
    color: #9CA3AF;
}

.pdf-thumb-card.active .pdf-thumb-label {
    color: #818CF8;
}

/* PDF Document Viewport */
.pdf-document-viewport {
    flex: 1;
    height: 100%;
    overflow-y: auto;
    overflow-x: auto;
    background: #374151;
    position: relative;
    padding: 24px 20px 80px 20px;
    display: flex;
    justify-content: center;
    scroll-behavior: smooth;
}

.pdf-pages-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    margin: 0 auto;
    transform-origin: top center;
    transition: transform 0.15s ease-out;
}

/* PDF Paper Card */
.pdf-page-card {
    position: relative;
    background: #FFFFFF;
    border-radius: 4px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3), 0 1px 4px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    user-select: none;
    touch-action: none;
    flex-shrink: 0;
}

.pdf-page-badge {
    position: absolute;
    top: 10px;
    right: 12px;
    background: rgba(15, 23, 42, 0.85);
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    z-index: 5;
    pointer-events: none;
}

.pdf-doc-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.pdf-annotation-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    cursor: crosshair;
}

/* Between-Page Scratchpad Dividers & Buttons */
.pdf-page-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 6px 0;
    margin: -10px 0;
    position: relative;
    z-index: 10;
}

.btn-add-scratchpad {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    background: #1E293B;
    color: #94A3B8;
    border: 1px dashed #475569;
    border-radius: 20px;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    user-select: none;
}

.btn-add-scratchpad:hover {
    background: #4F46E5;
    color: #FFFFFF;
    border-color: #6366F1;
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
}

.btn-add-scratchpad svg {
    width: 14px;
    height: 14px;
}

/* Scratchpad Page Card */
.pdf-page-card.pdf-scratchpad-card {
    border: 2px solid rgba(99, 102, 241, 0.4);
    box-shadow: 0 6px 28px rgba(79, 70, 229, 0.15), 0 2px 8px rgba(0, 0, 0, 0.2);
}

.pdf-scratchpad-header {
    position: absolute;
    top: 10px;
    left: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 6;
    pointer-events: auto;
}

.pdf-scratchpad-badge {
    background: linear-gradient(135deg, #4F46E5, #6366F1);
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
    display: flex;
    align-items: center;
    gap: 6px;
}

.pdf-scratchpad-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-sp-action {
    background: rgba(15, 23, 42, 0.85);
    color: #E2E8F0;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-sp-action:hover {
    background: #334155;
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-sp-action.btn-sp-delete:hover {
    background: #EF4444;
    border-color: #DC2626;
    color: #FFFFFF;
}

.pdf-thumb-card.is-scratchpad {
    border-color: #6366F1;
}

.pdf-thumb-card.is-scratchpad .pdf-thumb-label {
    color: #818CF8;
    font-weight: 700;
}




