/* ===================================================
   Nepal-GPT Professional Executive Glassmorphic UI
   =================================================== */

:root {
    --bg-main: #06080e;
    --bg-sidebar: #0a0d16;
    --bg-card: rgba(14, 18, 28, 0.75);
    --bg-card-hover: rgba(20, 26, 42, 0.9);
    --bg-user-msg: #171b28;
    --bg-input: rgba(13, 16, 26, 0.95);
    --bg-pill: rgba(255, 255, 255, 0.05);

    --primary-gradient: linear-gradient(135deg, #e11d48 0%, #b91c1c 45%, #6366f1 100%);
    --brand-glow: 0 0 24px rgba(225, 29, 72, 0.35);

    --accent-crimson: #e11d48;
    --accent-rose: #f43f5e;
    --accent-blue: #3b82f6;
    --accent-cyan: #38bdf8;
    --accent-emerald: #10b981;
    --accent-gold: #f59e0b;

    --border-color: rgba(255, 255, 255, 0.08);
    --border-user-msg: rgba(255, 255, 255, 0.12);
    --border-active: rgba(225, 29, 72, 0.45);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-bright: #ffffff;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;

    --shadow-subtle: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 25px rgba(225, 29, 72, 0.25);

    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', 'Mukta', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    line-height: 1.6;
    letter-spacing: -0.01em;
}

/* App Layout */
.app-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: relative;
}

/* Drag and Drop Overlay */
.drag-drop-overlay {
    position: absolute;
    inset: 0;
    background: rgba(6, 8, 14, 0.85);
    backdrop-filter: blur(8px);
    z-index: 150;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.drag-drop-overlay.active {
    display: flex;
}

.drag-drop-box {
    background: rgba(16, 22, 38, 0.95);
    border: 2px dashed #38bdf8;
    border-radius: var(--radius-lg);
    padding: 40px 60px;
    text-align: center;
    color: #f1f5f9;
    box-shadow: 0 0 35px rgba(56, 189, 248, 0.35);
    animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }
}

.drag-drop-box i {
    font-size: 3rem;
    color: #38bdf8;
    margin-bottom: 12px;
}

.drag-drop-box h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.drag-drop-box p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ===================================================
   SIDEBAR
   =================================================== */
.sidebar {
    width: 300px;
    min-width: 300px;
    height: 100%;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 16px;
    gap: 12px;
    z-index: 50;
    transition: var(--transition);
}

.sidebar.collapsed {
    margin-left: -300px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 2px;
}

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

.brand-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(225, 29, 72, 0.2) 0%, rgba(99, 102, 241, 0.2) 100%);
    border: 1px solid rgba(225, 29, 72, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 16px rgba(225, 29, 72, 0.35);
    padding: 4px;
    overflow: hidden;
}

.brand-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.brand-title {
    font-family: 'Outfit', 'Mukta', sans-serif;
    font-size: 1.22rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--text-bright);
}

.pro-badge {
    background: rgba(225, 29, 72, 0.12);
    border: 1px solid rgba(225, 29, 72, 0.4);
    color: #fb7185;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    letter-spacing: 0.5px;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

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

.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.new-chat-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(225, 29, 72, 0.08);
    border: 1px solid rgba(225, 29, 72, 0.3);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.new-chat-btn:hover {
    background: rgba(225, 29, 72, 0.16);
    border-color: rgba(225, 29, 72, 0.55);
    transform: translateY(-1px);
}

.new-chat-btn .btn-text {
    display: flex;
    align-items: center;
    gap: 8px;
}

.new-chart-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(14, 165, 233, 0.08);
    border: 1px solid rgba(14, 165, 233, 0.28);
    border-radius: var(--radius-md);
    padding: 9px 14px;
    color: #38bdf8;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.new-chart-btn:hover {
    background: rgba(14, 165, 233, 0.15);
    border-color: rgba(14, 165, 233, 0.45);
    transform: translateY(-1px);
}

.new-chart-btn .btn-text {
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge-feature {
    font-size: 0.68rem;
    background: rgba(14, 165, 233, 0.2);
    color: #38bdf8;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.shortcut-key {
    font-size: 0.72rem;
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text-muted);
    font-weight: 600;
}

.history-search-wrapper {
    position: relative;
    width: 100%;
}

.history-search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 7px 12px 7px 30px;
    color: var(--text-primary);
    font-size: 0.78rem;
    outline: none;
    transition: var(--transition);
}

.history-search-input:focus {
    border-color: var(--border-active);
    background: rgba(255, 255, 255, 0.06);
}

.history-search-wrapper .search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: var(--text-muted);
    pointer-events: none;
}

.search-clear-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 2px 4px;
    border-radius: 4px;
    transition: var(--transition);
}

.search-clear-btn:hover {
    color: #f87171;
    background: rgba(255, 255, 255, 0.08);
}

.history-empty-msg {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 10px;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.78rem;
    text-align: center;
}

.history-empty-msg i {
    font-size: 1.2rem;
    opacity: 0.6;
}

.mode-section,
.model-section {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.section-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
}

.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.mode-select,
.model-select {
    width: 100%;
    appearance: none;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 30px 8px 12px;
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: var(--transition);
}

.mode-select {
    border-color: rgba(56, 189, 248, 0.25);
    background: rgba(56, 189, 248, 0.04);
    color: #e0f2fe;
}

.mode-select:focus,
.mode-select:hover {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.08);
}

.model-select:focus,
.model-select:hover {
    border-color: var(--border-active);
    background: rgba(255, 255, 255, 0.06);
}

.mode-select option,
.model-select option {
    background: #0f1322;
    color: #fff;
    padding: 6px;
}

.select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    color: var(--text-muted);
    pointer-events: none;
}

/* ===================================================
   CHAT HISTORY LIST WITH PIN & RENAME
   =================================================== */
.recent-chats-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
}

.recent-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.clear-all-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.72rem;
    cursor: pointer;
    transition: var(--transition);
}

.clear-all-btn:hover {
    color: #f87171;
}

.chats-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-right: 4px;
}

.chats-list::-webkit-scrollbar {
    width: 4px;
}

.chats-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.history-group-header {
    font-size: 0.65rem;
    font-weight: 700;
    color: #38bdf8;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin: 8px 0 2px 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.history-group-header.pinned-header {
    color: #f59e0b;
}

.chat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.83rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    position: relative;
}

.chat-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.chat-item.active {
    background: rgba(225, 29, 72, 0.16);
    color: #ffffff;
    font-weight: 500;
    border: 1px solid rgba(225, 29, 72, 0.45);
}

.chat-item.pinned {
    border-left: 2px solid #f59e0b;
}

.chat-item-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-title-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pinned-badge-icon {
    font-size: 0.7rem;
    color: #f59e0b;
    margin-right: 4px;
}

.chat-item-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    opacity: 0;
    transition: var(--transition);
    position: relative;
    z-index: 5;
    pointer-events: auto;
}

.chat-item:hover .chat-item-actions,
.chat-item.active .chat-item-actions {
    opacity: 1;
}

.chat-action-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    transition: var(--transition);
    position: relative;
    z-index: 6;
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.chat-action-btn * {
    pointer-events: none;
}

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

.chat-action-btn.pin-btn.is-pinned {
    color: #f59e0b;
    opacity: 1;
}

.chat-action-btn.delete-btn:hover {
    color: #f87171;
    background: rgba(239, 68, 68, 0.2);
}

.chat-rename-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #38bdf8;
    border-radius: 4px;
    padding: 3px 6px;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.82rem;
    outline: none;
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.persona-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 2px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.persona-btn:hover {
    color: var(--text-primary);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #10b981;
    box-shadow: 0 0 8px #10b981;
}

.status-text {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ===================================================
   MAIN CHAT CANVAS
   =================================================== */
.main-chat {
    flex: 1;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at 50% 5%, #101526 0%, #06080e 75%);
    position: relative;
    overflow: hidden;
}

.chat-header {
    height: 60px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: rgba(6, 8, 14, 0.8);
    backdrop-filter: blur(14px);
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-menu-btn {
    display: none;
    font-size: 1.1rem;
}

.chat-title-container {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.chat-title-container:hover {
    background: rgba(255, 255, 255, 0.05);
}

.chat-title {
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--text-bright);
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-title-edit-icon {
    font-size: 0.72rem;
    color: var(--text-muted);
    opacity: 0;
    transition: var(--transition);
}

.chat-title-container:hover .header-title-edit-icon {
    opacity: 1;
}

.header-pin-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
}

.header-pin-btn:hover,
.header-pin-btn.is-pinned {
    color: #f59e0b;
}

.mode-pill {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.model-pill {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.model-pill i {
    color: var(--text-muted);
    font-size: 0.68rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-action-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.header-action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.reset-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
}

.reset-btn:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
}

/* Messages Container */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 28px 24px 140px 24px;
    display: flex;
    flex-direction: column;
}

.messages-container::-webkit-scrollbar {
    width: 6px;
}

.messages-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.messages-list {
    max-width: 820px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* ===================================================
   EXECUTIVE WELCOME HERO SCREEN
   =================================================== */
.welcome-screen {
    max-width: 820px;
    width: 100%;
    margin: auto;
    text-align: center;
    padding: 36px 20px 20px 20px;
    animation: fadeIn 0.3s ease-out;
}

.welcome-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.welcome-badge-wrapper {
    margin-bottom: 16px;
    position: relative;
}

.welcome-badge-glow {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    transition: var(--transition);
}

.welcome-badge-glow:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
}

.welcome-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.welcome-hero-title {
    font-family: 'Outfit', 'Inter', -apple-system, sans-serif;
    font-size: 2.2rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
    color: #f8fafc;
}

.welcome-hero-sub {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 400;
    max-width: 560px;
    line-height: 1.55;
    margin-bottom: 24px;
}

/* Segmented Focus Mode Pills Bar */
.mode-pills-bar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 28px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 4px;
    border-radius: var(--radius-full);
}

.mode-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid transparent;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.mode-pill-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.mode-pill-btn.active {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.mode-pill-btn i {
    font-size: 0.78rem;
    opacity: 0.85;
}

/* Sleek Minimalist Starter Prompts Grid */
.starter-prompts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    width: 100%;
    max-width: 760px;
}

.starter-chip {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 13px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.86rem;
    font-family: inherit;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.starter-chip:hover {
    background: rgba(255, 255, 255, 0.055);
    border-color: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.chip-icon {
    font-size: 0.95rem;
    color: var(--text-muted);
    transition: var(--transition);
    flex-shrink: 0;
}

.starter-chip:hover .chip-icon {
    color: #f1f5f9;
}

.chip-title {
    font-weight: 500;
    color: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 640px) {
    .starter-prompts-grid {
        grid-template-columns: 1fr;
    }

    .welcome-hero-title {
        font-size: 1.6rem;
    }
}

/* ===================================================
   PROFESSIONAL MESSAGE ROWS
   =================================================== */
.message-row {
    display: flex;
    flex-direction: column;
    width: 100%;
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-content-wrapper {
    display: flex;
    gap: 14px;
    width: 100%;
}

.message-row.user .message-content-wrapper {
    justify-content: flex-end;
}

.message-row.bot .message-content-wrapper {
    justify-content: flex-start;
}

/* Avatars */
.message-avatar {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 600;
    overflow: hidden;
    margin-top: 2px;
}

.message-avatar.user-avatar {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #ffffff;
    order: 2;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.message-avatar.bot-avatar {
    background: linear-gradient(135deg, rgba(225, 29, 72, 0.2) 0%, rgba(99, 102, 241, 0.2) 100%);
    border: 1px solid rgba(225, 29, 72, 0.4);
    order: 1;
    border-radius: 9px;
    box-shadow: 0 0 12px rgba(225, 29, 72, 0.25);
    padding: 3px;
}

.bot-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Message Bubbles */
.message-bubble {
    font-size: 0.95rem;
    line-height: 1.65;
    max-width: 82%;
    word-break: break-word;
    position: relative;
}

.message-row.user .message-bubble {
    background: linear-gradient(135deg, #1d2235 0%, #171b2a 100%);
    color: #f8fafc;
    border: 1px solid var(--border-user-msg);
    padding: 12px 18px;
    border-radius: 18px 18px 4px 18px;
    order: 1;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.message-row.bot .message-bubble {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: #f1f5f9;
    padding: 14px 20px;
    border-radius: 4px 18px 18px 18px;
    order: 2;
    box-shadow: var(--shadow-subtle);
    backdrop-filter: blur(12px);
}

.user-attached-image-wrapper {
    margin-bottom: 10px;
    border-radius: var(--radius-md);
    overflow: hidden;
    max-width: 320px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.user-attached-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.user-attached-file-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: #bae6fd;
    margin-bottom: 8px;
}

/* Actions Bar */
.msg-actions-bar {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-top: 6px;
    opacity: 0.85;
    transition: var(--transition);
}

.message-row:hover .msg-actions-bar {
    opacity: 1;
}

.message-row.user .msg-actions-bar {
    justify-content: flex-end;
    padding-right: 48px;
}

.message-row.bot .msg-actions-bar {
    justify-content: flex-start;
    padding-left: 48px;
}

.action-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.76rem;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
    transition: var(--transition);
}

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

.action-btn.liked {
    color: #10b981 !important;
    background: rgba(16, 185, 129, 0.12);
}

.action-btn.disliked {
    color: #f87171 !important;
    background: rgba(239, 68, 68, 0.12);
}

/* User Message Inline Edit Box */
.user-edit-box {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-edit-textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.92rem;
    resize: vertical;
    outline: none;
    line-height: 1.5;
}

.user-edit-textarea:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

.edit-btn-row {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.edit-btn-save {
    background: #2563eb;
    color: #ffffff;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.edit-btn-save:hover {
    background: #1d4ed8;
}

.edit-btn-cancel {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
}

.edit-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

/* Code Block Wrapper & Copy Code */
.code-block-wrapper {
    background: #080a12;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    margin: 14px 0;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.code-header {
    background: rgba(255, 255, 255, 0.035);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 7px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.code-lang {
    font-size: 0.72rem;
    font-weight: 700;
    color: #7dd3fc;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.copy-code-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    font-size: 0.74rem;
    padding: 3px 10px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
}

.copy-code-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
}

.code-block-wrapper pre {
    background: transparent !important;
    border: none !important;
    padding: 14px 16px !important;
    margin: 0 !important;
    overflow-x: auto;
}

/* Markdown Elements */
.message-bubble p {
    margin-bottom: 10px;
}

.message-bubble p:last-child {
    margin-bottom: 0;
}

.message-bubble ul,
.message-bubble ol {
    margin: 8px 0 10px 22px;
}

.message-bubble li {
    margin-bottom: 4px;
}

.message-bubble table {
    border-collapse: collapse;
    width: 100%;
    margin: 14px 0;
    font-size: 0.88rem;
}

.message-bubble th,
.message-bubble td {
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 8px 12px;
    text-align: left;
}

.message-bubble th {
    background: rgba(255, 255, 255, 0.05);
    color: #f8fafc;
    font-weight: 600;
}

.message-bubble code {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.88rem;
}

.message-bubble :not(pre)>code {
    background: rgba(225, 29, 72, 0.12);
    border: 1px solid rgba(225, 29, 72, 0.25);
    padding: 2px 6px;
    border-radius: 4px;
    color: #fecdd3;
}

/* Typing Wave Animation */
.typing-wave {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 4px;
}

.typing-wave span {
    width: 6px;
    height: 6px;
    background-color: var(--accent-crimson);
    border-radius: 50%;
    animation: wave 1.2s infinite ease-in-out;
}

.typing-wave span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-wave span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes wave {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    30% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

.cursor-blink {
    display: inline-block;
    width: 7px;
    height: 14px;
    background-color: var(--accent-crimson);
    margin-left: 4px;
    vertical-align: middle;
    animation: blink 0.8s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Error Card with Retry Button */
.error-card {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: #fca5a5;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.error-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #ef4444;
}

.retry-action-btn {
    align-self: flex-start;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #ffffff;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.retry-action-btn:hover {
    background: rgba(239, 68, 68, 0.35);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: #1e293b;
    border: 1px solid var(--border-active);
    color: #f8fafc;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    font-size: 0.86rem;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideIn 0.25s ease, fadeOut 0.25s 1.75s ease forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-6px);
    }
}

/* Attachment Preview Container above Input */
.attachment-preview-container {
    max-width: 820px;
    width: 100%;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.attachment-card {
    background: rgba(16, 22, 38, 0.95);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: var(--radius-md);
    padding: 6px 12px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    animation: fadeIn 0.2s ease;
}

.attachment-thumb-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.attachment-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.attachment-file-icon {
    font-size: 1.3rem;
    color: #38bdf8;
    display: flex;
    align-items: center;
}

.attachment-details {
    display: flex;
    flex-direction: column;
}

.attachment-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #f1f5f9;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-size {
    font-size: 0.7rem;
    color: #7dd3fc;
}

.remove-attachment-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: var(--transition);
}

.attachment-progress-wrapper {
    width: 240px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px 4px;
}

.attachment-progress-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.76rem;
    color: #38bdf8;
    font-weight: 500;
}

.attachment-progress-track {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.attachment-progress-fill {
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, #38bdf8, #818cf8, #e11d48);
    border-radius: 2px;
    animation: indeterminateProgress 1.4s infinite ease-in-out;
}

@keyframes indeterminateProgress {
    0% {
        transform: translateX(-100%) scaleX(0.2);
    }

    50% {
        transform: translateX(50%) scaleX(0.7);
    }

    100% {
        transform: translateX(200%) scaleX(0.2);
    }
}

.study-actions-bar {
    max-width: 820px;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    padding: 0 4px 8px 4px;
    scrollbar-width: none;
}

.study-actions-bar::-webkit-scrollbar {
    display: none;
}

.study-actions-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #f59e0b;
    white-space: nowrap;
}

.study-action-btn {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: #fef3c7;
    font-size: 0.74rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.study-action-btn:hover {
    background: rgba(245, 158, 11, 0.2);
    border-color: #f59e0b;
    color: #ffffff;
    transform: translateY(-1px);
}

.study-action-btn.is-quiz {
    background: rgba(225, 29, 72, 0.12);
    border-color: rgba(225, 29, 72, 0.35);
    color: #ffe4e6;
}

.study-action-btn.is-quiz:hover {
    background: rgba(225, 29, 72, 0.25);
    border-color: #f43f5e;
    color: #ffffff;
}

.doc-quick-chips {
    max-width: 820px;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    padding: 0 4px 8px 4px;
    scrollbar-width: none;
}

.doc-quick-chips::-webkit-scrollbar {
    display: none;
}

.quick-chip-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #38bdf8;
    white-space: nowrap;
}

.doc-chip {
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.25);
    color: #e0f2fe;
    font-size: 0.74rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.doc-chip:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: #38bdf8;
    transform: translateY(-1px);
}

/* User Message Attached Document Card */
.user-attached-doc-card {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    padding: 8px 14px;
    margin-bottom: 8px;
}

.user-attached-doc-card .doc-icon-badge {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(225, 29, 72, 0.15);
    color: #f43f5e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.user-attached-doc-card.is-docx .doc-icon-badge {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.user-attached-doc-card.is-csv .doc-icon-badge {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.user-attached-doc-card.is-txt .doc-icon-badge {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

.user-attached-doc-card .doc-info {
    display: flex;
    flex-direction: column;
}

.user-attached-doc-card .doc-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffffff;
}

.user-attached-doc-card .doc-meta {
    font-size: 0.7rem;
    color: #94a3b8;
}

/* ===================================================
   FLOATING INPUT AREA - CLEAN EXECUTIVE DESIGN
   =================================================== */
.chat-input-wrapper {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0 24px 18px 24px;
    background: linear-gradient(to top, rgba(6, 8, 14, 0.98) 70%, transparent);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 20;
}

.input-container {
    max-width: 800px;
    width: 100%;
    min-height: 52px;
    background: rgba(18, 22, 32, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 6px 10px 6px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(16px);
    transition: var(--transition);
    position: relative;
}

.input-container:focus-within {
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

.tool-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.84rem;
    transition: var(--transition);
    flex-shrink: 0;
}

.tool-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* Language Preference Selector in Chat Input Block */
.lang-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    padding: 3px 8px 3px 10px;
    transition: var(--transition);
    flex-shrink: 0;
}

.lang-selector-wrapper:hover,
.lang-selector-wrapper:focus-within {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
}

.lang-selector-icon {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.response-lang-select {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    color: #e2e8f0;
    font-size: 0.78rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    padding: 2px 2px 2px 0;
    max-width: 140px;
}

.response-lang-select option {
    background: #0f172a;
    color: #f1f5f9;
    font-size: 0.82rem;
    padding: 6px 10px;
}

.chat-textarea {
    flex: 1;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.94rem;
    resize: none !important;
    max-height: 160px;
    min-height: 24px;
    height: 24px;
    line-height: 1.5;
    padding: 2px 4px;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: none !important;
}

.chat-textarea::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.chat-textarea::placeholder {
    color: var(--text-muted);
}

.input-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.send-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 50%;
    background: #dc2626;
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.35);
    flex-shrink: 0;
}

.send-btn:hover {
    background: #ef4444;
    transform: scale(1.04);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.45);
}

.send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.stop-btn {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    flex-shrink: 0;
}

.stop-btn:hover {
    background: rgba(239, 68, 68, 0.25);
}

.input-disclaimer {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 8px;
    text-align: center;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-card {
    background: #0f1322;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    padding: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.close-modal-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
}

.modal-body label {
    display: block;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.modal-body textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    color: #fff;
    font-family: inherit;
    font-size: 0.88rem;
    resize: vertical;
    outline: none;
    margin-bottom: 14px;
}

.modal-body textarea:focus {
    border-color: var(--border-active);
}

.quick-personas {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.quick-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.preset-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
}

.preset-chip:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn {
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.86rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn.primary {
    background: var(--primary-gradient);
    color: #fff;
}

.btn.secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .mobile-menu-btn {
        display: flex;
    }
}

/* ===================================================
   EMAIL AUTH & GUEST USAGE QUOTA STYLES
   =================================================== */

/* Sidebar Account Card */
.account-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 8px;
    transition: var(--transition);
}

.account-card:hover {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
}

.guest-quota-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.quota-title {
    color: #f59e0b;
    display: flex;
    align-items: center;
    gap: 5px;
}

.quota-count {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.quota-progress-track {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 8px;
}

.quota-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #f59e0b, #e11d48);
    border-radius: 99px;
    transition: width 0.3s ease;
}

.sidebar-auth-btn {
    width: 100%;
    padding: 7px 10px;
    background: linear-gradient(135deg, rgba(225, 29, 72, 0.2), rgba(99, 102, 241, 0.2));
    border: 1px solid rgba(225, 29, 72, 0.4);
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition);
}

.sidebar-auth-btn:hover {
    background: linear-gradient(135deg, rgba(225, 29, 72, 0.35), rgba(99, 102, 241, 0.35));
    border-color: rgba(225, 29, 72, 0.6);
    box-shadow: 0 0 12px rgba(225, 29, 72, 0.3);
}

/* User Logged In Sidebar View */
.user-info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e11d48, #6366f1);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(225, 29, 72, 0.3);
}

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

.user-email-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-tier-badge {
    font-size: 0.65rem;
    font-weight: 700;
    color: #38bdf8;
    display: flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.03em;
}

.sidebar-logout-btn {
    width: 100%;
    padding: 5px 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.74rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition);
}

.sidebar-logout-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* Header Quota Pill */
.quota-pill {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    font-size: 0.74rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.quota-pill:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
    color: var(--text-primary);
}

.quota-pill.quota-low {
    background: rgba(225, 29, 72, 0.1);
    border-color: rgba(225, 29, 72, 0.3);
    color: #fca5a5;
}

/* Header Auth Button */
.header-auth-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 500;
    color: #ffffff;
    cursor: pointer;
    transition: var(--transition);
}

.header-auth-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.25);
}

/* Header User Pill */
.user-pill-wrapper {
    position: relative;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition);
}

.user-pill:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.2);
}

.user-pill-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e11d48, #6366f1);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-pill-email {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-primary);
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pill-arrow {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 200px;
    background: rgba(14, 18, 28, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(16px);
    padding: 10px;
    z-index: 200;
    animation: fadeIn 0.15s ease-out;
}

.dropdown-header {
    padding: 6px 8px;
}

.dropdown-email {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-all;
}

.dropdown-badge {
    font-size: 0.68rem;
    color: #38bdf8;
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 8px 0;
}

.dropdown-item {
    width: 100%;
    padding: 7px 10px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.dropdown-item:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

/* ===================================================
   EMAIL AUTH MODAL & FORM
   =================================================== */
.auth-modal-card {
    max-width: 440px;
    width: 90%;
    background: rgba(13, 17, 28, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(225, 29, 72, 0.15);
}

.auth-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-brand-badge {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #e11d48, #6366f1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 0 15px rgba(225, 29, 72, 0.4);
}

.auth-modal-title h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.auth-modal-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 2px 0 0 0;
}

.auth-modal-body {
    padding-top: 14px;
}

.auth-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    padding: 4px;
    margin-bottom: 16px;
    gap: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-tab {
    flex: 1;
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: calc(var(--radius-sm) - 2px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: all 0.2s ease;
}

.auth-tab:hover {
    color: var(--text-primary);
}

.auth-tab.active {
    background: linear-gradient(135deg, rgba(225, 29, 72, 0.25), rgba(99, 102, 241, 0.35));
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.auth-form-group {
    margin-bottom: 14px;
}

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

.auth-input-wrapper {
    position: relative;
    width: 100%;
}

.auth-input-wrapper input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 0.92rem;
    outline: none;
    transition: var(--transition);
}

.auth-input-wrapper.has-toggle input {
    padding-right: 42px;
}

.password-toggle-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.password-toggle-btn:hover {
    color: #38bdf8;
}

.auth-switch-mode {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 8px 0 14px 0;
}

.auth-switch-btn {
    background: none;
    border: none;
    color: #38bdf8;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    margin-left: 5px;
    text-decoration: underline;
    transition: color 0.2s;
}

.auth-switch-btn:hover {
    color: #7dd3fc;
}

.auth-input-wrapper input:focus {
    border-color: #38bdf8;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

.auth-field-hint {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.auth-actions-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 4px;
}

.auth-submit-btn {
    width: 100%;
    padding: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-quick-btn {
    width: 100%;
    padding: 9px;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-quick-btn:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.2);
}

.auth-perks-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.perk-item i {
    color: #10b981;
    font-size: 0.8rem;
}

/* Step 2: OTP Styles */
.otp-sent-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 0.8rem;
    color: #d1fae5;
    margin-bottom: 14px;
}

.otp-sent-info .info-icon {
    font-size: 1.1rem;
    color: #10b981;
}

.change-email-btn {
    background: none;
    border: none;
    color: #38bdf8;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    margin-left: 6px;
}

.otp-input-field {
    text-align: center;
    letter-spacing: 0.35em;
    font-size: 1.3rem !important;
    font-weight: 700;
    font-family: monospace;
}

.demo-otp-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(245, 158, 11, 0.1);
    border: 1px dashed rgba(245, 158, 11, 0.35);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 0.75rem;
    color: #fef3c7;
    margin-top: 8px;
}

.demo-badge {
    background: #f59e0b;
    color: #000;
    font-size: 0.62rem;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 4px;
}

.auto-fill-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 8px;
    cursor: pointer;
}

.auto-fill-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.resend-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.resend-link {
    background: none;
    border: none;
    color: #38bdf8;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

/* ===================================================
   USAGE LIMIT REACHED MODAL
   =================================================== */
.limit-modal-card {
    max-width: 400px;
    width: 90%;
    text-align: center;
    background: rgba(13, 17, 28, 0.98);
    border: 1px solid rgba(225, 29, 72, 0.35);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 35px rgba(225, 29, 72, 0.2);
}

.limit-icon-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(225, 29, 72, 0.15);
    border: 1px solid rgba(225, 29, 72, 0.4);
    color: #f43f5e;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px auto;
    box-shadow: 0 0 20px rgba(225, 29, 72, 0.3);
}

.limit-modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.limit-modal-header p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.limit-features-list {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.limit-feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--text-primary);
}

.limit-feature-item i {
    color: #10b981;
}

.limit-modal-footer {
    justify-content: center;
    gap: 12px;
}