:root {
    --bg-dark: #090a0f;
    --sidebar-bg: rgba(15, 17, 26, 0.7);
    --workspace-bg: #10121a;
    --card-bg: rgba(26, 29, 44, 0.55);
    --card-hover-bg: rgba(34, 38, 57, 0.75);
    --border-color: rgba(255, 255, 255, 0.07);
    --text-primary: #f3f4f6;
    --text-secondary: #a1a1aa;
    --text-muted: #52525b;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --accent-glow: rgba(99, 102, 241, 0.25);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    height: 100%;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    line-height: 1.5;
}

/* Scrollbar customizations */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Layout Main Container */
.quikeep-main {
    height: 100%;
    height: 100dvh !important;
    width: 100vw;
    max-height: 100dvh !important;
    display: flex;
    overflow: hidden;
}

.quikeep-container {
    display: flex;
    width: 100%;
    height: 100%;
    max-height: 100% !important;
    position: relative;
}

/* Sidebar */
.qk-sidebar {
    width: 350px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
    z-index: 10;
    transition: var(--transition-smooth);
}

/* Sidebar Header & Brand */
.qk-brand {
    padding: 1.25rem 1.5rem 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.qk-logo {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #a5b4fc 0%, #6366f1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Sync Engine Status Dot */
.sync-status {
    width: 10px;
    height: 10px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
    animation: pulse 3s infinite ease-in-out;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.sync-status:hover {
    transform: scale(1.15);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.8);
}

@keyframes pulse {
    0% { transform: scale(0.98); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { transform: scale(1.02); box-shadow: 0 0 0 4px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.98); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.sync-status.disconnected {
    background-color: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
    animation: pulse-disconnected 3s infinite ease-in-out;
}

.sync-status.disconnected:hover {
    transform: scale(1.15);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.8);
}

@keyframes pulse-disconnected {
    0% { transform: scale(0.98); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { transform: scale(1.02); box-shadow: 0 0 0 4px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.98); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Sync Room Control Card */
.qk-sync-box {
    padding: 0 1.5rem 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.qk-sync-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}

.qk-sync-input-group {
    display: flex;
    gap: 0.5rem;
}

/* Sync Form Enhancements */
.qk-sync-input-wrapper {
    position: relative;
    display: flex;
    flex-grow: 1;
}

.qk-sync-input {
    width: 100%;
    padding-right: 2.2rem !important; /* Make room for the clear button */
}

.qk-sync-clear-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    pointer-events: none;
    z-index: 5;
}

.qk-sync-clear-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.qk-sync-clear-btn.active {
    opacity: 1;
    pointer-events: auto;
}

/* Custom pairing submit states */
.qk-btn.qk-btn-yellow {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.22) 0%, rgba(202, 138, 4, 0.12) 100%) !important;
    color: #fef08a !important;
    border: 1px solid rgba(234, 179, 8, 0.55) !important;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25), 0 0 10px rgba(234, 179, 8, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.qk-btn.qk-btn-yellow:hover {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.38) 0%, rgba(202, 138, 4, 0.28) 100%) !important;
    border-color: rgba(234, 179, 8, 0.9) !important;
    color: #fff !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35), 0 0 20px rgba(234, 179, 8, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-1.5px) scale(1.04);
    text-shadow: 0 0 8px rgba(234, 179, 8, 0.6);
}

.qk-btn.qk-btn-yellow:active {
    transform: translateY(0.5px) scale(0.96);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), 0 0 8px rgba(234, 179, 8, 0.3);
}

/* Micro-animation for sync icons inside yellow button */
.qk-btn.qk-btn-yellow i {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.qk-btn.qk-btn-yellow:hover i {
    transform: scale(1.12);
}

.qk-btn.qk-btn-yellow:active i {
    transform: scale(0.95);
}

.qk-btn.qk-btn-paired {
    background: rgba(255, 255, 255, 0.04) !important;
    color: var(--text-primary) !important;
    border: 1px solid rgba(99, 102, 241, 0.4) !important; /* Premium blue/indigo outline */
    box-shadow: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.qk-btn.qk-btn-paired:hover {
    background: rgba(99, 102, 241, 0.08) !important;
    border-color: rgba(99, 102, 241, 0.7) !important;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.25);
    transform: translateY(-1px) scale(1.02);
}

.qk-btn.qk-btn-paired:active {
    transform: translateY(0.5px) scale(0.98);
}

.qk-input {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-color);
    padding: 0.6rem 0.75rem;
    border-radius: 14px;
    corner-shape: squircle;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.875rem;
    flex-grow: 1;
    transition: var(--transition-smooth);
}

.qk-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.qk-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 14px;
    corner-shape: squircle;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.qk-btn:hover {
    background: var(--accent-hover);
    box-shadow: 0 0 10px var(--accent-glow);
}

.qk-btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.qk-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

.qk-btn-borderless {
    background: transparent !important;
    color: var(--text-secondary) !important;
    border: 1px solid transparent !important;
    box-shadow: none !important;
    padding: 0.6rem 0.75rem !important;
}

.qk-btn-borderless:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--text-primary) !important;
}

.qk-btn-copy {
    padding: 0.6rem 0.75rem;
}

/* Sidebar Search & Tags Filters */
.qk-sidebar-search {
    padding: 1rem 1.5rem 0.5rem 1.5rem;
    flex-shrink: 0;
}

.qk-search-wrapper {
    position: relative;
}

.qk-search-wrapper i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.qk-search-input {
    padding-left: 2.2rem;
}

.qk-tag-filters {
    padding: 0.5rem 1.5rem;
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none; /* Firefox */
    flex-shrink: 0;
}

.qk-tag-filters::-webkit-scrollbar {
    display: none; /* Safari/Chrome */
}

.qk-tag-filter {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

.qk-tag-filter:hover, .qk-tag-filter.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Note Action Buttons */
.qk-sidebar-actions {
    padding: 0.75rem 1.5rem;
    flex-shrink: 0;
}

.qk-create-btn {
    width: 100%;
    padding: 0.75rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
}

/* Notes List Area */
.qk-notes-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0.5rem 1.5rem calc(1.5rem + env(safe-area-inset-bottom, 0px)) 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.qk-list-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    margin-top: 0.75rem;
    margin-bottom: 0.25rem;
}

/* Note Card */
.qk-note-card {
    background: var(--note-color, var(--card-bg));
    border: 1px solid var(--border-color);
    border-radius: 21px;
    corner-shape: squircle;
    padding: 1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex-shrink: 0;
}


.qk-note-card:hover {
    background: var(--card-hover-bg);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
    border-color: rgba(255, 255, 255, 0.12);
}

.qk-note-card.active {
    background: var(--note-color, rgba(30, 36, 56, 0.8));
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.15);
}

.qk-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}

.qk-card-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
}

.qk-card-pin {
    color: var(--text-muted);
    font-size: 0.8rem;
    transition: var(--transition-smooth);
}

.qk-card-pin.pinned {
    color: #eab308;
    transform: rotate(45deg);
}

.qk-card-body {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    word-break: break-all;
}

.qk-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.4rem;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.qk-card-date {
    font-weight: 500;
}

.qk-card-tags {
    display: flex;
    gap: 0.25rem;
    overflow: hidden;
    max-width: 60%;
}

.qk-card-tag {
    background: rgba(255,255,255,0.05);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.65rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Empty State Sidebar */
.qk-sidebar-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.qk-sidebar-empty i {
    font-size: 2.2rem;
    opacity: 0.3;
}

/* Workspace Editor Area */
.qk-workspace {
    flex-grow: 1;
    background-color: var(--workspace-bg);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;
    transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Workspace Empty State */
.qk-workspace-empty {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    gap: 1rem;
}

.qk-workspace-empty i {
    font-size: 4.5rem;
    background: linear-gradient(135deg, rgba(165,180,252,0.1) 0%, rgba(99,102,241,0.03) 100%);
    color: var(--accent);
    padding: 2rem;
    border-radius: 50%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255,255,255,0.02);
}

.qk-workspace-empty h2 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    font-size: 1.8rem;
    font-weight: 600;
}

.qk-workspace-empty p {
    max-width: 320px;
    font-size: 0.95rem;
}

/* Workspace Editor Header */
.qk-editor-header {
    padding: 1.25rem 1.5rem 1.25rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: rgba(9, 10, 15, 0.25);
    z-index: 5;
}

.qk-editor-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-grow: 1;
}

.qk-back-btn {
    display: none; /* Desktop hidden */
    font-size: 1.1rem;
    padding: 0.5rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.qk-title-input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 600;
    flex-grow: 1;
    width: 100%;
}

.qk-title-input:focus {
    outline: none;
}

.qk-editor-header-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.qk-editor-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Color Circles Picker */
.qk-color-picker {
    display: flex;
    gap: 0.4rem;
}

.qk-color-mobile-btn {
    display: none !important;
}

.qk-color-modal-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.25rem;
    padding: 0.75rem 0;
}

@media (max-width: 800px) {
    .qk-color-picker {
        display: none !important;
    }
    .qk-color-mobile-btn {
        display: flex !important;
    }
}

.qk-color-option {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.25);
    transition: var(--transition-smooth);
}

.qk-color-option:hover {
    transform: scale(1.15);
    border-color: rgba(255, 255, 255, 0.6);
}

.qk-color-option.selected {
    border-color: white;
    box-shadow: 0 0 8px rgba(255,255,255,0.5);
    transform: scale(1.1);
}

/* Tags editor input */
.qk-tags-editor {
    padding: 0.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(9, 10, 15, 0.15);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.qk-tags-editor i {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.qk-tags-input {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-family: var(--font-body);
    flex-grow: 1;
}

.qk-tags-input:focus {
    outline: none;
}

/* Editor Workspace Splits */
.qk-editor-split {
    flex-grow: 1;
    display: flex;
    overflow: hidden;
    height: 100%;
}

.qk-editor-pane {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    position: relative;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), flex 0.3s cubic-bezier(0.4, 0, 0.2, 1), border 0.3s ease, height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.qk-pane-header {
    padding: 0.5rem 1rem;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.qk-pane-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Pane Toggle Button */
.qk-pane-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 2px 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qk-pane-toggle-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.qk-pane-toggle-btn i {
    transition: transform 0.25s ease;
}

/* Active style for collapsed desktop button */
.qk-editor-split.qk-preview-collapsed-desktop .qk-pane-toggle-btn {
    color: var(--accent) !important;
    background: rgba(99, 102, 241, 0.15);
}

.qk-editor-split.qk-preview-collapsed-desktop .qk-pane-toggle-btn i {
    transform: rotate(180deg);
}

.qk-pane-mobile-toggle {
    display: flex;
    align-items: center;
    color: var(--text-muted);
}

.qk-pane-mobile-toggle i {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.qk-textarea {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    padding: 1.5rem;
    resize: none;
    line-height: 1.6;
}

.qk-textarea:focus {
    outline: none;
}

/* Preview Pane */
.qk-preview-pane {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), flex 0.3s cubic-bezier(0.4, 0, 0.2, 1), border 0.3s ease, height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.qk-preview-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem 1.5rem calc(1.5rem + env(safe-area-inset-bottom, 0px)) 1.5rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Markdown Rendering Elements inside Preview */
.qk-preview-body h1, .qk-preview-body h2, .qk-preview-body h3 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}
.qk-preview-body h1 { font-size: 1.4rem; border-bottom: 1px solid rgba(255,255,255,0.06); padding-bottom: 0.3rem; }
.qk-preview-body h2 { font-size: 1.2rem; }
.qk-preview-body h3 { font-size: 1rem; }

.qk-preview-body p {
    margin-bottom: 0.85rem;
}

.qk-preview-body ul, .qk-preview-body ol {
    margin-left: 1.5rem;
    margin-bottom: 0.85rem;
}

.qk-preview-body blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--text-muted);
    font-style: italic;
}

.qk-preview-body code {
    background: rgba(255,255,255,0.08);
    padding: 0.15rem 0.3rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: monospace;
}

.qk-preview-body pre {
    background: rgba(0,0,0,0.3);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
    border: 1px solid var(--border-color);
}

.qk-preview-body pre code {
    background: transparent;
    padding: 0;
    font-size: 0.8rem;
}

/* Auto-save status floating indicator */
.qk-save-indicator {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.qk-save-indicator i {
    font-size: 0.8rem;
}

/* Responsive Rules for Mobile/Tablet layout */
@media (max-width: 800px) {
    .qk-back-btn {
        display: block; /* Show back button on mobile */
    }

    .qk-sidebar {
        width: 100%;
        height: 100% !important;
        max-height: 100% !important;
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .qk-workspace {
        width: 100%;
        height: 100% !important;
        max-height: 100% !important;
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 20;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* If activeNoteId is set, slide editor into view! */
    .quikeep-container.active-note .qk-sidebar {
        transform: translateX(-100%);
    }

    .quikeep-container.active-note .qk-workspace {
        transform: translateX(0);
    }

    /* Stack editor split vertically or tabbed */
    .qk-editor-split {
        flex-direction: column;
        position: relative;
        flex-grow: 1;
        flex-shrink: 1;
        min-height: 0;
        height: 100% !important; /* Forces definite height so child percentage heights resolve correctly on iOS Safari */
    }

    .qk-editor-pane {
        width: 100% !important;
        height: calc(100% - 38px - env(safe-area-inset-bottom, 0px)) !important; /* Account for collapsed preview with bottom safe area */
        flex: none !important;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
        flex-direction: column;
    }

    .qk-editor-pane .qk-pane-header {
        cursor: pointer;
    }

    .qk-editor-pane .qk-textarea, 
    .qk-editor-pane .CodeMirror {
        flex-grow: 1 !important;
        height: calc(100% - 38px) !important;
        opacity: 1;
        visibility: visible;
        transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .qk-preview-pane {
        width: 100% !important;
        height: calc(38px + env(safe-area-inset-bottom, 0px)) !important; /* Collapsed preview height including home indicator */
        flex: none !important;
        transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-top: 1px solid var(--border-color);
        background: rgba(9, 10, 15, 0.25) !important; /* Semi-transparent to let the note color show through beautifully */
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-sizing: border-box;
        padding-bottom: env(safe-area-inset-bottom, 0px); /* Center header content above home indicator */
    }

    .qk-preview-pane .qk-pane-header {
        cursor: pointer;
        border-bottom: none;
    }

    .qk-preview-body {
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Expanded Preview State (Editor Collapsed) */
    .qk-editor-split.qk-state-preview .qk-editor-pane {
        height: 38px !important;
    }
    
    .qk-editor-split.qk-state-preview .qk-editor-pane .qk-textarea,
    .qk-editor-split.qk-state-preview .qk-editor-pane .CodeMirror {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .qk-editor-split.qk-state-preview .qk-preview-pane {
        height: calc(100% - 38px) !important;
        border-top: none;
    }
    
    .qk-editor-split.qk-state-preview .qk-preview-pane .qk-pane-header {
        border-bottom: 1px solid var(--border-color);
    }

    .qk-editor-split.qk-state-preview .qk-preview-body {
        opacity: 1;
        visibility: visible;
    }

    /* Chevron Rotations */
    .qk-editor-split.qk-state-preview .qk-editor-pane .qk-pane-mobile-toggle i {
        transform: rotate(180deg);
    }

    .qk-editor-split.qk-state-preview .qk-preview-pane .qk-pane-mobile-toggle i {
        transform: rotate(180deg);
    }
}

/* Responsive Rules for Desktop/Tablet layout */
@media (min-width: 801px) {
    .qk-desktop-only {
        display: flex !important;
    }
    .qk-mobile-only {
        display: none !important;
    }

    .qk-editor-pane {
        width: 50% !important;
        flex: 1 1 50% !important;
    }
    
    .qk-preview-pane {
        width: 50% !important;
        flex: 1 1 50% !important;
        border-left: 1px solid var(--border-color);
    }
    
    /* Collapsed Preview State on Desktop */
    .qk-editor-split.qk-preview-collapsed-desktop .qk-preview-pane {
        width: 0 !important;
        flex: 0 0 0 !important;
        border-left: none !important;
        opacity: 0;
        pointer-events: none;
    }
    
    .qk-editor-split.qk-preview-collapsed-desktop .qk-editor-pane {
        width: 100% !important;
        flex: 1 0 100% !important;
        border-right: none !important;
    }
}

/* Fallback visibility helper classes */
.qk-desktop-only {
    display: flex !important;
}
.qk-mobile-only {
    display: none !important;
}

@media (max-width: 800px) {
    .qk-desktop-only {
        display: none !important;
    }
    .qk-mobile-only {
        display: flex !important;
    }
}

/* Drag and Drop Overlay */
.qk-drag-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(9, 10, 15, 0.85);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    border: 3px dashed rgba(99, 102, 241, 0.4);
    box-sizing: border-box;
    padding: 20px;
}

.qk-drag-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.qk-drag-message {
    text-align: center;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.qk-drag-overlay.active .qk-drag-message {
    transform: translateY(0);
}

.qk-drag-icon {
    font-size: 5rem;
    color: var(--accent);
    filter: drop-shadow(0 0 15px var(--accent-glow));
    animation: dragPulse 2s infinite ease-in-out;
}

.qk-drag-message h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.qk-drag-message p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 380px;
    line-height: 1.6;
}

@keyframes dragPulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 15px var(--accent-glow)); }
    50% { transform: scale(1.1); filter: drop-shadow(0 0 25px rgba(99, 102, 241, 0.5)); }
}

/* Share Note Modal Styles */
.qk-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(9, 10, 15, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.qk-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.qk-modal-card {
    background: rgba(20, 22, 32, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 28px;
    corner-shape: squircle;
    width: 90%;
    max-width: 500px;
    padding: 1.75rem;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5), 0 0 30px rgba(99, 102, 241, 0.15);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.qk-modal-overlay.active .qk-modal-card {
    transform: translateY(0) scale(1);
}

.qk-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 0.75rem;
}

.qk-modal-header h2 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
}

.qk-modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    transition: var(--transition-smooth);
    padding: 0.25rem;
}

.qk-modal-close:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}

.qk-modal-body p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

.qk-share-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.qk-share-field label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.qk-share-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.qk-btn-icon {
    padding: 0.6rem;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    text-decoration: none;
}

.qk-btn-icon:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
}

/* Premium CodeMirror 5 Overrides */
.CodeMirror {
    height: 100% !important;
    font-family: 'Fira Code', 'JetBrains Mono', monospace !important;
    font-size: 0.9rem !important;
    background: transparent !important;
    color: var(--text-primary) !important;
    line-height: 1.6 !important;
    flex-grow: 1;
}

.CodeMirror-gutters {
    background: rgba(9, 10, 15, 0.2) !important;
    border-right: 1px solid var(--border-color) !important;
    padding-right: 5px !important;
}

.CodeMirror-linenumber {
    color: var(--text-muted) !important;
    font-size: 0.8rem;
    padding-right: 5px !important;
    min-width: 24px !important;
    text-align: right !important;
}

.CodeMirror-cursor {
    border-left: 2px solid var(--accent) !important;
    box-shadow: 0 0 8px var(--accent-glow);
}

.CodeMirror-scroll {
    padding: 1.25rem 0.5rem !important;
}

.CodeMirror-selected {
    background: rgba(99, 102, 241, 0.2) !important;
}

.CodeMirror-focused .CodeMirror-selected {
    background: rgba(99, 102, 241, 0.3) !important;
}

/* Align active editor scrollbars with the app design */
.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
    background: transparent !important;
}

/* Markdown and Editor Pane Layout tweaks */
.qk-editor-pane {
    overflow: hidden;
}

.qk-textarea {
    display: none; /* Hidden when CodeMirror initiates */
}

/* Collaborative editor remote cursors */
.remote-cursor {
    display: inline-block;
    width: 0;
    pointer-events: none;
    position: relative;
    z-index: 100;
    vertical-align: top;
}

.remote-cursor-line {
    position: absolute;
    top: 0;
    left: -1px; /* Center over the cursor gap */
    width: 2px;
    height: 1.25em;
    pointer-events: none;
}

.remote-cursor-tooltip {
    position: absolute;
    top: -1.45em;
    left: -1px;
    padding: 1px 5px;
    border-radius: 3px;
    color: #ffffff;
    font-size: 0.65rem;
    font-family: var(--font-body);
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translateY(2px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    line-height: 1.2;
    z-index: 101;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.remote-cursor:hover .remote-cursor-tooltip,
.remote-cursor-tooltip.active {
    opacity: 1;
    transform: translateY(0);
}

/* Premium Glassmorphic Offline Toast */
.qk-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: rgba(239, 68, 68, 0.12);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 12px;
    box-shadow: 0 12px 40px 0 rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    font-family: 'Outfit', sans-serif;
    
    /* Animation state - start hidden */
    opacity: 0;
    transform: translateY(150%) scale(0.95);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.qk-toast.active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.qk-toast-icon {
    font-size: 1.5rem;
    color: #ef4444;
    animation: flash-toast 1.5s infinite alternate;
}

@keyframes flash-toast {
    0% { opacity: 0.5; filter: drop-shadow(0 0 0 rgba(239, 68, 68, 0)); }
    100% { opacity: 1; filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.8)); }
}

.qk-toast-content {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.qk-toast-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #f87171;
}

.qk-toast-desc {
    font-size: 0.8rem;
    color: #fca5a5;
    opacity: 0.9;
}

.qk-toast-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.qk-toast-btn:hover {
    background: #dc2626;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
    transform: translateY(-1px);
}

.qk-toast-btn:active {
    transform: translateY(0);
}

/* CodeMirror Read-Only Locked State styling */
.CodeMirror.qk-editor-locked {
    opacity: 0.65;
    filter: grayscale(40%);
    pointer-events: none;
    transition: all 0.3s ease;
}

/* Quikeep Note Attachments styling */
.qk-attachments-section {
    padding: 0.75rem 2rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.qk-attachments-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.qk-attachments-title i {
    font-size: 0.8rem;
}

.qk-attachments-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
}

.qk-attachment-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 4px 8px;
    border-radius: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.qk-attachment-pill:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.qk-attachment-pill.uploading {
    opacity: 0.7;
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.2);
    animation: pulseUploading 1.5s infinite ease-in-out;
}

@keyframes pulseUploading {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.9; }
}

.qk-attachment-thumb {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background-color: rgba(0, 0, 0, 0.2);
}

.qk-attachment-icon-wrapper {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.qk-attachment-icon {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.qk-attachment-name {
    font-size: 0.75rem;
    color: var(--text-secondary);
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.qk-attachment-action {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 3px 5px;
    border-radius: 6px;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.qk-attachment-action:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.qk-attachment-delete:hover {
    color: #f87171 !important;
    background: rgba(239, 68, 68, 0.15) !important;
}

.qk-attachment-share:hover {
    color: #a5b4fc !important;
    background: rgba(99, 102, 241, 0.15) !important;
}

.qk-attachments-empty {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
    padding: 2px 0;
}

/* Sleek Glassmorphic Login Screen */
.auth {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.12), transparent 45%),
                radial-gradient(circle at bottom left, rgba(168, 85, 247, 0.08), transparent 40%),
                #090a0f;
    box-sizing: border-box;
    padding: 24px;
    font-family: 'Inter', sans-serif;
}

.auth-card {
    background: rgba(20, 22, 32, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    width: 100%;
    max-width: 420px;
    padding: 3rem 2.5rem;
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.6), 0 0 40px rgba(99, 102, 241, 0.05);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    animation: authFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authFadeIn {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: var(--accent, #6366f1);
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 2rem;
    filter: drop-shadow(0 0 12px rgba(99, 102, 241, 0.25));
}

.auth-logo i {
    transform: rotate(-45deg);
}

.auth-card h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 600;
    color: #ffffff;
    text-align: center;
    margin-bottom: 0.4rem;
}

.auth-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary, #94a3b8);
    text-align: center;
    margin-bottom: 2.25rem;
}

.error-toast {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 12px;
    color: #fca5a5;
    padding: 0.8rem 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    animation: shakeError 0.4s ease;
}

@keyframes shakeError {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.input-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.input-wrapper i {
    position: absolute;
    left: 14px;
    color: var(--text-muted, #64748b);
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    background: rgba(9, 10, 15, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--accent, #6366f1);
    background: rgba(9, 10, 15, 0.8);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.input-wrapper input:focus + i {
    color: var(--accent, #6366f1);
}

.auth-btn {
    width: 100%;
    margin-top: 1rem;
    padding: 12px;
    background: var(--accent, #6366f1);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.25);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-btn:hover {
    background: #4f46e5;
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.auth-btn:active {
    transform: translateY(0);
}

.auth-btn i {
    transition: transform 0.2s ease;
}

.auth-btn:hover i {
    transform: translateX(3px);
}

/* Rooms Dashboard (Index Page) Layout */
.qk-dashboard {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.08), transparent 45%),
                radial-gradient(circle at bottom left, rgba(168, 85, 247, 0.05), transparent 40%),
                #090a0f;
    overflow-y: auto;
    box-sizing: border-box;
}

.qk-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(9, 10, 15, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 10;
}

.qk-dashboard-header .qk-brand {
    padding: 0;
}

.qk-dashboard-actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.qk-admin-badge {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: #a5b4fc;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.qk-logout-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.qk-logout-btn:hover {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
}

.qk-dashboard-container {
    flex: 1;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 3rem 2.5rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

/* Dashboard Global Search bar */
.qk-dashboard-search-container {
    width: 100%;
}

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

.qk-search-bar-wrapper .search-bar-icon {
    position: absolute;
    left: 20px;
    color: #64748b;
    font-size: 1.2rem;
    transition: color 0.2s ease;
}

.qk-global-search-input {
    width: 100%;
    padding: 1.1rem 1.5rem 1.1rem 3.5rem;
    background: rgba(20, 22, 32, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    font-size: 1.05rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.qk-global-search-input:focus {
    outline: none;
    border-color: #6366f1;
    background: rgba(20, 22, 32, 0.85);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15), 0 8px 30px rgba(0, 0, 0, 0.2);
}

.qk-global-search-input:focus + .search-bar-icon {
    color: #6366f1;
}

/* Dashboard content sections */
.qk-dashboard-content-area {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.qk-dashboard-section-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 0.4rem 0;
}

.qk-dashboard-section-header p {
    font-size: 0.95rem;
    color: #94a3b8;
    margin: 0;
}

/* Rooms Grid */
.qk-rooms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
    width: 100%;
}

.qk-room-card {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    padding: 1.4rem;
    background: rgba(20, 22, 32, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.qk-room-card:hover {
    transform: translateY(-2px);
    background: rgba(20, 22, 32, 0.7);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2), 0 0 15px rgba(99, 102, 241, 0.05);
}

.qk-room-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a5b4fc;
    font-size: 1.25rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.qk-room-card:hover .qk-room-card-icon {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
    color: #ffffff;
    transform: scale(1.05);
}

.qk-room-card-details {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-width: 0;
}

.qk-room-card-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 0.2rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qk-room-card-count {
    font-size: 0.85rem;
    color: #94a3b8;
}

.qk-room-card-arrow {
    color: #475569;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.qk-room-card:hover .qk-room-card-arrow {
    color: #a5b4fc;
    transform: translateX(3px);
}

/* Room Launcher */
.qk-dashboard-launcher-section {
    margin-top: 1.5rem;
    width: 100%;
}

.qk-dashboard-launcher-card {
    background: rgba(20, 22, 32, 0.25);
    border: 1px dashed rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 2.25rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.qk-dashboard-launcher-card h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 0.5rem 0;
}

.qk-dashboard-launcher-card p {
    font-size: 0.9rem;
    color: #94a3b8;
    max-width: 550px;
    margin: 0 0 1.75rem 0;
    line-height: 1.5;
}

.qk-launcher-form {
    display: flex;
    gap: 0.75rem;
    width: 100%;
    max-width: 500px;
}

.qk-launcher-input {
    flex-grow: 1;
    padding: 0.75rem 1.1rem;
    background: rgba(9, 10, 15, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.qk-launcher-input:focus {
    outline: none;
    border-color: #6366f1;
    background: rgba(9, 10, 15, 0.85);
}

.qk-launcher-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 500px;
    margin: 1.25rem 0;
    position: relative;
}

.qk-launcher-divider::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    z-index: 1;
}

.qk-launcher-divider span {
    background: #090a0f;
    padding: 0 1rem;
    color: #64748b;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
    z-index: 2;
}

.qk-launcher-random-btn {
    width: 100%;
    max-width: 500px;
    height: 46px;
}

/* Global Search Results UI */
.qk-search-results-section h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.35rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 1.25rem 0;
}

.qk-search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.qk-search-result-card {
    background: rgba(20, 22, 32, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-left: 4px solid var(--accent);
    border-radius: 16px;
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-height: 160px;
    box-sizing: border-box;
}

.qk-search-result-card:hover {
    transform: translateY(-2px);
    background: rgba(20, 22, 32, 0.8);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
}

.qk-search-result-card-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.qk-search-result-room {
    font-size: 0.75rem;
    font-weight: 600;
    color: #a5b4fc;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.qk-search-result-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: #ffffff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qk-search-result-snippet {
    font-size: 0.85rem;
    color: #94a3b8;
    line-height: 1.5;
    margin: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    flex-grow: 1;
}

.qk-search-result-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: auto;
}

.qk-search-result-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.qk-search-result-tag {
    font-size: 0.75rem;
    color: #6366f1;
    background: rgba(99, 102, 241, 0.08);
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    border: 1px solid rgba(99, 102, 241, 0.12);
}

.qk-search-empty-state {
    text-align: center;
    padding: 5rem 2.5rem;
    background: rgba(20, 22, 32, 0.25);
    border: 1px dashed rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.qk-search-empty-state i {
    font-size: 2.5rem;
    color: #475569;
    margin-bottom: 1.25rem;
}

.qk-search-empty-state h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 0.4rem 0;
}

.qk-search-empty-state p {
    font-size: 0.95rem;
    color: #94a3b8;
    margin: 0;
}

.qk-search-empty-state p span {
    color: #ffffff;
    font-weight: 500;
}

