:root {
    --text-primary: #ECECF1;
    --text-secondary: #C5C5D2;
    --border-subtle: rgba(255, 255, 255, 0.1);
    --sidebar-bg: rgba(0, 0, 0, 0.7);
    --input-bg: rgba(64, 65, 79, 0.9);
    --hover-bg: rgba(255, 255, 255, 0.08);
    --msg-user-bg: #444654;
    /* Dark Gray for User */
    --input-gradient: linear-gradient(to top, rgba(0, 0, 0, 0.8) 20%, transparent);
}

[data-theme="light"] {
    --text-primary: #343541;
    --text-secondary: #666;
    --border-subtle: rgba(0, 0, 0, 0.1);
    --sidebar-bg: rgba(255, 255, 255, 0.8);
    --input-bg: rgba(255, 255, 255, 0.95);
    --hover-bg: rgba(0, 0, 0, 0.05);
    --msg-user-bg: #E5E5E5;
    /* Light Gray for User */
    --input-gradient: linear-gradient(to top, rgba(255, 255, 255, 0.9) 20%, transparent);
}


* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body,
html {
    height: 100%;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background: transparent;
    /* Allows particle canvas to show through */
    overflow: hidden;
}

/* Global Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Smooth Scrolling for Landing Page */
.landing-page {
    scroll-behavior: smooth;
}

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: #111;
    /* Fallback dark bg for canvas */
    transform: translateZ(0);
    /* Force Hardware Acceleration */
    touch-action: none;
    /* Prevent touch scrolling on canvas if needed */
}

[data-theme="light"] #bg-canvas {
    background: #f0f0f0;
}

/* CHAT PAGE */
#app-structure {
    display: flex;
    height: 100%;
    width: 100%;
}

.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-subtle);
    z-index: 50;
    flex-shrink: 0;
    transition: width 0.3s ease, transform 0.3s ease;
    overflow: hidden;
}

.sidebar.collapsed {
    width: 0;
    padding: 0;
    border: none;
}

/* Chat Header */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border-subtle);
    backdrop-filter: blur(5px);
    background: rgba(0, 0, 0, 0.2);
    height: 60px;
}

[data-theme="light"] .chat-header {
    background: rgba(255, 255, 255, 0.5);
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.icon-btn:hover {
    color: var(--text-primary);
    background: var(--hover-bg);
}

.model-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
}

[data-theme="light"] .model-badge {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.15);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    color: #000;
}

.badge-pro {
    background: #FCD34D;
    color: #333;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 700;
    margin-left: 5px;
    font-size: 10px;
}

.sidebar-top {
    padding: 10px;
}

.sidebar-middle {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.sidebar-bottom {
    padding: 10px;
    border-top: 1px solid var(--border-subtle);
}

.new-chat-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.new-chat-btn:hover {
    background: var(--hover-bg);
}

.quota-container {
    margin: 10px;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-primary);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

[data-theme="light"] .quota-container {
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(0, 0, 0, 0.1);
}

.quota-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.quota-text {
    font-weight: 600;
    font-size: 14px;
}

.quota-timer {
    font-size: 11px;
    color: var(--text-secondary);
}

.search-input {
    width: 100%;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    margin-top: 5px;
}

.search-input:focus {
    border-color: rgba(255, 255, 255, 0.3);
}

[data-theme="light"] .search-input {
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(0, 0, 0, 0.1);
}

.history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
    position: relative;
    padding-right: 30px;
    /* Space for delete btn */
}

.delete-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s;
    padding: 4px;
    border-radius: 4px;
}

.history-item:hover .delete-btn {
    opacity: 1;
}

.delete-btn:hover {
    color: #ff4444;
    background: rgba(255, 0, 0, 0.1);
}

.history-item:hover {
    background: var(--hover-bg);
}

.history-item.active {
    background: var(--hover-bg);
    font-weight: 500;
}

/* Custom Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: fadeIn 0.2s forwards;
}

.modal-content {
    background: var(--sidebar-bg);
    border: 1px solid var(--border-subtle);
    padding: 24px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    animation: scaleUp 0.2s forwards;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.modal-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}

.modal-btn.cancel {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
}

.modal-btn.cancel:hover {
    background: var(--hover-bg);
}

.modal-btn.delete {
    background: #ef4444;
    color: white;
}

.modal-btn.delete:hover {
    background: #dc2626;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

@keyframes scaleUp {
    to {
        transform: scale(1);
    }
}

.profile-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
}

.profile-card:hover {
    background: var(--hover-bg);
}

.avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #10a37f, #0d8a6a);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
}

[data-theme="light"] .avatar {
    color: black;
    border: 1px solid rgba(0, 0, 0, 0.1);
    /* Optional: add border for visibility */
}

.profile-details {
    display: flex;
    flex-direction: column;
}

.name {
    font-size: 14px;
    font-weight: 500;
}

.action {
    font-size: 11px;
    color: var(--text-secondary);
}

.main-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background: transparent;
    height: 100%;
}

.mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
}

.chat-viewport {
    flex: 1;
    overflow-y: auto;
    width: 100%;
    scroll-behavior: smooth !important;
    padding-bottom: 140px;
    display: flex;
    flex-direction: column;
}

#messages-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.welcome-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}

.logo-large img {
    width: 72px;
    height: 72px;
    margin-bottom: 20px;
    border-radius: 50%;
    box-shadow: 0 0 40px rgba(16, 163, 127, 0.4);
}

.welcome-container h2 {
    margin-bottom: 30px;
    font-size: 24px;
    font-weight: 600;
}

.suggestions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-width: 600px;
    width: 90%;
}

.suggestion-card {
    background: var(--sidebar-bg);
    border: 1px solid var(--border-subtle);
    padding: 14px;
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    transition: transform 0.2s, background 0.2s;
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    gap: 10px;
}

.suggestion-card:hover {
    background: var(--hover-bg);
    transform: translateY(-2px);
}

.suggestion-card .emoji {
    font-size: 18px;
    margin-bottom: 0;
    display: block;
}

.suggestion-card .text {
    font-size: 13px;
    color: var(--text-secondary);
}

.messages-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.message {
    display: flex;
    gap: 16px;
    padding: 2px 0;
}

.message-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    /* Circle */
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.assistant-message .message-avatar {
    background: #10a37f;
    color: white;
    border-radius: 50%;
    /* Circle */
    overflow: hidden;
    /* Clip image */
}

.assistant-message .message-avatar img {
    width: 100%;
    height: 100%;
}

.message-content {
    line-height: 1.6;
    font-size: 16px;
    flex: 1;
    overflow-wrap: break-word;
}

.message-content p {
    margin-bottom: 1em;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content ul,
.message-content ol {
    margin-bottom: 1em;
    padding-left: 1.5em;
}

.message-content li {
    margin-bottom: 0.5em;
}

.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4 {
    margin-top: 1em;
    margin-bottom: 0.5em;
    font-weight: 600;
}

.message-content h1:first-child,
.message-content h2:first-child,
.message-content h3:first-child {
    margin-top: 0;
}

.user-message {
    flex-direction: row-reverse;
    /* Align avatar to right */
    justify-content: flex-start;
    /* Start from right (due to reverse) */
}

.user-message .message-content {
    background: var(--msg-user-bg);
    padding: 10px 16px;
    border-radius: 16px;
    border-top-right-radius: 4px;
    max-width: 80%;
    backdrop-filter: blur(4px);
    flex: 0 1 auto;
    /* Don't stretch */
    width: fit-content;
    /* Hug content */
}

.assistant-message .message-content {
    background: transparent;
}

.typing-indicator span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #ccc;
    border-radius: 50%;
    margin: 0 2px;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
    animation-delay: 0s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.5);
        opacity: 1;
    }
}

.input-section {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px;
    background: var(--input-gradient);
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    /* Let clicks pass through gradient */
}

.input-box-wrapper {
    background: var(--input-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 8px 12px;
    width: 100%;
    max-width: 800px;
    max-width: 800px;
    display: flex;
    align-items: center;
    /* Centered implementation */
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    pointer-events: auto;
    /* Re-enable for input box */
}

.input-box-wrapper:focus-within {
    border-color: rgba(255, 255, 255, 0.3);
}

textarea {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    width: 100%;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.5;
    max-height: 200px;
    resize: none;
    padding: 8px 0;
}

.input-box-wrapper button {
    background: #2563eb;
    /* Blue */
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
}

.input-box-wrapper button:disabled {
    background: transparent;
    color: #666;
    cursor: default;
}

.input-box-wrapper button:hover:not(:disabled) {
    background: #1d4ed8;
    /* Darker Blue */
}

.disclaimer {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 10px;
    opacity: 0.7;
}

pre {
    background: black;
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 10px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

code {
    font-family: 'Consolas', monospace;
    font-size: 14px;
}

/* Enhanced Code Blocks */
.code-block-container {
    margin: 16px 0;
    border-radius: 8px;
    overflow: hidden;
    background: #1e1e1e;
    border: 1px solid var(--border-subtle);
}

.code-block-header {
    background: #2d2d2d;
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.code-lang {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    font-family: monospace;
}

.code-block-actions {
    display: flex;
    gap: 8px;
}

.code-action-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.code-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.code-block-container pre {
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
}

.code-block-container code {
    padding: 16px !important;
    display: block;
    background: transparent !important;
}

[data-theme="light"] .code-block-container {
    background: #f8f9fa;
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .code-block-header {
    background: #e9ecef;
    border-bottom-color: rgba(0, 0, 0, 0.05);
}

/* LANDING PAGE */
.landing-page {
    position: relative;
    z-index: 5;
    color: var(--text-primary);
    overflow-y: auto;
    height: 100vh;
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
    /* Offset for sticky header */
}

.landing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    backdrop-filter: blur(10px);
    background: rgba(0, 0, 0, 0.4);
    /* Solid enough to read, transparent enough for effect */
    position: sticky;
    top: 0;
    z-index: 1000;
    /* Ensure it stays on top */
    width: 100%;
}

[data-theme="light"] .landing-header {
    background: rgba(255, 255, 255, 0.7);
}

.landing-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    margin: 0 15px;
    font-weight: 500;
    transition: color 0.2s;
}

.landing-nav a:hover {
    color: var(--text-primary);
}

.btn-start-small,
.btn-start-hero {
    background: #2563eb;
    /* Vivid Blue */
    color: white;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-start-small {
    padding: 10px 24px;
    font-size: 15px;
}

[data-theme="light"] .btn-start-small,
[data-theme="light"] .btn-start-hero {
    background: #000;
    /* Black for contrast in light mode */
    color: white;
}

.btn-start-small:hover,
.btn-start-hero:hover {
    background: #1d4ed8;
}

.btn-start-hero {
    padding: 12px 32px;
    font-size: 16px;
    margin-top: 20px;
    border-radius: 8px;
}

.hero-section {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    position: relative;
}

.hero-logo-large img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    box-shadow: 0 0 60px rgba(37, 99, 235, 0.5);
    margin-bottom: 30px;
}

.hero-content h1 {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 16px;
}

.hero-content p {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 30px;
}

.about-section,
.features-section,
.contact-section {
    padding: 80px 20px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.about-container h2,
.features-container h2,
.contact-container h2 {
    text-align: center;
    font-size: 32px;
    margin-bottom: 40px;
}

.about-container p {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 40px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
}

.feature-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    text-align: center;
}

.feature-card h3 {
    color: var(--text-primary);
    margin-bottom: 10px;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 14px;
}

.contact-content {
    text-align: center;
}

.contact-details {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.contact-item h3 {
    margin-bottom: 10px;
    color: var(--text-primary);
}

.contact-item p,
.contact-item a {
    color: var(--text-secondary);
    text-decoration: none;
}

.landing-footer {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 14px;
    border-top: 1px solid var(--border-subtle);
}

@media (max-width: 768px) {

    /* LANDING PAGE MOBILE */
    .landing-header {
        padding: 10px 15px;
    }

    .landing-nav {
        display: none !important;
        /* Force hide nav links on mobile */
    }

    .hero-content h1 {
        font-size: 28px;
        line-height: 1.2;
    }

    .hero-content p {
        font-size: 15px;
        padding: 0 10px;
    }

    .hero-logo-large img {
        width: 70px;
        height: 70px;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    /* CHAT PAGE MOBILE */
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100%;
        width: 280px;
        transform: translateX(-100%);
        z-index: 2000;
        transition: transform 0.3s ease;
        background: var(--sidebar-bg);
        backdrop-filter: blur(20px);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.4);
        display: none;
        z-index: 1500;
        backdrop-filter: blur(3px);
    }

    .mobile-overlay.active {
        display: block;
    }

    .messages-container {
        padding: 15px;
    }

    .user-message .message-content {
        max-width: 90%;
    }

    .input-section {
        padding: 10px;
    }

    .input-box-wrapper {
        padding: 6px 10px;
    }

    .suggestions-grid {
        grid-template-columns: 1fr;
    }
}

/* Long-term Memory Sidebar Styles */
.sidebar-memory {
    display: none;
    padding: 15px;
    border-top: 1px solid var(--border-subtle);
    background: rgba(16, 163, 127, 0.05);
}

.memory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 11px;
    font-weight: 700;
    color: #10a37f;
    letter-spacing: 0.5px;
}

#clear-memory-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 10px;
    cursor: pointer;
    text-decoration: underline;
    opacity: 0.6;
}

#clear-memory-btn:hover {
    opacity: 1;
    color: #ef4444;
}

.memory-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 150px;
    overflow-y: auto;
}

.memory-fact {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--input-bg);
    padding: 8px;
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
    line-height: 1.4;
}

.memory-fact svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: #10a37f;
}

.memory-empty {
    font-size: 11px;
    color: var(--text-secondary);
    font-style: italic;
    opacity: 0.7;
    text-align: center;
    padding: 10px 0;
}

/* Install Prompt (Generic) */
.install-prompt {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 360px;
    background: var(--sidebar-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 18px;
    z-index: 9999;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    animation: slideUpPrompt 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpPrompt {
    from {
        transform: translate(-50%, 150px);
        opacity: 0;
    }

    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

.prompt-header {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
}

.prompt-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
}

.close-prompt {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.prompt-body {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.prompt-body b {
    color: var(--text-primary);
}

.ios-share-icon {
    display: inline-flex;
    vertical-align: middle;
    width: 20px;
    height: 20px;
    margin: 0 4px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8'%3E%3C/path%3E%3Cpolyline points='16 6 12 2 8 6'%3E%3C/polyline%3E%3Cline x1='12' y1='2' x2='12' y2='15'%3E%3C/line%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.android-menu-icon {
    display: inline-flex;
    vertical-align: middle;
    width: 20px;
    height: 20px;
    margin: 0 4px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='1'%3E%3C/circle%3E%3Ccircle cx='12' cy='5' r='1'%3E%3C/circle%3E%3Ccircle cx='12' cy='19' r='1'%3E%3C/circle%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.install-action-btn {
    width: 100%;
    padding: 12px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 5px;
}

.install-action-btn:hover {
    background: #1d4ed8;
}

[data-theme="light"] .install-prompt {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .close-prompt {
    background: rgba(0, 0, 0, 0.05);
}

/* --- TYPEWRITER --- */
.typewriter-cursor::after {
    content: '|';
    margin-left: 2px;
    animation: blink 0.7s infinite;
    color: #10a37f;
    font-weight: bold;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}


/* --- MESSAGE ACTIONS --- */
.message-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.message:hover .message-actions {
    opacity: 1;
}

.reaction-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reaction-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.reaction-btn.active {
    color: #10a37f;
    background: rgba(16, 163, 127, 0.1);
}

.input-box-wrapper button#stop-btn:hover {
    background: #dc2626;
}
