@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

body { font-family: 'Inter', sans-serif; -webkit-tap-highlight-color: transparent; }
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-thumb { background: #30363D; border-radius: 2px; }
::-webkit-scrollbar-track { background: transparent; }

.bg-grid-pattern {
    background-size: 40px 40px;
    background-image: linear-gradient(to right, rgba(48, 54, 61, 0.3) 1px, transparent 1px),
                      linear-gradient(to bottom, rgba(48, 54, 61, 0.3) 1px, transparent 1px);
}

.mode-label { display: none; margin-left: 6px; font-weight: 600; font-size: 0.85rem;}
.mode-btn.active .mode-label { display: inline-block; }
@media (min-width: 768px) { .mode-label { display: inline-block !important; } }

.mode-btn { transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); border: 1px solid transparent; }

.mode-btn.active[data-mode="chat"] { background: rgba(0, 229, 153, 0.15); color: #00E599; border-color: rgba(0, 229, 153, 0.3); box-shadow: 0 0 15px rgba(0, 229, 153, 0.1); }
.mode-btn.active[data-mode="image"] { background: rgba(255, 0, 170, 0.15); color: #FF00AA; border-color: rgba(255, 0, 170, 0.3); box-shadow: 0 0 15px rgba(255, 0, 170, 0.1); }
.mode-btn.active[data-mode="video"] { background: rgba(0, 240, 255, 0.15); color: #00F0FF; border-color: rgba(0, 240, 255, 0.3); box-shadow: 0 0 15px rgba(0, 240, 255, 0.1); }
.mode-btn.active[data-mode="audio"] { background: rgba(189, 0, 255, 0.15); color: #BD00FF; border-color: rgba(189, 0, 255, 0.3); box-shadow: 0 0 15px rgba(189, 0, 255, 0.1); }

.no-scrollbar::-webkit-scrollbar { display: none; }

/* Landing theme overrides */
.landing-root {
    position: relative;
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(255, 255, 255, 0.06), transparent 60%),
        radial-gradient(900px 500px at 90% 0%, rgba(255, 255, 255, 0.04), transparent 55%);
}

.landing-hero {
    position: relative;
}

.landing-hero::before {
    content: "";
    position: absolute;
    inset: -60px -20px auto -20px;
    height: 320px;
    background:
        radial-gradient(circle at top left, var(--landing-glow, rgba(0, 229, 153, 0.35)), transparent 60%),
        radial-gradient(circle at 70% 10%, rgba(255, 255, 255, 0.08), transparent 55%);
    pointer-events: none;
    z-index: -1;
}

.landing-section {
    position: relative;
}

.landing-section::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -32px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
}

.landing-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.landing-title-accent {
    width: 32px;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--landing-accent, #00E599), var(--landing-accent-2, #00F0FF));
    box-shadow: 0 0 18px var(--landing-accent, #00E599);
}

.landing-dot {
    background: var(--landing-accent, #00E599);
    box-shadow: 0 0 12px var(--landing-accent, #00E599);
}

.landing-cta-primary {
    background: var(--landing-accent, #00E599);
    border-color: var(--landing-accent, #00E599);
    color: #0b0f13;
}

.landing-cta-primary:hover {
    filter: brightness(1.05);
}

.landing-cta-secondary {
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.landing-cta-secondary:hover {
    border-color: var(--landing-accent-2, #00F0FF);
}

.landing-cta-link {
    color: rgba(229, 231, 235, 0.9);
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.25);
    text-underline-offset: 4px;
}

.landing-cta-link:hover {
    color: #fff;
    text-decoration-color: var(--landing-accent-2, #00F0FF);
}

.landing-card,
.landing-panel {
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 18px;
    background: rgba(18, 21, 28, 0.78);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03), 0 18px 50px rgba(0, 0, 0, 0.35);
}

.landing-panel {
    background: linear-gradient(135deg, rgba(22, 26, 34, 0.95), rgba(12, 15, 20, 0.9));
}

.landing-stat {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    padding: 6px 10px;
    background: rgba(15, 18, 24, 0.6);
    text-align: center;
}

.landing-sticky-cta {
    position: sticky;
    bottom: 0;
    z-index: 40;
    background: rgba(8, 10, 12, 0.82);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 16px;
}

.landing-sticky-inner {
    max-width: 72rem;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

@media (max-width: 768px) {
    .landing-sticky-inner {
        flex-direction: column;
        align-items: stretch;
    }
    .landing-sticky-inner > div:last-child {
        width: 100%;
        display: flex;
        justify-content: stretch;
    }
    .landing-sticky-inner a {
        flex: 1;
        text-align: center;
    }
}

/* Fix padding for input area on mobile and desktop */
footer {
    padding: 0.5rem;
    padding-bottom: env(safe-area-inset-bottom, 20px);
}

/* Remove excessive padding on desktop */
@media (min-width: 768px) {
    footer {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* Reduce spacing above input area */
footer > div:first-child {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

/* Reduce margin between mode selector and input field */
footer > div:first-child > div:nth-child(1) {
    margin-bottom: 0.25rem;
}

/* Reduce spacing for attachments container */
#attachments-container {
    margin-bottom: 0.25rem;
    padding-bottom: 0.25rem;
}

/* Reduce padding for mode selector container */
#mode-selector-container {
    padding: 0.25rem;
}

/* Reduce padding for mode buttons */
.mode-btn {
    padding: 0.25rem 0.5rem;
}

/* Ensure proper padding for the input area */
footer .input-container {
    padding: 0 0.5rem;
    padding-bottom: 0.5rem;
}

/* Make sure the input field container has consistent padding */
footer .input-container .flex {
    padding: 0.25rem 0;
    width: 100%;
}

/* Ensure proper spacing around the input field elements */
footer .input-container .flex > * {
    margin: 0 0.125rem;
}

@media (min-width: 768px) {
    footer .input-container .flex > * {
        margin: 0 0.25rem;
    }
}

/* Ensure the textarea has proper padding for better mobile experience */
footer textarea {
    padding: 0.5rem 0.25rem;
    min-height: 44px;
}

/* Ensure consistent padding on both mobile and desktop */
@media (max-width: 767px) {
    footer .input-container {
        padding: 0 0.25rem;
    }
    
    footer .input-container .flex > * {
        margin: 0 0.0625rem;
    }
    
    /* More padding for mobile */
    footer textarea {
        padding: 0.25rem 0.125rem;
    }
}

/* Fix modal positioning */
#model-modal-overlay {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100%;
    align-items: center;
    justify-content: center;
}

/* Modal animation styles */
#model-selection-modal {
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#model-modal-overlay.active #model-selection-modal {
    transform: translateY(0);
}

/* Desktop modal centered styling */
@media (min-width: 768px) {
    #model-modal-overlay {
        align-items: center;
        justify-content: center;
        padding: 20px;
    }
    
    #model-selection-modal {
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
        border-radius: 16px;
        transform: translateY(0);
    }
    
    #model-modal-overlay.active #model-selection-modal {
        transform: translateY(0);
    }
}

/* Integration mode selector */
#integration-mode-selector {
    transition: all 0.3s ease;
}

/* Mode tabs styling for integration */
.mode-option {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    min-width: 60px;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.mode-option:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.1);
}

.mode-option.active {
    background: rgba(0, 229, 153, 0.15);
    border-color: rgba(0, 229, 153, 0.3);
    color: #00E599;
}

.mode-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.mode-option i {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 1.25rem;
}
/* Specific styling for generation type buttons */
.mode-option.chat {
    background: rgba(0, 229, 153, 0.15);
    border-color: rgba(0, 229, 153, 0.3);
    color: #00E599;
    padding: 0.25rem 0.5rem;
    min-width: 80px;
    min-height: 32px;
    font-size: 0.8rem;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
}

.mode-option.image {
    background: rgba(255, 0, 170, 0.15);
    border-color: rgba(255, 0, 170, 0.3);
    color: #FF00AA;
    padding: 0.25rem 0.5rem;
    min-width: 80px;
    min-height: 32px;
    font-size: 0.8rem;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
}

.mode-option.video {
    background: rgba(0, 240, 255, 0.15);
    border-color: rgba(0, 240, 255, 0.3);
    color: #00F0FF;
    padding: 0.25rem 0.5rem;
    min-width: 80px;
    min-height: 32px;
    font-size: 0.8rem;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
}

.mode-option.audio {
    background: rgba(189, 0, 255, 0.15);
    border-color: rgba(189, 0, 255, 0.3);
    color: #BD00FF;
    padding: 0.25rem 0.5rem;
    min-width: 80px;
    min-height: 32px;
    font-size: 0.8rem;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
}

.mode-option.chat:hover {
    background: rgba(0, 229, 153, 0.25);
}

.mode-option.image:hover {
    background: rgba(255, 0, 170, 0.25);
}

.mode-option.video:hover {
    background: rgba(0, 240, 255, 0.25);
}

.mode-option.audio:hover {
    background: rgba(189, 0, 255, 0.25);
}

/* Specific styling for generation type buttons in floating selector */
#floating-selector .mode-option.chat {
    background: rgba(0, 229, 153, 0.15);
    border-color: rgba(0, 229, 153, 0.3);
    color: #00E599;
    padding: 0.25rem 0.5rem;
    min-width: 80px;
    min-height: 32px;
    font-size: 0.8rem;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
}

#floating-selector .mode-option.image {
    background: rgba(255, 0, 170, 0.15);
    border-color: rgba(255, 0, 170, 0.3);
    color: #FF00AA;
    padding: 0.25rem 0.5rem;
    min-width: 80px;
    min-height: 32px;
    font-size: 0.8rem;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
}

#floating-selector .mode-option.video {
    background: rgba(0, 240, 255, 0.15);
    border-color: rgba(0, 240, 255, 0.3);
    color: #00F0FF;
    padding: 0.25rem 0.5rem;
    min-width: 80px;
    min-height: 32px;
    font-size: 0.8rem;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
}

#floating-selector .mode-option.audio {
    background: rgba(189, 0, 255, 0.15);
    border-color: rgba(189, 0, 255, 0.3);
    color: #BD00FF;
    padding: 0.25rem 0.5rem;
    min-width: 80px;
    min-height: 32px;
    font-size: 0.8rem;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
}

#floating-selector .mode-option.chat:hover {
    background: rgba(0, 229, 153, 0.25);
}

#floating-selector .mode-option.image:hover {
    background: rgba(255, 0, 170, 0.25);
}

#floating-selector .mode-option.video:hover {
    background: rgba(0, 240, 255, 0.25);
}

#floating-selector .mode-option.audio:hover {
    background: rgba(189, 0, 255, 0.25);
}

/* Active state for mode buttons in floating selector */
#floating-selector .mode-option.active {
    box-shadow: 0 0 0 2px currentColor;
    transform: scale(1.05);
    transition: all 0.2s ease;
}

/* Ensure proper active state styling for all mode types */
#floating-selector .mode-option.active.chat {
    background: rgba(0, 229, 153, 0.3);
    border-color: rgba(0, 229, 153, 0.5);
    color: #00E599;
}

#floating-selector .mode-option.active.image {
    background: rgba(255, 0, 170, 0.3);
    border-color: rgba(255, 0, 170, 0.5);
    color: #FF00AA;
}

#floating-selector .mode-option.active.video {
    background: rgba(0, 240, 255, 0.3);
    border-color: rgba(0, 240, 255, 0.5);
    color: #00F0FF;
}

#floating-selector .mode-option.active.audio {
    background: rgba(189, 0, 255, 0.3);
    border-color: rgba(189, 0, 255, 0.5);
    color: #BD00FF;
}

/* Make sure floating selector buttons are displayed in one line */
#floating-selector .mode-option {
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
}

/* Ensure generation type selector in floating panel displays buttons in one line */
#floating-selector #generation-type-selector {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem 0;
    margin: 0 -0.5rem;
    width: calc(100% + 1rem);
    display: flex;
    flex-wrap: nowrap !important;
    justify-content: flex-start;
}

#floating-selector #generation-type-selector::-webkit-scrollbar {
    display: none;
}

#floating-selector #generation-type-selector .mode-option {
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 0 0 auto;
    margin: 0 0.25rem;
}

/* Active state for mode buttons in floating selector */
#floating-selector .mode-option.active {
    box-shadow: 0 0 0 2px currentColor;
}

/* Ensure generation type selector in floating panel displays buttons in one line */
#floating-selector #generation-type-selector {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem 0;
    margin: 0 -0.5rem;
    width: calc(100% + 1rem);
}

#floating-selector #generation-type-selector::-webkit-scrollbar {
    display: none;
}

#floating-selector #generation-type-selector .mode-option {
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Model option styling with icons */
.model-option {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    min-width: 100px;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.model-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.model-option.active {
    background: rgba(0, 229, 153, 0.15);
    border-color: rgba(0, 229, 153, 0.3);
    color: #00E599;
}

.model-option i {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 1.25rem;
}

/* Integration selector adjustments */
#integration-mode-selector {
    max-width: 100%;
    width: 100%;
}

#integration-mode-selector .p-4 {
    padding: 1rem;
}

#integration-mode-selector h4 {
    margin-top: 0;
    margin-bottom: 0.75rem;
}

/* Adjust spacing between sections */
#integration-mode-selector .mb-4 {
    margin-bottom: 1rem;
}

/* Make mode options container more compact */
#integration-mode-options {
    gap: 0.5rem;
}

/* Hide integration selector by default */
#integration-mode-selector.hidden {
    display: none;
}

/* Model option styling with icons */
.model-option {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
}

.model-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.model-option.active {
    background: rgba(0, 229, 153, 0.15);
    border-color: rgba(0, 229, 153, 0.3);
    color: #00E599;
}

.model-option i {
    display: block;
    margin-bottom: 4px;
    font-size: 1.25rem;
}

/* Ensure modal stays within chat area boundaries */
#model-modal-overlay {
    pointer-events: none;
}

#model-modal-overlay.active {
    pointer-events: auto;
}

#model-selection-modal {
    pointer-events: auto;
}

/* Make model button larger and more prominent */
#model-trigger {
    min-width: 120px !important;
    padding: 0.5rem 0.75rem !important;
    font-size: 0.875rem !important;
    height: auto !important;
}

/* Mode labels styling for mobile */
.mode-label {
    display: none;
    margin-left: 6px;
    font-weight: 600;
    font-size: 0.85rem;
}

.mode-btn.active .mode-label {
    display: inline-block;
}

@media (min-width: 768px) {
    .mode-label {
        display: inline-block !important;
    }
}

/* Mode button styling for generation type selector */
.mode-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    min-width: 60px;
    min-height: 40px;
    padding: 0.25rem 0.5rem;
}

.mode-btn.active[data-mode="chat"] {
    background: rgba(0, 229, 153, 0.15);
    color: #00E599;
    border-color: rgba(0, 229, 153, 0.3);
    box-shadow: 0 0 15px rgba(0, 229, 153, 0.1);
}

.mode-btn.active[data-mode="image"] {
    background: rgba(255, 0, 170, 0.15);
    color: #FF00AA;
    border-color: rgba(255, 0, 170, 0.3);
    box-shadow: 0 0 15px rgba(255, 0, 170, 0.1);
}

.mode-btn.active[data-mode="video"] {
    background: rgba(0, 240, 255, 0.15);
    color: #00F0FF;
    border-color: rgba(0, 240, 255, 0.3);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.1);
}

.mode-btn.active[data-mode="audio"] {
    background: rgba(189, 0, 255, 0.15);
    color: #BD00FF;
    border-color: rgba(189, 0, 255, 0.3);
    box-shadow: 0 0 15px rgba(189, 0, 255, 0.1);
}

/* Model button styling based on mode */
#mode-background.chat {
    background: rgba(0, 229, 153, 0.15);
    color: #00E599;
    border-color: rgba(0, 229, 153, 0.3);
}

#mode-background.image {
    background: rgba(255, 0, 170, 0.15);
    color: #FF00AA;
    border-color: rgba(255, 0, 170, 0.3);
}

#mode-background.video {
    background: rgba(0, 240, 255, 0.15);
    color: #00F0FF;
    border-color: rgba(0, 240, 255, 0.3);
}

#mode-background.audio {
    background: rgba(189, 0, 255, 0.15);
    color: #BD00FF;
    border-color: rgba(189, 0, 255, 0.3);
}

/* Mode tabs styling */
.mode-option {
    flex: 0 0 auto;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 500;
    min-width: 80px;
    min-height: 32px;
}

.mode-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mode-option.active {
    background: rgba(0, 229, 153, 0.15);
    border-color: rgba(0, 229, 153, 0.3);
    color: #00E599;
}

/* Ensure mode options container displays buttons in one line */
#generation-type-selector {
    display: flex;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.25rem 0;
    margin: 0 -0.25rem;
    width: calc(100% + 0.5rem);
}

#generation-type-selector::-webkit-scrollbar {
    display: none;
}

#generation-type-selector .mode-option {
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 0 0 auto;
}

.mode-option i {
    display: block;
    margin-bottom: 4px;
    font-size: 1.25rem;
}

/* Ensure modal stays within chat area boundaries */
#model-modal-overlay {
    pointer-events: none;
}

#model-modal-overlay.active {
    pointer-events: auto;
}

#model-selection-modal {
    pointer-events: auto;
}

/* Ensure modal stays within chat area boundaries */
#model-modal-overlay {
    pointer-events: none;
}

#model-modal-overlay.active {
    pointer-events: auto;
}

#model-selection-modal {
    pointer-events: auto;
}

/* Sidebar fix for desktop view */
@media (min-width: 768px) {
    /* Default: no margin when sidebar is hidden */
    .main-content {
        margin-left: 0;
        transition: margin-left 0.3s ease;
    }
    
    /* Add margin when sidebar is visible */
    body.sidebar-visible-desktop .main-content {
        margin-left: 16rem; /* 64 * 0.25rem = 16rem */
    }
    
    /* For chat pages, sidebar is always visible on desktop */
    body.chat-page .main-content {
        margin-left: 16rem;
    }
}

/* Ensure main content area properly handles sidebar */
.main-content {
    transition: margin-left 0.3s ease;
}

/* Fix for sidebar overlapping content */


/* Floating selector for generation types and models */
#floating-selector {
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 50;
    width: 100%;
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 125px;
    left: 17rem;
    right: auto;
    height: 0;
    overflow: hidden;
}

#floating-selector.active {
    transform: translateY(0);
    visibility: visible;
    opacity: 1;
    height: auto;
    overflow: visible;
}

#floating-templates,
#floating-parameters {
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 50;
    width: 100%;
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 125px;
    left: 17rem;
    right: auto;
    height: 0;
    overflow: hidden;
}

#floating-templates.active,
#floating-parameters.active {
    transform: translateY(0);
    visibility: visible;
    opacity: 1;
    height: auto;
    overflow: visible;
}

#floating-variables {
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 50;
    width: 100%;
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 125px;
    left: 17rem;
    right: auto;
    height: 0;
    overflow: hidden;
}

@media (max-width: 767px) {
    #floating-variables {
        left: 0;
    }
}

#floating-variables.active {
    transform: translateY(0);
    visibility: visible;
    opacity: 1;
    height: auto;
    overflow: visible;
}
@media (max-width: 767px) {
    .main-content {
        margin-left: 0;
    }
    #floating-selector {
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        position: fixed;
        bottom: 72px;
    }
    #floating-templates {
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        position: fixed;
        bottom: 72px;
    }
    #floating-parameters {
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        position: fixed;
        bottom: 72px;
    }
    #floating-variables {
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        position: fixed;
        bottom: 72px;
    }
}
/* Ensure floating selector stays within chat container bounds */
#chat-container {
    position: relative;
    scroll-behavior: auto;
    overscroll-behavior-y: contain;
    overflow-anchor: none;
}

/* Styles for the new selection interface */
#selection-container {
    transition: opacity 0.3s ease;
}

#selection-content {
    max-width: 600px;
    margin: 0 auto;
}

/* Templates UI refresh */
.templates-page {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.templates-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.5rem;
    border-radius: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(28, 33, 40, 0.85);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
    animation: template-fade-up 0.5s ease both;
}

.templates-hero-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 180px;
}

.templates-hint {
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.28);
    animation: template-fade-up 0.5s ease both;
    animation-delay: 0.03s;
}

.templates-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.25rem 1.5rem;
    border-radius: 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(17, 22, 29, 0.9);
    box-shadow: 0 12px 22px rgba(0, 0, 0, 0.25);
    animation: template-fade-up 0.5s ease both;
    animation-delay: 0.08s;
}

.templates-toolbar-actions {
    display: flex;
    align-items: end;
    gap: 0.75rem;
}

.templates-toolbar-title {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 180px;
}

.templates-toolbar-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 1fr)) auto;
    gap: 0.75rem;
    align-items: end;
    width: 100%;
}

.templates-filter {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.templates-filter-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9CA3AF;
}

.templates-apply {
    align-self: end;
}

.templates-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 0.9rem;
    border-radius: 9999px;
    font-weight: 600;
}

.templates-toggle.is-open {
    border-color: rgba(0, 229, 153, 0.4);
    background: rgba(0, 229, 153, 0.12);
    color: #7bf0c4;
}

.templates-filters-panel {
    padding: 1.25rem 1.5rem;
    border-radius: 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(17, 22, 29, 0.85);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
    animation: template-fade-up 0.4s ease both;
}

.templates-filters-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.75rem;
}

.templates-input,
.templates-textarea {
    background: rgba(0, 0, 0, 0.35);
    border-color: rgba(255, 255, 255, 0.12);
    color: #E5E7EB;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.templates-input:focus,
.templates-textarea:focus {
    border-color: rgba(0, 229, 153, 0.5);
    box-shadow: 0 0 0 2px rgba(0, 229, 153, 0.2);
}

.templates-input-sm {
    font-size: 0.75rem;
}

.templates-btn-primary {
    background: linear-gradient(135deg, rgba(0, 229, 153, 0.9), rgba(0, 185, 255, 0.8));
    border: 1px solid rgba(0, 229, 153, 0.4);
    color: #081014;
    border-radius: 0.9rem;
    padding: 0.65rem 1.25rem;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    box-shadow: 0 12px 25px rgba(0, 229, 153, 0.22);
}

.templates-btn-primary.text-white {
    color: #FFFFFF;
}

.templates-btn-primary:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: 0 18px 32px rgba(0, 229, 153, 0.3);
}

.templates-btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #E5E7EB;
    border-radius: 0.9rem;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.templates-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(0, 229, 153, 0.4);
}

.templates-btn-link {
    color: #7dd3fc;
}

.templates-btn-link:hover {
    color: #a5f3fc;
}

.templates-list {
    border-radius: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(28, 33, 40, 0.85);
    overflow: hidden;
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.3);
    animation: template-fade-up 0.5s ease both;
    animation-delay: 0.12s;
}

.templates-grid .template-card {
    height: 100%;
}

.templates-empty {
    text-align: center;
    padding: 3rem 1.5rem;
}

.templates-empty-icon {
    display: inline-flex;
    width: 4rem;
    height: 4rem;
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.06);
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.template-card {
    border-radius: 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(20, 24, 32, 0.9);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    animation: template-fade-up 0.5s ease both;
}

.templates-grid .template-card:nth-child(1) { animation-delay: 0.05s; }
.templates-grid .template-card:nth-child(2) { animation-delay: 0.1s; }
.templates-grid .template-card:nth-child(3) { animation-delay: 0.15s; }
.templates-grid .template-card:nth-child(4) { animation-delay: 0.2s; }
.templates-grid .template-card:nth-child(5) { animation-delay: 0.25s; }
.templates-grid .template-card:nth-child(6) { animation-delay: 0.3s; }

.template-card:hover {
    transform: translateY(-3px);
    border-color: rgba(0, 229, 153, 0.3);
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.35);
    background: rgba(24, 28, 38, 0.95);
}

.template-action {
    color: #9CA3AF;
    border-radius: 9999px;
    padding: 0.25rem;
    transition: color 0.2s ease, background 0.2s ease;
}

.template-action:hover {
    color: #F9FAFB;
    background: rgba(255, 255, 255, 0.08);
}

.template-use-btn {
    color: #7dd3fc;
}

.template-use-btn:hover {
    color: #bae6fd;
}

.template-action-danger {
    color: #f87171;
}

.template-action-danger:hover {
    color: #fecaca;
    background: rgba(248, 113, 113, 0.12);
}

.template-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #E5E7EB;
}

.template-badge-muted {
    color: #9CA3AF;
    border-color: rgba(255, 255, 255, 0.08);
}

.template-badge-public {
    background: rgba(0, 229, 153, 0.16);
    color: #6ee7b7;
    border-color: rgba(0, 229, 153, 0.3);
}

.template-badge-system {
    background: rgba(56, 189, 248, 0.16);
    color: #7dd3fc;
    border-color: rgba(56, 189, 248, 0.3);
}

.template-badge-params {
    background: rgba(34, 197, 94, 0.16);
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.3);
}

.template-badge-workflow {
    background: rgba(168, 85, 247, 0.16);
    color: #d8b4fe;
    border-color: rgba(168, 85, 247, 0.3);
}

.template-badge-preset {
    background: rgba(234, 179, 8, 0.16);
    color: #fde047;
    border-color: rgba(234, 179, 8, 0.3);
}

.template-badge-chat {
    background: rgba(14, 165, 233, 0.16);
    color: #7dd3fc;
    border-color: rgba(14, 165, 233, 0.3);
}

.template-badge-image {
    background: rgba(99, 102, 241, 0.16);
    color: #c7d2fe;
    border-color: rgba(99, 102, 241, 0.3);
}

.template-badge-video {
    background: rgba(244, 63, 94, 0.16);
    color: #fecdd3;
    border-color: rgba(244, 63, 94, 0.3);
}

.template-badge-audio {
    background: rgba(16, 185, 129, 0.16);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.3);
}

.template-edit-card {
    padding: 2rem;
    border-radius: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(20, 24, 32, 0.92);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
    animation: template-fade-up 0.6s ease both;
}

.template-section + .template-section {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 1.5rem;
}

.template-panel {
    background: rgba(6, 10, 16, 0.7);
}

.template-parameter-card {
    background: rgba(0, 0, 0, 0.25);
}

.template-back {
    color: #7dd3fc;
    margin-bottom: 1rem;
}

.template-back:hover {
    color: #bae6fd;
}

.templates-panel .templates-panel-header {
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.templates-panel-list {
    padding: 0.25rem;
}

.templates-panel-option {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.templates-panel-option:hover {
    border-color: rgba(0, 229, 153, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 12px 22px rgba(0, 0, 0, 0.35);
}

.templates-panel-empty {
    border-radius: 0.85rem;
    background: rgba(0, 0, 0, 0.25);
}

.templates-panel-body {
    animation: template-fade-in 0.3s ease both;
}

.template-error-page {
    display: flex;
    justify-content: center;
}

.template-error-card {
    width: 100%;
    max-width: 640px;
    padding: 2rem;
    border-radius: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(160deg, rgba(28, 33, 40, 0.92), rgba(14, 18, 24, 0.95));
    box-shadow: 0 18px 32px rgba(0, 0, 0, 0.35);
    animation: template-fade-up 0.5s ease both;
}

.template-error-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.template-error-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.2);
}

@keyframes template-fade-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes template-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .templates-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .templates-hero-actions {
        width: 100%;
    }

    .templates-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .templates-toolbar-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .templates-toolbar-filters {
        grid-template-columns: 1fr;
    }
}

.mode-option {
    transition: all 0.2s ease;
}

.mode-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.model-option {
    transition: all 0.2s ease;
}

.model-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.model-option.active {
    box-shadow: 0 0 0 2px #00E599;
}

/* New model list style for better display */
#floating-model-options .model-option {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    padding: 0.75rem 1rem;
    min-height: auto;
    width: 100%;
    text-align: left;
}

#floating-model-options .model-option i {
    margin-right: 0.75rem;
    margin-bottom: 0;
}

#floating-model-options .model-option .flex-1 {
    flex: 1;
}

#floating-model-options .model-option .text-sm {
    font-size: 0.875rem;
}

#floating-model-options .model-new-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.4rem;
    padding: 0 0.4rem;
    height: 1rem;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 999px;
    background: rgba(255, 186, 0, 0.18);
    border: 1px solid rgba(255, 186, 0, 0.45);
    color: #ffcc4d;
}

#floating-model-options .model-option .text-xs {
    font-size: 0.75rem;
}

#floating-model-options .model-option .text-brain-green {
    font-weight: 600;
}

/* Space between model options */
#floating-model-options .space-y-2 > * + * {
    margin-top: 0.5rem;
}

/* Accordion styles for sidebar navigation */
.accordion-item {
    margin-bottom: 0.125rem;
}

.accordion-header {
    cursor: pointer;
    user-select: none;
    border: none;
    background: transparent;
    text-align: left;
    width: 100%;
    padding: 0.625rem 0.75rem; /* py-2.5 px-3 */
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.accordion-header:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.accordion-header.active {
    color: white;
    background-color: rgba(255, 255, 255, 0.08);
}

.accordion-header.active .accordion-chevron {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.accordion-content.expanded {
    max-height: 500px; /* Sufficient height for sub-items */
}

.accordion-content .nav-link {
    padding-left: 2rem;
    font-size: 0.875rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

/* Chat message UI refresh */
.message-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    width: 100%;
}

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

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

.ai-avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, #00E599, #00F0FF 55%, #FF00AA);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: #0B0F14;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
    flex-shrink: 0;
    margin-top: 2px;
}

.message-bubble {
    max-width: min(780px, 86vw);
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(22, 27, 34, 0.8);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px);
}

.message-bubble.user-bubble {
    background: rgba(33, 38, 45, 0.9);
    border-radius: 18px 6px 18px 18px;
}

.message-bubble.ai-bubble {
    background: rgba(15, 20, 28, 0.9);
    border-radius: 6px 18px 18px 18px;
}

.message-error .message-bubble.ai-bubble {
    background: rgba(59, 10, 16, 0.55);
    border-color: rgba(248, 113, 113, 0.28);
}

.msg-text,
.msg-content {
    font-size: 15px;
    line-height: 1.35;
    color: #E6EDF3;
}

.msg-content :is(h1, h2, h3) {
    color: #fff;
}

.msg-content h1 {
    font-size: 20px;
    line-height: 1.3;
    margin: 10px 0 6px;
}

.msg-content h2 {
    font-size: 17px;
    line-height: 1.35;
    margin: 10px 0 6px;
}

.msg-content h3 {
    font-size: 15px;
    line-height: 1.4;
    margin: 8px 0 6px;
}

.msg-content :where(p, ul, ol, blockquote, pre) {
    margin-top: 4px !important;
    margin-bottom: 4px !important;
}

.msg-content p {
    line-height: 1.6;
}

.msg-content ul,
.msg-content ol {
    list-style-position: outside;
    padding-left: 1.6rem;
    margin-left: 0 !important;
}

.msg-content ul {
    list-style-type: disc;
}

.msg-content ol {
    list-style-type: decimal;
}

.msg-content li {
    display: list-item;
}

.msg-content li {
    margin: 2px 0;
}

.msg-content ul li::marker {
    color: rgba(230, 237, 243, 0.9);
}

.msg-content ol li::marker {
    color: rgba(230, 237, 243, 0.9);
}

.msg-content :is(ul ul, ul ol, ol ul, ol ol) {
    margin-top: 6px;
    padding-left: 1.25rem;
    border-left: 1px dashed rgba(255, 255, 255, 0.16);
}

.msg-content blockquote {
    border-left: 3px solid rgba(255, 255, 255, 0.2);
    padding-left: 10px;
    color: rgba(230, 237, 243, 0.75);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.msg-content pre {
    background: rgba(10, 12, 16, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 8px 10px;
    overflow-x: auto;
    position: relative;
}

.msg-content code {
    background: rgba(255, 255, 255, 0.08);
    padding: 1px 6px;
    border-radius: 6px;
    color: #E6EDF3;
}

.msg-content pre code {
    background: none;
    padding: 0;
}

.msg-content .code-copy-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(15, 20, 28, 0.8);
    color: #E6EDF3;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.msg-content .code-copy-btn:hover {
    border-color: rgba(0, 229, 153, 0.6);
    color: #00E599;
}

.msg-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 13px;
}

.msg-content th,
.msg-content td {
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 6px 8px;
    text-align: left;
}

.msg-content th {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-weight: 600;
}

.msg-content tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.03);
}

.error-card {
    border: none;
    background: transparent;
    border-radius: 0;
    padding: 6px 0 2px;
    color: #F5F7FA;
    box-shadow: none;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.error-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 13px;
}

.error-message {
    margin-top: 4px;
    font-size: 12px;
    color: rgba(230, 237, 243, 0.75);
    line-height: 1.45;
    white-space: pre-line;
}

.error-actions {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
}

.error-request {
    font-size: 11px;
    color: rgba(230, 237, 243, 0.5);
    padding: 3px 6px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.error-actions-row {
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.error-btn {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 7px;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(230, 237, 243, 0.85);
}

.error-btn-primary {
    background: rgba(248, 113, 113, 0.25);
    color: #FEE2E2;
    border-color: transparent;
}

.error-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.16);
}
.msg-meta {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    color: rgba(230, 237, 243, 0.6);
}

.message-user .msg-meta {
    justify-content: space-between;
}

.msg-meta .meta-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.msg-time {
    font-variant-numeric: tabular-nums;
}

.model-info,
.token-info {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.msg-actions {
    display: inline-flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.share-views-badge {
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(226, 232, 240, 0.85);
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

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

.message-wrapper.has-media .msg-actions {
    opacity: 1;
}

.msg-action-btn {
    padding: 4px;
    border-radius: 8px;
    border: 1px solid transparent;
    color: rgba(230, 237, 243, 0.8);
    background: rgba(255, 255, 255, 0.05);
    position: relative;
}

.msg-action-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.12);
}

.msg-action-btn.share-ai-btn {
    background: rgba(0, 240, 255, 0.12);
    border-color: rgba(0, 240, 255, 0.35);
    color: #b8f7ff;
}

.message-wrapper.has-shares .msg-action-btn.share-ai-btn::after {
    content: '';
    position: absolute;
    top: -3px;
    right: -3px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #00E599;
    box-shadow: 0 0 0 2px rgba(12, 14, 18, 0.9);
}

.msg-action-btn.copied::after {
    content: 'Скопировано';
    position: absolute;
    top: -26px;
    right: 0;
    background: rgba(10, 12, 16, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #E6EDF3;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 6px;
    white-space: nowrap;
}

.token-info {
    position: relative;
    cursor: pointer;
}

.token-tooltip {
    position: absolute;
    left: 0;
    bottom: calc(100% + 8px);
    min-width: 220px;
    background: rgba(10, 12, 16, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 0 12px;
    color: #E6EDF3;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
    transition: all 0.2s ease;
    z-index: 20;
    max-height: 0;
    overflow: hidden;
}

.token-tooltip::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 16px;
    width: 10px;
    height: 10px;
    background: rgba(10, 12, 16, 0.95);
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    transform: rotate(45deg);
}

.token-info.is-open .token-tooltip {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    max-height: 240px;
    padding: 10px 12px;
}

.token-tooltip .tooltip-title {
    font-weight: 600;
    margin-bottom: 6px;
    color: #fff;
}

.token-tooltip .tooltip-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    color: rgba(230, 237, 243, 0.7);
}

.msg-attachments.media-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    gap: 10px;
    margin-bottom: 12px;
}

.msg-attachments.media-grid.single {
    overflow-x: hidden;
}

.msg-attachments.media-grid .media-card {
    flex: 0 0 220px;
    scroll-snap-align: start;
}

.msg-attachments.media-grid.single .media-card {
    flex: 1 1 100%;
}

.media-card {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(10, 12, 16, 0.6);
    min-height: 140px;
}

.media-card.media-image {
    aspect-ratio: 4 / 3;
}

.media-card.media-image img {
    height: 100%;
}

.msg-attachments.media-grid.single .media-card.media-image {
    aspect-ratio: auto;
}

.msg-attachments.media-grid.single .media-card.media-image img {
    width: 100%;
    height: auto;
    max-height: min(70vh, 720px);
    object-fit: contain;
    background: #0b0e13;
}

/* Keep AI single-image previews consistent with multi-image cards to avoid layout jumps. */
.message-wrapper.message-ai .msg-attachments.media-grid.single .media-card.media-image {
    aspect-ratio: 4 / 3;
}

.message-wrapper.message-ai .msg-attachments.media-grid.single .media-card.media-image img {
    width: 100%;
    height: 100%;
    max-height: 240px;
    object-fit: cover;
    background: transparent;
}

.message-wrapper.message-user .msg-attachments.media-grid.single .media-card.media-image {
    aspect-ratio: auto;
    max-height: 320px;
    background: #0b0e13;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-wrapper.message-user .msg-attachments.media-grid.single .media-card.media-image img {
    width: 100%;
    height: auto;
    max-height: 320px;
    object-fit: contain;
    background: #0b0e13;
}

.media-card img,
.media-card video {
    width: 100%;
    height: auto;
    max-height: 240px;
    object-fit: cover;
    display: block;
}

.media-card.media-video video {
    background: #000;
    min-height: 160px;
}

.media-video-thumb {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 160px;
    background: #0b0e13;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.media-video-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.media-video-play {
    position: absolute;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.media-actions {
    position: absolute;
    right: 10px;
    bottom: 10px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.media-card:hover .media-actions {
    opacity: 1;
}

.media-btn {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
}

.media-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.media-audio,
.media-file {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
}

.media-audio-icon,
.media-file-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(189, 0, 255, 0.15);
    color: #D58BFF;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.media-file-name {
    flex: 1;
    font-size: 13px;
    color: rgba(230, 237, 243, 0.9);
    word-break: break-all;
}

.media-audio-player {
    flex: 1;
    height: 32px;
}

.media-lightbox {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-lightbox.hidden {
    display: none;
}

.media-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 10, 14, 0.85);
    backdrop-filter: blur(6px);
}

.media-lightbox-content {
    position: relative;
    z-index: 2;
    max-width: min(1100px, 92vw);
    max-height: 88vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.media-lightbox-stage {
    flex: 1;
    min-height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 12, 16, 0.9);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.media-lightbox-stage img,
.media-lightbox-stage video {
    max-width: 100%;
    max-height: 70vh;
}

.media-lightbox-swipe-hint {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #E6EDF3;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    display: none;
}

.media-lightbox-swipe-hint.left {
    left: 16px;
}

.media-lightbox-swipe-hint.right {
    right: 16px;
}

.media-lightbox-content:hover .media-lightbox-swipe-hint {
    opacity: 0.95;
}

@keyframes swipeHintPulse {
    0% {
        opacity: 0.25;
        transform: translateY(-50%) scale(0.96);
    }
    60% {
        opacity: 0.7;
        transform: translateY(-50%) scale(1);
    }
    100% {
        opacity: 0.35;
        transform: translateY(-50%) scale(0.98);
    }
}

.media-lightbox-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #E6EDF3;
}

.media-lightbox-toolbar button {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 6px 10px;
    border-radius: 10px;
    color: #E6EDF3;
}

.media-lightbox-index {
    font-size: 12px;
    color: rgba(230, 237, 243, 0.7);
}

.media-lightbox-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.media-lightbox-thumb {
    border: 1px solid transparent;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
    padding: 4px 6px;
    color: #E6EDF3;
    font-size: 12px;
}

.media-lightbox-thumb img {
    width: 64px;
    height: 48px;
    object-fit: cover;
    display: block;
    border-radius: 8px;
}

.media-lightbox-thumb.active {
    border-color: rgba(0, 229, 153, 0.6);
}

.media-lightbox-close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    background: rgba(10, 12, 16, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    padding: 10px;
    color: #E6EDF3;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

@media (max-width: 640px) {
    #chat-container {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    #messages-area {
        max-width: 100%;
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .message-user .msg-meta {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    .message-user .msg-actions {
        opacity: 1;
    }

    .ai-avatar {
        width: 28px;
        height: 28px;
        font-size: 9px;
        border-radius: 8px;
    }

    .message-bubble {
        max-width: 100%;
        padding: 12px 12px;
    }

    .message-wrapper.message-user .message-bubble {
        width: 100%;
    }

    .message-wrapper.message-ai .message-bubble {
        width: 100%;
    }

    .message-wrapper.message-ai {
        position: relative;
        gap: 0;
        padding-top: 18px;
    }

    .message-wrapper.message-ai .ai-avatar {
        position: absolute;
        top: 0;
        left: 12px;
        transform: translateY(-50%);
        z-index: 2;
    }

    .msg-content ul,
    .msg-content ol {
        padding-left: 1.75rem;
        margin-left: 0 !important;
    }

    .msg-content :is(ul ul, ul ol, ol ul, ol ol) {
        padding-left: 1.35rem;
    }

    .msg-meta {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        flex-wrap: nowrap;
    }

    .msg-meta .meta-left {
        min-width: 0;
        flex: 1 1 auto;
        gap: 8px;
    }

    .msg-meta .msg-actions {
        flex: 0 0 auto;
        justify-content: flex-end;
    }

    .msg-actions {
        opacity: 1;
    }

    .model-info,
    .token-info {
        padding: 2px 6px;
        font-size: 11px;
    }

    .msg-attachments.media-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: visible;
        scroll-snap-type: none;
    }

    .msg-attachments.media-grid.single {
        grid-template-columns: 1fr;
    }

    .msg-attachments.media-grid .media-card {
        flex: initial;
    }

    .media-card img,
    .media-card video {
        max-height: 200px;
    }

    .msg-attachments.media-grid.single .media-card.media-image img {
        max-height: 55vh;
    }

    .message-wrapper.message-ai .msg-attachments.media-grid.single .media-card.media-image img {
        max-height: 200px;
        object-fit: cover;
    }

    .message-wrapper.message-user .msg-attachments.media-grid.single .media-card.media-image img {
        max-height: 200px;
        object-fit: contain;
    }

    .media-lightbox-swipe-hint {
        width: 36px;
        height: 36px;
        opacity: 0.6;
        display: flex;
        animation: swipeHintPulse 1.8s ease-in-out infinite;
    }

    .token-info.has-tooltip .token-tooltip {
        position: absolute;
        left: 0;
        bottom: calc(100% + 6px);
        opacity: 0;
        pointer-events: none;
        transform: translateY(6px);
        width: max-content;
        max-width: min(260px, 80vw);
        padding: 0 8px;
        border-radius: 10px;
        max-height: 0;
    }

    .token-tooltip::before {
        display: none;
    }

    .token-info.is-open .token-tooltip {
        opacity: 1;
        pointer-events: auto;
        max-height: 220px;
        padding: 6px 8px;
    }

    .token-tooltip .tooltip-title {
        display: none;
    }

    .token-tooltip .tooltip-row {
        font-size: 11px;
    }

    .media-lightbox-toolbar {
        flex-wrap: wrap;
    }

    .error-card {
        padding: 12px;
        max-width: 100%;
    }

    .error-actions-row {
        flex-direction: column;
        align-items: stretch;
    }
}

.scroll-to-bottom {
    position: fixed;
    right: 24px;
    bottom: 96px;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(15, 20, 28, 0.85);
    color: #E6EDF3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
    z-index: 60;
}

.scroll-to-bottom.hidden {
    display: none;
}

.history-loading-indicator {
    position: sticky;
    top: 6px;
    margin: 0 auto 10px;
    width: fit-content;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(15, 20, 28, 0.88);
    color: #c7d2e0;
    font-size: 11px;
    line-height: 1;
    pointer-events: none;
    backdrop-filter: blur(4px);
}

.history-loading-indicator.hidden {
    display: none;
}

.history-loading-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #00E599;
    box-shadow: 0 0 0 0 rgba(0, 229, 153, 0.55);
    animation: historyLoadingPulse 1s ease-in-out infinite;
}

@keyframes historyLoadingPulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(0, 229, 153, 0.45);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 8px rgba(0, 229, 153, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(0, 229, 153, 0);
    }
}

@media (max-width: 640px) {
    .scroll-to-bottom {
        right: 16px;
        bottom: 88px;
        width: 34px;
        height: 34px;
    }
}

.accordion-content .nav-link:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.03);
}

/* Active state for accordion items */
.accordion-item.active .accordion-header {
    color: white;
}

.accordion-item.active .accordion-header i:first-child {
    opacity: 1;
}

/* Mobile responsiveness */
@media (max-width: 767px) {
    .accordion-header {
        padding: 0.75rem 0.875rem; /* Slightly larger for touch */
    }
    
    .accordion-content .nav-link {
        padding-left: 1.75rem;
        padding-top: 0.625rem;
        padding-bottom: 0.625rem;
    }
    
    .accordion-chevron {
        width: 1rem;
        height: 1rem;
    }
}

/* Welcome page recent chats styling */
#recent-chats-list a {
    text-decoration: none;
    color: inherit;
}

#recent-chats-list .bg-brain-surface\/30 {
    backdrop-filter: blur(10px);
}

#recent-chats-list .group:hover .text-white {
    color: #00E599;
}

/* Big Start Chat button styling */
#start-chat-btn {
    background: linear-gradient(135deg, #00E599 0%, #00F0FF 50%, #BD00FF 100%);
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite;
    border: none;
    position: relative;
    overflow: hidden;
}

#start-chat-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.7s;
}

#start-chat-btn:hover::before {
    left: 100%;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Welcome screen adjustments for new layout */
#welcome-screen {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

/* Ensure welcome screen content is properly centered */
#welcome-screen > div:first-child {
    margin-top: 0;
}

/* Mobile responsiveness for welcome screen */
@media (max-width: 767px) {
    #welcome-screen {
        padding: 1rem;
        margin-top: 0;
    }
    
    #recent-chats-list {
        max-height: 300px;
        overflow-y: auto;
    }
    
    #start-chat-btn {
        padding: 1rem;
        font-size: 1rem;
    }
}

/* ===== IMPROVED SIDEBAR CHAT LIST STYLES ===== */

/* Model name styling for second line layout */
.model-name-line {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    line-height: 1.2;
    margin-top: 0.125rem;
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.2s ease;
}

.chat-last-used {
    font-size: 0.7rem;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 0.125rem;
    transition: color 0.2s ease;
}

#chat-history-list button:hover .model-name-line {
    color: rgba(255, 255, 255, 0.8);
}

#chat-history-list button:hover .chat-last-used {
    color: rgba(255, 255, 255, 0.7);
}

#chat-history-list button.bg-white\/5 .model-name-line {
    color: rgba(255, 255, 255, 0.8);
}

#chat-history-list button.bg-white\/5 .chat-last-used {
    color: rgba(255, 255, 255, 0.7);
}

.model-name-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.14rem 0.45rem;
    border-radius: 0.35rem;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    transition: all 0.2s ease;
}

.model-name-badge .badge-icon {
    width: 0.7rem;
    height: 0.7rem;
    opacity: 0.85;
}

/* Model badge colors based on generation type */
.model-name-badge.chat {
    background-color: rgba(0, 229, 153, 0.15);
    color: #00E599;
}

.model-name-badge.image {
    background-color: rgba(255, 0, 170, 0.15);
    color: #FF00AA;
}

.model-name-badge.video {
    background-color: rgba(0, 240, 255, 0.15);
    color: #00F0FF;
}

.model-name-badge.audio {
    background-color: rgba(189, 0, 255, 0.15);
    color: #BD00FF;
}

/* Model name text without badge */
.model-name-text {
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.model-name-text.chat { color: #00E599; }
.model-name-text.image { color: #FF00AA; }
.model-name-text.video { color: #00F0FF; }
.model-name-text.audio { color: #BD00FF; }

/* Chat tabs */
.chat-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 4px;
    margin: 0 0 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-tab {
    flex: 1;
    text-align: center;
    padding: 6px 10px 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(226, 232, 240, 0.6);
    border-radius: 999px;
    transition: all 0.2s ease;
    transform: translateY(0);
    position: relative;
}

.chat-tab.active {
    background: rgba(0, 229, 153, 0.1);
    color: #E6EDF3;
    box-shadow: inset 0 0 0 1px rgba(0, 229, 153, 0.25);
    transform: translateY(-1px);
}

.chat-tab.active::after {
    content: "";
    position: absolute;
    left: 22%;
    right: 22%;
    bottom: 4px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(0, 229, 153, 0.2), rgba(0, 229, 153, 0.8), rgba(0, 229, 153, 0.2));
}

.chat-list-panel {
    display: block;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    pointer-events: none;
    padding-top: 4px;
}

#chat-history-list,
#chat-archive-list {
    margin-left: -16px;
    margin-right: -16px;
    width: calc(100% + 32px);
}

.chat-list-panel.is-active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.chat-list-panel.is-exiting {
    opacity: 0;
    transform: translateY(4px);
}

/* Laconic chat list styling */
#chat-history-list button,
#chat-archive-list button {
    transition: background-color 0.2s ease, border-color 0.2s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
    padding: 7px 16px;
    border-radius: 0;
}

#chat-history-list button:hover,
#chat-archive-list button:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

#chat-history-list button::before,
#chat-archive-list button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: transparent;
    transition: background-color 0.2s ease;
}

#chat-history-list button:hover::before,
#chat-archive-list button:hover::before {
    background: rgba(255, 255, 255, 0.1);
}

/* Active chat styling */
#chat-history-list button.bg-white\/5,
#chat-archive-list button.bg-white\/5 {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

#chat-history-list button.bg-white\/5::before,
#chat-archive-list button.bg-white\/5::before {
    background: linear-gradient(to bottom, #00E599, #00F0FF);
}

/* Chat content container */
.chat-item-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    width: 100%;
}

.chat-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
}

.chat-title {
    flex: 1;
    min-width: 0;
    font-weight: 500;
    font-size: 0.82rem;
    line-height: 1.25;
}

.chat-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
}

.chat-model-info {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex: 1;
    min-width: 0;
}

.chat-model-name {
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Compact layout for chat items */
.chat-item-compact {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    width: 100%;
}

.chat-item-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.chat-unread-badge {
    align-self: flex-start;
    margin-top: 0.2rem;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #00E599;
    box-shadow: 0 0 0 2px rgba(0, 229, 153, 0.15);
}

#chat-history-list button.has-unread::before,
#chat-archive-list button.has-unread::before {
    background: linear-gradient(to bottom, rgba(0, 229, 153, 0.9), rgba(0, 240, 255, 0.7));
}

/* Chat header title + actions */
.chat-header-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1 1 0;
    min-width: 220px;
    position: relative;
}

.chat-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1 1 auto;
}

.chat-title-label {
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(226, 232, 240, 0.45);
    display: none;
}

.chat-title-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-title-display {
    max-width: clamp(180px, 28vw, 360px);
    min-width: 120px;
    font-size: 12px;
    font-weight: 600;
    color: #E6EDF3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chat-title-input {
    width: clamp(180px, 28vw, 360px);
    max-width: 36vw;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 5px 8px;
    font-size: 12px;
    color: #E6EDF3;
    text-align: left;
}

.chat-title-btn {
    width: 22px;
    height: 22px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(226, 232, 240, 0.8);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.chat-title-inline-icon {
    width: 12px;
    height: 12px;
    opacity: 0.6;
}

.chat-title-btn:hover {
    border-color: rgba(0, 229, 153, 0.3);
    color: #E6EDF3;
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.chat-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
    font-size: 11px;
    color: rgba(226, 232, 240, 0.8);
    transition: all 0.2s ease;
    min-width: 28px;
}

.chat-actions-menu-btn {
    display: none;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(226, 232, 240, 0.8);
    align-items: center;
    justify-content: center;
}

.chat-actions-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 6px;
    background: rgba(18, 22, 28, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 6px;
    min-width: 180px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    z-index: 60;
}

.chat-action-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 90;
}

.chat-action-confirm {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(18, 22, 28, 0.96);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
    max-width: min(520px, 90vw);
    width: 100%;
}

.chat-action-confirm-text {
    font-size: 14px;
    font-weight: 600;
    color: rgba(226, 232, 240, 0.9);
}

.chat-action-confirm-subtext {
    font-size: 12px;
    color: rgba(226, 232, 240, 0.6);
}

.chat-action-confirm-buttons {
    display: inline-flex;
    gap: 10px;
    margin-left: auto;
    align-self: flex-end;
}

.chat-action-confirm-btn {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    font-size: 12px;
    color: #E6EDF3;
    transition: all 0.2s ease;
}

.chat-action-confirm-btn.confirm {
    background: rgba(0, 229, 153, 0.15);
    border-color: rgba(0, 229, 153, 0.4);
}

.chat-action-confirm.danger .chat-action-confirm-btn.confirm {
    background: rgba(248, 113, 113, 0.2);
    border-color: rgba(248, 113, 113, 0.5);
    color: #fca5a5;
}

.share-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 92;
}

.share-dialog {
    width: min(560px, 92vw);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(18, 22, 28, 0.96);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.share-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.share-dialog-title {
    font-size: 15px;
    font-weight: 600;
    color: #E6EDF3;
}

.share-dialog-subtitle {
    font-size: 12px;
    color: rgba(226, 232, 240, 0.6);
    margin-top: 4px;
}

.share-dialog-close {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(226, 232, 240, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-dialog-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.share-section-title {
    font-size: 12px;
    font-weight: 600;
    color: rgba(226, 232, 240, 0.8);
}

.share-option {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: rgba(226, 232, 240, 0.85);
}

.share-option input {
    accent-color: #00E599;
}

.share-primary-btn {
    width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(0, 229, 153, 0.5);
    background: rgba(0, 229, 153, 0.18);
    color: #E6EDF3;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.share-primary-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.share-status {
    font-size: 12px;
    color: rgba(226, 232, 240, 0.6);
}

.share-status.is-error {
    color: #fca5a5;
}

.share-status.is-success {
    color: #86efac;
}

.share-link-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.share-links-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.share-link-item {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.25);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.share-link-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: rgba(226, 232, 240, 0.7);
}

.share-link-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.share-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(226, 232, 240, 0.9);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.share-icon-btn.danger {
    border-color: rgba(248, 113, 113, 0.4);
    color: #fca5a5;
}

.share-link-row input {
    flex: 1 1 220px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.35);
    color: #E6EDF3;
    font-size: 12px;
}

.share-secondary-btn {
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(226, 232, 240, 0.9);
    font-size: 12px;
    font-weight: 600;
}

.chat-actions-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    font-size: 12px;
    color: rgba(226, 232, 240, 0.85);
    border-radius: 8px;
}

.chat-actions-menu-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.chat-actions-menu-item.danger {
    color: rgba(248, 113, 113, 0.95);
}

.chat-action-btn:hover {
    border-color: rgba(0, 229, 153, 0.3);
    color: #E6EDF3;
}

.chat-action-btn.danger {
    border-color: rgba(248, 113, 113, 0.3);
    color: rgba(248, 113, 113, 0.9);
}

.chat-action-btn.danger:hover {
    background: rgba(248, 113, 113, 0.08);
    border-color: rgba(248, 113, 113, 0.5);
}

.chat-action-btn:disabled,
.chat-title-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


@media (max-width: 768px) {
    .chat-header-row {
        justify-content: flex-start;
        gap: 6px;
    }

    .chat-title-display,
    .chat-title-input {
        max-width: 100%;
        width: auto;
    }
}

@media (max-width: 640px) {
    .chat-header-row {
        width: 100%;
        justify-content: flex-start;
    }

    .chat-title-label {
        display: none;
    }

    .chat-title-display,
    .chat-title-input {
        max-width: 100%;
        width: auto;
    }

    .chat-header-actions {
        gap: 4px;
    }

    .chat-action-btn span {
        display: none;
    }
}


@media (max-width: 768px) {
    .chat-header-actions {
        display: none;
    }
    .chat-actions-menu-btn {
        display: inline-flex;
    }
}

@media (max-width: 640px) {
    header {
        gap: 8px;
    }

    header .header-left {
        order: 1;
    }

    header .header-right {
        order: 2;
        margin-left: auto;
        gap: 8px;
    }

    header .chat-header-row {
        order: 3;
        flex-basis: 100%;
    }
}

@media (max-width: 1024px) {
    header .chat-header-row {
        order: 3;
        flex-basis: 100%;
    }
    header .header-right {
        order: 2;
    }
    header .header-left {
        order: 1;
    }
}

header .header-right {
    margin-left: auto;
}

.lang-switcher {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(22, 27, 34, 0.7);
    border: 1px solid #30363D;
    border-radius: 9999px;
    padding: 4px;
    min-height: 36px;
    min-width: 0;
}

.lang-switcher-loading {
    font-size: 12px;
    color: #6B7280;
    padding: 0 8px;
}

.lang-switcher-current {
    min-width: 44px;
    height: 32px;
    border-radius: 9999px;
    border: 1px solid transparent;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 6px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.lang-switcher-current:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
}

.lang-switcher-current:active {
    transform: scale(0.96);
}

.lang-switcher-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: #1C2128;
    border: 1px solid #30363D;
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
    z-index: 60;
}

.lang-switcher-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: transparent;
    border: 1px solid transparent;
    color: #E5E7EB;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.lang-switcher-option:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
}

.lang-switcher-option.is-active {
    background: rgba(0, 229, 153, 0.18);
    border-color: rgba(0, 229, 153, 0.55);
    color: #E5E7EB;
}

.lang-switcher-flag {
    font-size: 18px;
    line-height: 1;
}

.lang-switcher-chevron {
    width: 6px;
    height: 6px;
    border-right: 2px solid #9CA3AF;
    border-bottom: 2px solid #9CA3AF;
    transform: rotate(45deg);
    margin-top: -2px;
}

.lang-switcher-label {
    flex: 1;
    text-align: left;
}

.lang-switcher-welcome .lang-switcher-current {
    min-width: 48px;
    height: 36px;
    font-size: 20px;
}

@media (max-width: 640px) {
    #welcome-screen {
        margin-top: 0;
        padding-top: 16px;
        padding-bottom: 20px;
    }

    #welcome-screen h1 {
        font-size: 2.125rem;
        line-height: 1.1;
    }

    .welcome-chat-title {
        font-size: 0.85rem;
    }
}

@media (max-width: 640px) {
    body.welcome-active #chat-container {
        overflow: hidden;
    }
}

/* Animation for new chat items */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.3s ease-out;
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .chat-title {
        font-size: 0.8125rem;
    }
    
    .chat-model-name {
        font-size: 0.6875rem;
    }
    
    .model-badge {
        font-size: 0.625rem;
        padding: 0.125rem 0.25rem;
    }
}

/* Dark mode adjustments for better contrast */
@media (prefers-color-scheme: dark) {
    .model-badge {
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    }
    
    #chat-history-list button.bg-white\/5 {
        background: rgba(255, 255, 255, 0.1) !important;
    }
}

/* ===== PARAMETERS MENU STYLES ===== */

/* Parameters menu styling */
#parameters-menu {
    transform: translateY(10px);
    opacity: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

#parameters-menu:not(.hidden) {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* Parameter group styling */
.parameter-group {
    margin-bottom: 1.25rem;
}

.parameter-group:last-child {
    margin-bottom: 0;
}

/* Range input styling */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #00E599;
    cursor: pointer;
    border: 2px solid #1C2128;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #00E599;
    cursor: pointer;
    border: 2px solid #1C2128;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Number input styling */
input[type="number"] {
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Select styling */
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239CA3AF'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

select::-ms-expand {
    display: none;
}

/* Parameter description styling */
.parameter-group p {
    margin-top: 0.375rem;
    line-height: 1.4;
}

/* Parameters button styling */
#parameters-trigger {
    transition: all 0.2s ease;
}

#parameters-trigger:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

/* Notification animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.3s ease-out;
}

/* Parameters content scroll */
#parameters-content {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

#parameters-content::-webkit-scrollbar {
    width: 4px;
}

#parameters-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

/* Range value display */
#parameters-content span[id^="value-"] {
    min-width: 3rem;
    text-align: right;
}

/* Button group styling */
#parameters-menu .flex.justify-between {
    gap: 0.75rem;
}

#parameters-menu .flex.justify-between button {
    flex: 1;
}

#reset-parameters {
    border-color: rgba(255, 255, 255, 0.2);
}

#reset-parameters:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.05);
}

#save-parameters {
    background: linear-gradient(135deg, #00E599 0%, #00C58E 100%);
}

#save-parameters:hover {
    background: linear-gradient(135deg, #00C58E 0%, #00A878 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 229, 153, 0.3);
}

/* Mobile responsiveness for parameters menu */
@media (max-width: 767px) {
    #parameters-menu {
        width: calc(100vw - 2rem);
        left: 50%;
        transform: translateX(-50%) translateY(10px);
        max-width: 320px;
    }
    
    #parameters-menu:not(.hidden) {
        transform: translateX(-50%) translateY(0);
    }
    
    #parameters-content {
        max-height: 250px;
    }
}

/* Profile dropdown fade-in animation */
.animate-fade-in {
    animation: fadeIn 0.2s ease-out forwards;
}

/* Subscription gate */
.subscription-gate-panel {
    background: linear-gradient(135deg, rgba(5, 10, 15, 0.92), rgba(10, 12, 20, 0.92) 45%, rgba(4, 18, 22, 0.92));
    max-height: calc(100vh - 24px);
}

.subscription-gate-body {
    scrollbar-width: thin;
}

.subscription-gate-panel {
    background: linear-gradient(160deg, rgba(22, 27, 34, 0.96), rgba(10, 15, 22, 0.96));
}

.subscription-gate-close {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #9CA3AF;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
}

.subscription-gate-close:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.08);
}

.subscription-gate-block {
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 18px;
    padding: 16px;
}

.subscription-plan-card {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(10, 20, 25, 0.35));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 16px;
}

.plan-featured {
    position: relative;
    border-color: rgba(0, 229, 160, 0.45);
    box-shadow: 0 12px 28px rgba(0, 229, 160, 0.12);
}

.plan-badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.plan-badge {
    position: static;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(0, 229, 160, 0.16);
    color: #7CF9C6;
    font-size: 0.72rem;
    font-weight: 600;
    border: 1px solid rgba(0, 229, 160, 0.35);
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.plan-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.plan-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #FFFFFF;
}

.plan-subtitle {
    font-size: 0.75rem;
    color: #9CA3AF;
    margin-top: 4px;
}

.plan-crystals {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 1.6rem;
    font-weight: 700;
    color: #FFFFFF;
    white-space: nowrap;
}

.plan-meta {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.plan-grid {
    align-items: stretch;
}

.plan-price-pill {
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
}

.plan-price-usdt {
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.04);
    color: #D1D5DB;
}

.plan-badge-benefit {
    background: rgba(0, 240, 255, 0.16);
    color: #7FEAFF;
    border-color: rgba(0, 240, 255, 0.35);
}

.plan-badge-hot {
    background: rgba(255, 99, 71, 0.2);
    color: #FFB4A3;
    border-color: rgba(255, 99, 71, 0.4);
}

.plan-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: currentColor;
    opacity: 0.9;
}

.plan-benefit-line {
    margin-top: 6px;
    font-size: 0.8rem;
    color: #7FEAFF;
    font-weight: 600;
}

.price-chip {
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.08);
    color: #FFFFFF;
}

.price-chip-usdt {
    background: rgba(255, 255, 255, 0.04);
    color: #D1D5DB;
    font-weight: 500;
}

.payment-badge {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.payment-badge-crypto {
    color: #7CF9C6;
}

.payment-badge-card {
    color: #A5B4FC;
}

.payment-btn {
    min-height: 50px;
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.payment-btn-title {
    line-height: 1.1;
    text-align: center;
}

.payment-btn-sub {
    font-size: 0.72rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
}

.payment-btn-crypto {
    background: #00E5A0;
    color: #04140E;
}

.payment-btn-crypto:hover {
    filter: brightness(1.05);
}

.payment-btn-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #FFFFFF;
}

.payment-btn-card:hover {
    background: rgba(255, 255, 255, 0.12);
}

.plan-feature-list {
    margin-top: 12px;
    display: grid;
    gap: 6px;
    font-size: 0.78rem;
    color: #9CA3AF;
}

.plan-feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.plan-feature-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(0, 229, 160, 0.6);
    flex-shrink: 0;
}

@media (max-width: 767px) {
    .subscription-gate-panel {
        max-height: calc(100vh - 12px);
    }

    .subscription-gate-body {
        max-height: calc(100vh - 170px);
    }

    .subscription-gate-block {
        padding: 14px;
    }
}

@media (min-width: 768px) {
    body.sidebar-visible-desktop #subscription-gate,
    body.chat-page #subscription-gate {
        padding-left: 16rem;
    }

    body.sidebar-visible-desktop #subscription-gate .subscription-gate-panel,
    body.chat-page #subscription-gate .subscription-gate-panel {
        max-width: 1100px;
    }
}
