/* ================================
   EVARYX AI — MOBILE FIRST
   ================================ */

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

:root {
    --bg: #07080d;
    --surface: #10121a;
    --surface-2: #171923;
    --border: rgba(255, 255, 255, 0.08);
    --text: #f5f7ff;
    --muted: #8d92a3;
    --accent: #7c5cff;
    --accent-2: #20d9ff;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    -webkit-tap-highlight-color: transparent;
}

button,
textarea {
    font: inherit;
}

button {
    border: 0;
    background: none;
    color: inherit;
    cursor: pointer;
}

#app {
    width: 100%;
    height: 100%;
    position: relative;
}


/* ================================
   MAIN MOBILE SCREEN
   ================================ */

.workspace {
    width: 100%;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    position: relative;
    background:
        radial-gradient(
            circle at 50% 28%,
            rgba(76, 61, 170, 0.10),
            transparent 38%
        ),
        var(--bg);
}


/* ================================
   TOP BAR
   ================================ */

.topbar {
    width: 100%;
    height: 60px;
    min-height: 60px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 14px;

    position: relative;
    z-index: 10;
}

.menu-button,
.topbar-more {
    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    color: #e9ebf5;
    font-size: 23px;

    transition: background 0.2s ease;
}

.menu-button:active,
.topbar-more:active {
    background: rgba(255, 255, 255, 0.08);
}

.topbar-brand {
    display: flex;
    align-items: baseline;
    gap: 3px;

    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.topbar-brand small {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-2);
}


/* ================================
   SCROLLABLE CONTENT
   ================================ */

.workspace {
    overflow: hidden;
}

.welcome,
.quick-actions {
    flex-shrink: 0;
}

.welcome {
    text-align: center;

    padding:
        42px
        24px
        20px;
}


/* ================================
   EVARYX LOGO
   ================================ */

.hero-logo {
    width: 58px;
    height: 58px;

    margin: 0 auto 18px;

    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-logo img {
    width: 100%;
    height: 100%;

    object-fit: contain;

    display: block;
}


/* ================================
   BRAND TEXT
   ================================ */

.eyebrow {
    font-size: 10px;
    font-weight: 700;

    letter-spacing: 2.5px;

    color: var(--accent-2);

    margin-bottom: 13px;
}

.welcome h1 {
    max-width: 330px;

    margin: 0 auto;

    font-size: 30px;
    line-height: 1.12;
    font-weight: 700;

    letter-spacing: -0.8px;
}

.welcome h1 span {
    display: block;

    background:
        linear-gradient(
            90deg,
            #ffffff,
            #8c7aff,
            #39dfff
        );

    -webkit-background-clip: text;
    background-clip: text;

    color: transparent;
}

.welcome-description {
    max-width: 310px;

    margin: 14px auto 0;

    color: var(--muted);

    font-size: 14px;
    line-height: 1.55;
}


/* ================================
   QUICK ACTIONS
   ================================ */

.quick-actions {
    width: 100%;

    display: flex;
    gap: 10px;

    padding: 10px 16px 16px;

    overflow-x: auto;

    scrollbar-width: none;
}

.quick-actions::-webkit-scrollbar {
    display: none;
}

.quick-card {
    flex: 0 0 auto;

    min-width: 145px;

    padding: 13px;

    display: flex;
    align-items: center;
    gap: 10px;

    text-align: left;

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 16px;

    transition:
        transform 0.15s ease,
        background 0.15s ease;
}

.quick-card:active {
    transform: scale(0.97);
    background: var(--surface-2);
}

.quick-symbol {
    width: 32px;
    height: 32px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;

    background:
        linear-gradient(
            135deg,
            rgba(124, 92, 255, 0.18),
            rgba(32, 217, 255, 0.12)
        );

    color: #bcb4ff;

    font-size: 16px;
}

.quick-card strong {
    display: block;

    font-size: 13px;
    font-weight: 650;

    margin-bottom: 3px;
}

.quick-card small {
    display: block;

    color: var(--muted);

    font-size: 10px;

    white-space: nowrap;
}


/* ================================
   COMPOSER AREA
   ================================ */

.composer-area {
    margin-top: auto;

    width: 100%;

    padding:
        10px
        12px
        max(12px, env(safe-area-inset-bottom));

    background:
        linear-gradient(
            to top,
            var(--bg) 75%,
            transparent
        );

    position: relative;
    z-index: 5;
}

.composer {
    width: 100%;
    min-height: 54px;

    display: flex;
    align-items: flex-end;

    gap: 7px;

    padding: 7px;

    background: #12141d;

    border: 1px solid rgba(255, 255, 255, 0.10);

    border-radius: 27px;

    box-shadow:
        0 8px 30px rgba(0, 0, 0, 0.30);
}


/* ================================
   COMPOSER BUTTONS
   ================================ */

.composer-action,
.voice-button,
.send-button {
    width: 39px;
    height: 39px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    font-size: 21px;
}

.composer-action {
    color: #aeb3c3;
}

.voice-button {
    color: #aeb3c3;
    font-size: 16px;
}

.composer-action:active,
.voice-button:active {
    background: rgba(255, 255, 255, 0.08);
}

.send-button {
    background: #f4f5fa;

    color: #080910;

    font-size: 20px;

    font-weight: 700;

    transition:
        transform 0.15s ease,
        opacity 0.15s ease;
}

.send-button:active {
    transform: scale(0.91);
}


/* ================================
   MESSAGE INPUT
   ================================ */

#messageInput {
    flex: 1;

    min-width: 0;

    max-height: 120px;

    padding: 10px 3px;

    resize: none;

    outline: none;

    border: 0;

    background: transparent;

    color: var(--text);

    font-size: 15px;

    line-height: 20px;
}

#messageInput::placeholder {
    color: #777c8d;
}


/* ================================
   DISCLAIMER
   ================================ */

.composer-note {
    text-align: center;

    color: #656a79;

    font-size: 9px;

    margin-top: 7px;
}


/* ================================
   SIDEBAR — MOBILE DRAWER
   CLOSED BY DEFAULT
   ================================ */

.sidebar {
    position: fixed;

    top: 0;
    left: 0;

    width: min(84vw, 330px);
    height: 100dvh;

    z-index: 100;

    display: flex;
    flex-direction: column;

    padding:
        14px
        14px
        max(14px, env(safe-area-inset-bottom));

    background: #0c0e15;

    border-right: 1px solid var(--border);

    transform: translateX(-105%);

    transition:
        transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);

    box-shadow:
        12px 0 40px rgba(0, 0, 0, 0.35);
}

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


/* ================================
   SIDEBAR OVERLAY
   ================================ */

.sidebar-overlay {
    position: fixed;

    inset: 0;

    z-index: 90;

    background: rgba(0, 0, 0, 0.62);

    opacity: 0;

    pointer-events: none;

    transition: opacity 0.25s ease;

    backdrop-filter: blur(3px);
}

body.sidebar-open .sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
}


/* ================================
   SIDEBAR HEADER
   ================================ */

.sidebar-header {
    height: 52px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 12px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 9px;

    font-size: 16px;
    font-weight: 700;
}

.logo-small {
    width: 31px;
    height: 31px;
}

.logo-small img {
    width: 100%;
    height: 100%;

    object-fit: contain;
}

.close-sidebar {
    width: 40px;
    height: 40px;

    border-radius: 50%;

    color: #aeb3c2;

    font-size: 27px;
}

.close-sidebar:active {
    background: rgba(255, 255, 255, 0.08);
}


/* ================================
   NEW CHAT
   ================================ */

.new-chat {
    width: 100%;

    min-height: 48px;

    display: flex;
    align-items: center;
    gap: 11px;

    padding: 0 14px;

    border-radius: 14px;

    background: #171a25;

    border: 1px solid var(--border);

    font-size: 14px;
    font-weight: 600;
}

.new-chat:active {
    background: #1e2130;
}

.new-chat-icon {
    font-size: 22px;
    font-weight: 300;
}


/* ================================
   NAVIGATION
   ================================ */

.navigation {
    margin-top: 15px;
}

.nav-item {
    width: 100%;

    min-height: 46px;

    display: flex;
    align-items: center;

    gap: 12px;

    padding: 0 12px;

    border-radius: 12px;

    color: #b0b4c2;

    text-align: left;

    font-size: 14px;
}

.nav-item.active {
    background: rgba(124, 92, 255, 0.12);
    color: #ffffff;
}

.nav-item:active {
    background: rgba(255, 255, 255, 0.07);
}

.nav-icon {
    width: 22px;

    text-align: center;

    font-size: 17px;
}


/* ================================
   RECENT CHATS
   ================================ */

.recent-section {
    margin-top: 18px;

    overflow-y: auto;
}

.section-label {
    padding: 0 12px 8px;

    color: #626777;

    font-size: 10px;
    font-weight: 700;

    letter-spacing: 1.5px;
}

.conversation {
    width: 100%;

    padding: 11px 12px;

    color: #9da2b2;

    text-align: left;

    font-size: 13px;

    border-radius: 10px;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation:active {
    background: rgba(255, 255, 255, 0.06);
}


/* ================================
   SIDEBAR BOTTOM
   ================================ */

.sidebar-bottom {
    margin-top: auto;

    padding-top: 10px;

    border-top: 1px solid var(--border);
}

.profile-button {
    width: 100%;

    display: flex;
    align-items: center;

    gap: 10px;

    padding: 10px 8px;

    text-align: left;
}

.profile-avatar {
    width: 36px;
    height: 36px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background:
        linear-gradient(
            135deg,
            #7c5cff,
            #20d9ff
        );

    color: white;

    font-size: 14px;
    font-weight: 700;
}

.profile-info strong {
    display: block;

    font-size: 13px;
}

.profile-info small {
    display: block;

    margin-top: 2px;

    color: var(--muted);

    font-size: 10px;
}


/* ================================
   SMALL PHONES
   ================================ */

@media (max-height: 680px) {

    .welcome {
        padding-top: 24px;
    }

    .hero-logo {
        width: 48px;
        height: 48px;

        margin-bottom: 12px;
    }

    .welcome h1 {
        font-size: 26px;
    }

    .welcome-description {
        margin-top: 9px;
        font-size: 13px;
    }

    .quick-actions {
        padding-top: 5px;
    }
}





/* =========================================
   SETTINGS PAGE
   ========================================= */

.settings-page {
    min-height: 100dvh;
    width: 100%;
    overflow-y: auto;
    padding: 22px 18px 40px;
    box-sizing: border-box;
}

.settings-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 32px;
}

.settings-header h1 {
    margin: 0;
    font-size: 25px;
    font-weight: 700;
}

.settings-header p {
    margin: 5px 0 0;
    font-size: 13px;
    opacity: 0.55;
}

.back-button {
    width: 42px;
    height: 42px;
    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 13px;

    text-decoration: none;
    font-size: 30px;
    line-height: 1;

    color: inherit;
    background: rgba(255, 255, 255, 0.06);

    border: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-section {
    margin-bottom: 28px;
}

.settings-label {
    margin: 0 0 9px 5px;

    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.4px;

    opacity: 0.42;
}

.settings-item {
    width: 100%;
    min-height: 70px;

    display: flex;
    align-items: center;

    gap: 13px;
    padding: 12px;

    box-sizing: border-box;

    color: inherit;
    text-decoration: none;

    border-bottom: 1px solid rgba(255, 255, 255, 0.06);

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.settings-item:first-of-type {
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}

.settings-item:last-child {
    border-bottom: none;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
}

.settings-item:active {
    background: rgba(255, 255, 255, 0.06);
    transform: scale(0.985);
}

.settings-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background: rgba(255, 255, 255, 0.06);

    font-size: 18px;
}

.settings-content {
    min-width: 0;
    flex: 1;

    display: flex;
    flex-direction: column;

    gap: 4px;
}

.settings-content strong {
    font-size: 14px;
    font-weight: 600;
}

.settings-content span {
    font-size: 12px;
    line-height: 1.4;
    opacity: 0.48;
}

.settings-arrow {
    font-size: 24px;
    opacity: 0.35;
}

.settings-footer {
    display: flex;
    flex-direction: column;
    align-items: center;

    gap: 5px;

    margin-top: 42px;
    padding-top: 28px;

    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.settings-footer img {
    width: 34px;
    height: 34px;
    object-fit: contain;

    margin-bottom: 4px;
}

.settings-footer span {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.8px;
}

.settings-footer small {
    font-size: 10px;
    opacity: 0.35;
    letter-spacing: 1px;
}


/* =========================================
   EVARYX CHAT MESSAGES
   ========================================= */

.chat-area {
    width: 100%;
    flex: 1;

    overflow-y: auto;

    display: flex;
    flex-direction: column;

    gap: 12px;

    padding: 20px 18px;

    box-sizing: border-box;
}

.message {
    max-width: 82%;

    padding: 11px 14px;

    border-radius: 16px;

    font-size: 14px;
    line-height: 1.5;

    word-wrap: break-word;
}

.user-message {
    align-self: flex-end;

    background: rgba(255, 255, 255, 0.10);

    border-bottom-right-radius: 5px;
}

.ai-message {
    align-self: flex-start;

    background: rgba(255, 255, 255, 0.05);

    border: 1px solid rgba(255, 255, 255, 0.07);

    border-bottom-left-radius: 5px;
}

.error-message {
    align-self: flex-start;

    background: rgba(255, 80, 80, 0.08);

    border: 1px solid rgba(255, 80, 80, 0.15);
}


/* =========================================================
   EVARYX AI — CURRENT INDEX.HTML COMPATIBILITY FIX
   ========================================================= */


/* =========================
   TOP BAR
   ========================= */

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-brand img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    display: block;
}

.topbar-brand span {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.4px;
}


/* =========================
   WELCOME LOGO
   ========================= */

.welcome-logo {
    width: 96px;
    height: 96px;

    margin: 0 auto 20px;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;
}

.welcome-logo img {
    width: 100%;
    height: 100%;

    max-width: 100%;
    max-height: 100%;

    object-fit: contain;

    display: block;
}


/* =========================
   WELCOME
   ========================= */

.welcome {
    flex-shrink: 0;
    text-align: center;

    padding: 30px 20px 12px;
}

.welcome h1 {
    margin: 0 auto;

    max-width: 330px;

    font-size: 28px;
    line-height: 1.15;
    font-weight: 700;

    letter-spacing: -0.6px;
}

.welcome p {
    max-width: 320px;

    margin: 12px auto 0;

    color: var(--muted);

    font-size: 14px;
    line-height: 1.5;
}


/* =========================
   QUICK ACTIONS
   ========================= */

.quick-actions {
    width: 100%;

    display: flex;

    gap: 8px;

    padding: 8px 14px 12px;

    overflow-x: auto;

    scrollbar-width: none;

    flex-shrink: 0;
}

.quick-actions::-webkit-scrollbar {
    display: none;
}

.quick-action {
    flex: 1 0 0;

    min-width: 76px;

    min-height: 42px;

    padding: 9px 12px;

    border-radius: 13px;

    background: var(--surface);

    border: 1px solid var(--border);

    color: #dfe2ed;

    font-size: 12px;

    font-weight: 600;

    white-space: nowrap;

    transition:
        background 0.15s ease,
        transform 0.15s ease;
}

.quick-action:active {
    background: var(--surface-2);

    transform: scale(0.96);
}


/* =========================
   CHAT AREA
   ========================= */

.chat-area {
    width: 100%;

    flex: 1;

    min-height: 0;

    overflow-y: auto;

    display: flex;

    flex-direction: column;

    gap: 12px;

    padding: 14px 16px;

    scrollbar-width: thin;
}


/* =========================
   MESSAGE
   ========================= */

.message {
    width: fit-content;

    max-width: 84%;

    padding: 11px 14px;

    border-radius: 16px;

    font-size: 14px;

    line-height: 1.5;

    word-break: break-word;
}

.user-message {
    align-self: flex-end;

    background: rgba(255, 255, 255, 0.10);

    border-bottom-right-radius: 5px;
}

.assistant-message {
    align-self: flex-start;

    background: rgba(255, 255, 255, 0.05);

    border: 1px solid rgba(255, 255, 255, 0.07);

    border-bottom-left-radius: 5px;
}

.message-content {
    min-width: 0;
}


/* =========================
   COMPOSER
   ========================= */

.composer-area {
    width: 100%;

    margin-top: auto;

    flex-shrink: 0;

    padding:
        8px
        12px
        max(10px, env(safe-area-inset-bottom));

    background:
        linear-gradient(
            to top,
            var(--bg) 70%,
            transparent
        );

    position: relative;

    z-index: 5;
}

.composer {
    width: 100%;

    min-height: 54px;

    display: flex;

    align-items: flex-end;

    gap: 6px;

    padding: 7px;

    background: #12141d;

    border: 1px solid rgba(255, 255, 255, 0.10);

    border-radius: 27px;

    box-shadow:
        0 8px 30px rgba(0, 0, 0, 0.30);
}


/* =========================
   COMPOSER BUTTONS
   ========================= */

.composer-button {
    width: 39px;

    height: 39px;

    flex: 0 0 39px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 50%;

    color: #aeb3c3;

    font-size: 20px;
}

.composer-button:active {
    background: rgba(255, 255, 255, 0.08);

    transform: scale(0.94);
}

.send-button {
    width: 39px;

    height: 39px;

    flex: 0 0 39px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 50%;

    background: #f4f5fa;

    color: #080910;

    font-size: 20px;

    font-weight: 700;

    transition:
        transform 0.15s ease,
        opacity 0.15s ease;
}

.send-button:active {
    transform: scale(0.91);
}

.send-button:disabled {
    opacity: 0.45;

    cursor: default;
}


/* =========================
   MESSAGE INPUT
   ========================= */

#messageInput {
    flex: 1;

    min-width: 0;

    width: 100%;

    max-height: 120px;

    min-height: 39px;

    padding: 9px 3px;

    resize: none;

    outline: none;

    border: 0;

    background: transparent;

    color: var(--text);

    font-size: 15px;

    line-height: 20px;
}

#messageInput::placeholder {
    color: #777c8d;
}


/* =========================
   DISCLAIMER
   ========================= */

.composer-disclaimer {
    text-align: center;

    color: #656a79;

    font-size: 9px;

    line-height: 1.3;

    margin-top: 6px;

    padding: 0 4px;
}


/* =========================================================
   SIDEBAR — MATCH CURRENT INDEX.HTML
   ========================================================= */

.sidebar {
    position: fixed;

    top: 0;
    left: 0;

    width: min(84vw, 330px);

    height: 100dvh;

    z-index: 100;

    display: flex;

    flex-direction: column;

    padding:
        14px
        14px
        max(14px, env(safe-area-inset-bottom));

    background: #0c0e15;

    border-right: 1px solid var(--border);

    transform: translateX(-105%);

    transition:
        transform 0.28s cubic-bezier(
            0.4,
            0,
            0.2,
            1
        );

    box-shadow:
        12px 0 40px rgba(0, 0, 0, 0.35);
}

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

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


/* =========================
   SIDEBAR HEADER
   ========================= */

.sidebar-header {
    min-height: 52px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 12px;
}

.sidebar-brand {
    display: flex;

    align-items: center;

    gap: 9px;

    min-width: 0;
}

.sidebar-brand img {
    width: 34px;

    height: 34px;

    flex: 0 0 34px;

    object-fit: contain;
}

.sidebar-brand strong {
    display: block;

    font-size: 15px;

    font-weight: 700;
}

.sidebar-brand span {
    display: block;

    margin-top: 2px;

    color: var(--muted);

    font-size: 9px;
}


/* =========================
   ICON BUTTON
   ========================= */

.icon-button {
    width: 42px;

    height: 42px;

    display: flex;

    align-items: center;

    justify-content: center;

    flex-shrink: 0;

    border-radius: 50%;

    color: #e9ebf5;

    font-size: 23px;
}

.icon-button:active {
    background: rgba(255, 255, 255, 0.08);
}


/* =========================
   SIDEBAR NAV
   ========================= */

.sidebar-nav {
    display: flex;

    flex-direction: column;

    gap: 4px;

    margin-top: 15px;
}

.sidebar-nav-item {
    width: 100%;

    min-height: 46px;

    display: flex;

    align-items: center;

    gap: 10px;

    padding: 0 12px;

    border-radius: 12px;

    color: #b0b4c2;

    text-align: left;

    font-size: 14px;
}

.sidebar-nav-item.active {
    background: rgba(124, 92, 255, 0.12);

    color: #ffffff;
}

.sidebar-nav-item:active {
    background: rgba(255, 255, 255, 0.07);
}


/* =========================
   RECENT CONVERSATIONS
   ========================= */

.recent-section {
    flex: 1;

    min-height: 0;

    margin-top: 18px;

    overflow-y: auto;
}

.section-label {
    padding: 0 12px 8px;

    color: #626777;

    font-size: 10px;

    font-weight: 700;

    letter-spacing: 1.5px;
}

.conversation-list {
    display: flex;

    flex-direction: column;

    gap: 2px;
}

.conversation-item {
    width: 100%;

    padding: 11px 12px;

    color: #9da2b2;

    text-align: left;

    font-size: 13px;

    border-radius: 10px;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}

.conversation-item:active,
.conversation-item.active {
    background: rgba(255, 255, 255, 0.06);

    color: #ffffff;
}

.conversation-empty {
    padding: 12px;

    color: #626777;

    font-size: 12px;
}


/* =========================
   SIDEBAR BOTTOM
   ========================= */

.sidebar-bottom {
    margin-top: auto;

    padding-top: 10px;

    border-top: 1px solid var(--border);
}

.profile-button {
    width: 100%;

    display: flex;

    align-items: center;

    gap: 10px;

    padding: 10px 8px;

    text-align: left;
}

.profile-avatar {
    width: 36px;

    height: 36px;

    flex-shrink: 0;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 50%;

    background:
        linear-gradient(
            135deg,
            #7c5cff,
            #20d9ff
        );

    color: white;

    font-size: 14px;

    font-weight: 700;
}

.profile-info {
    min-width: 0;
}

.profile-info strong {
    display: block;

    font-size: 13px;
}

.profile-info span {
    display: block;

    margin-top: 2px;

    color: var(--muted);

    font-size: 10px;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}


/* =========================
   SMALL PHONES
   ========================= */

@media (max-height: 680px) {

    .welcome {
        padding-top: 18px;
    }

    .welcome-logo {
        width: 70px;

        height: 70px;

        margin-bottom: 12px;
    }

    .welcome h1 {
        font-size: 25px;
    }

    .welcome p {
        margin-top: 8px;

        font-size: 12px;
    }

    .quick-actions {
        padding-top: 5px;

        padding-bottom: 8px;
    }

}


/* =========================================================
   EVARYX AI — MESSAGE & CODE BLOCK FIX
   Prevents long code from causing horizontal page scrolling
   ========================================================= */

.message {
    min-width: 0;
    max-width: min(84%, 100%);
    overflow: hidden;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.message-content {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    overflow-wrap: anywhere;
    word-break: break-word;
}


/* =========================
   CODE BLOCKS
   ========================= */

.evaryx-code-block {
    display: block;

    width: 100%;
    max-width: 100%;

    margin: 10px 0 4px;

    padding: 12px;

    box-sizing: border-box;

    background: #080a10;

    border: 1px solid rgba(255, 255, 255, 0.08);

    border-radius: 10px;

    overflow-x: auto;
    overflow-y: hidden;

    white-space: pre;

    -webkit-overflow-scrolling: touch;

    scrollbar-width: thin;
}

.evaryx-code-block code {
    display: block;

    width: max-content;
    min-width: 100%;

    max-width: none;

    margin: 0;
    padding: 0;

    background: transparent;
    border: 0;

    color: #e8eaf2;

    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        Menlo,
        monospace;

    font-size: 12px;

    line-height: 1.6;

    white-space: pre;

    overflow: visible;

    word-break: normal;
}


/* =========================
   INLINE CODE
   ========================= */

.message-content > code,
.message-content code:not(.evaryx-code-block code) {
    padding: 2px 5px;

    border-radius: 5px;

    background: rgba(255, 255, 255, 0.08);

    color: #dcd8ff;

    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        Menlo,
        monospace;

    font-size: 0.9em;

    overflow-wrap: anywhere;
}


/* =========================
   MOBILE SAFETY
   ========================= */

.chat-area {
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
}

.assistant-message,
.user-message {
    min-width: 0;
    max-width: min(84%, calc(100vw - 32px));
}

.assistant-message .message-content,
.user-message .message-content {
    min-width: 0;
    max-width: 100%;
}






/* =========================================================
   EVARYX AI — MOBILE CONVERSATION ACTION SHEET
   ========================================================= */

.evaryx-conversation-backdrop {
    position: fixed;

    inset: 0;

    z-index: 9999;

    display: flex;

    align-items: flex-end;

    justify-content: center;

    background:
        rgba(0, 0, 0, 0.58);

    backdrop-filter:
        blur(8px);

    -webkit-backdrop-filter:
        blur(8px);

    padding:
        12px;

    animation:
        evaryxSheetBackdropIn
        0.18s
        ease-out;
}


.evaryx-conversation-sheet {
    width: 100%;

    max-width: 520px;

    background:
        #151722;

    border:
        1px solid
        rgba(255, 255, 255, 0.09);

    border-radius:
        24px;

    padding:
        10px
        12px
        calc(
            12px +
            env(
                safe-area-inset-bottom
            )
        );

    box-shadow:
        0
        -10px
        50px
        rgba(0, 0, 0, 0.5);

    animation:
        evaryxSheetUp
        0.22s
        cubic-bezier(
            0.2,
            0.8,
            0.2,
            1
        );
}


.evaryx-sheet-handle {
    width: 42px;

    height: 4px;

    margin:
        2px
        auto
        16px;

    border-radius:
        999px;

    background:
        rgba(255, 255, 255, 0.2);
}


.evaryx-sheet-title {
    padding:
        4px
        12px
        14px;

    color:
        #ffffff;

    font-size:
        15px;

    font-weight:
        700;

    white-space:
        nowrap;

    overflow:
        hidden;

    text-overflow:
        ellipsis;
}


.evaryx-sheet-actions {
    display:
        flex;

    flex-direction:
        column;

    gap:
        4px;
}


.evaryx-sheet-action {
    width: 100%;

    min-height:
        52px;

    display:
        flex;

    align-items:
        center;

    gap:
        14px;

    padding:
        0
        14px;

    border-radius:
        14px;

    color:
        #e9eaf2;

    background:
        transparent;

    text-align:
        left;

    font-size:
        14px;

    font-weight:
        500;

    transition:
        background
        0.15s
        ease;
}


.evaryx-sheet-action:active {
    background:
        rgba(255, 255, 255, 0.08);
}


.evaryx-sheet-action.danger {
    color:
        #ff6b75;
}


.evaryx-sheet-icon {
    width:
        28px;

    flex:
        0 0 28px;

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    font-size:
        18px;
}


.evaryx-sheet-cancel {
    width: 100%;

    min-height:
        52px;

    margin-top:
        8px;

    border-radius:
        14px;

    background:
        rgba(255, 255, 255, 0.06);

    color:
        #ffffff;

    font-size:
        14px;

    font-weight:
        600;
}


.evaryx-sheet-cancel:active {
    background:
        rgba(255, 255, 255, 0.1);
}


@keyframes evaryxSheetBackdropIn {

    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}


@keyframes evaryxSheetUp {

    from {
        opacity: 0;

        transform:
            translateY(
                35px
            );
    }

    to {
        opacity: 1;

        transform:
            translateY(
                0
            );
    }
}


/* Prevent accidental text selection
   while long-pressing conversations */

.conversation-item {
    -webkit-user-select:
        none;

    user-select:
        none;

    -webkit-touch-callout:
        none;

    touch-action:
        pan-y;
}





/* =========================================================
   EVARYX AI — FINAL CHAT RESPONSE / IMAGE LAYOUT FIX
   ========================================================= */

/*
   IMPORTANT:
   These rules intentionally come LAST so they override
   the older duplicated message rules in Style.css.
*/


/* =========================================================
   CHAT AREA
   ========================================================= */

.chat-area {
    width: 100%;
    flex: 1;
    min-width: 0;
    min-height: 0;

    display: flex;
    flex-direction: column;
    gap: 12px;

    padding: 14px 16px;

    overflow-y: auto;
    overflow-x: hidden;

    box-sizing: border-box;

    scrollbar-width: thin;

    /*
       Prevent flexbox from shrinking/cropping messages.
    */
    align-items: stretch;
}


/* =========================================================
   ALL MESSAGE CONTAINERS
   ========================================================= */

.message {
    position: relative;

    width: fit-content;

    /*
       Never allow a message to become wider than the screen.
    */
    max-width: min(84%, calc(100vw - 32px));

    /*
       CRITICAL:
       Let the message grow vertically according to its content.
    */
    height: auto;
    min-height: 0;

    flex: 0 0 auto;

    padding: 11px 14px;

    border-radius: 16px;

    font-size: 14px;
    line-height: 1.55;

    box-sizing: border-box;

    /*
       Long text must wrap.
    */
    overflow-wrap: anywhere;
    word-break: break-word;

    /*
       DO NOT hide the message itself.
       Code blocks get their own horizontal scrolling.
    */
    overflow: visible;
}


/* =========================================================
   MESSAGE CONTENT
   ========================================================= */

.message-content {
    width: 100%;
    min-width: 0;
    max-width: 100%;

    height: auto;
    min-height: 0;

    box-sizing: border-box;

    overflow: visible;

    overflow-wrap: anywhere;
    word-break: break-word;
}


/* =========================================================
   USER MESSAGE
   ========================================================= */

.user-message {
    align-self: flex-end;

    background: rgba(255, 255, 255, 0.10);

    border: 0;

    border-bottom-right-radius: 5px;
}


/* =========================================================
   EVARYX ASSISTANT MESSAGE
   ========================================================= */

.assistant-message {
    align-self: flex-start;

    /*
       The response surface expands naturally.
    */
    width: fit-content;
    max-width: min(84%, calc(100vw - 32px));

    height: auto;
    min-height: 0;

    background: rgba(255, 255, 255, 0.045);

    border: 1px solid rgba(255, 255, 255, 0.075);

    border-bottom-left-radius: 5px;

    /*
       IMPORTANT:
       Never clip the assistant response.
    */
    overflow: visible;
}


/*
   The assistant content must NEVER have a fixed height.
*/
.assistant-message .message-content {
    height: auto;
    max-height: none;

    overflow: visible;
}


/* =========================================================
   THINKING MESSAGE
   ========================================================= */

.thinking-message {
    width: fit-content;

    max-width: 84%;

    height: auto;
    min-height: 0;
}


/* =========================================================
   ERROR MESSAGE
   ========================================================= */

.error-message {
    align-self: flex-start;

    width: fit-content;

    max-width: min(84%, calc(100vw - 32px));

    background: rgba(255, 80, 80, 0.08);

    border: 1px solid rgba(255, 80, 80, 0.15);
}


/* =========================================================
   NORMAL ASSISTANT TEXT
   ========================================================= */

.message-content p {
    margin: 0 0 10px;
}

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

.message-content strong {
    font-weight: 700;
}

.message-content em {
    font-style: italic;
}


/* =========================================================
   HEADINGS INSIDE EVARYX RESPONSES
   ========================================================= */

.message-content h1,
.message-content h2,
.message-content h3 {
    margin: 14px 0 8px;

    line-height: 1.3;
}

.message-content h1:first-child,
.message-content h2:first-child,
.message-content h3:first-child {
    margin-top: 0;
}


/* =========================================================
   LISTS
   ========================================================= */

.message-content ul,
.message-content ol {
    margin: 8px 0 10px;

    padding-left: 22px;
}

.message-content li {
    margin: 4px 0;
}


/* =========================================================
   LINKS
   ========================================================= */

.message-content a {
    color: #9b8cff;

    text-decoration: underline;

    overflow-wrap: anywhere;
}


/* =========================================================
   CODE BLOCK
   ========================================================= */

.evaryx-code-block {
    display: block;

    width: 100%;
    max-width: 100%;

    /*
       Code block expands the assistant message vertically,
       but scrolls horizontally by itself.
    */
    height: auto;
    min-height: 0;

    margin: 10px 0 4px;

    padding: 12px;

    box-sizing: border-box;

    background: #080a10;

    border: 1px solid rgba(255, 255, 255, 0.08);

    border-radius: 10px;

    /*
       ONLY the code block scrolls horizontally.
    */
    overflow-x: auto;
    overflow-y: hidden;

    -webkit-overflow-scrolling: touch;

    scrollbar-width: thin;

    white-space: pre;
}


/* =========================================================
   CODE INSIDE CODE BLOCK
   ========================================================= */

.evaryx-code-block code {
    display: block;

    width: max-content;

    min-width: 100%;

    max-width: none;

    margin: 0;

    padding: 0;

    background: transparent;

    border: 0;

    color: #e8eaf2;

    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        Menlo,
        monospace;

    font-size: 12px;

    line-height: 1.6;

    white-space: pre;

    overflow: visible;

    word-break: normal;
}


/* =========================================================
   INLINE CODE
   ========================================================= */

.message-content code:not(.evaryx-code-block code) {
    padding: 2px 5px;

    border-radius: 5px;

    background: rgba(255, 255, 255, 0.08);

    color: #dcd8ff;

    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        Menlo,
        monospace;

    font-size: 0.9em;

    overflow-wrap: anywhere;
}


/* =========================================================
   IMAGE MESSAGE
   ========================================================= */

/*
   Generated images must NOT inherit the normal text-message
   bubble dimensions.
*/

.image-message {
    align-self: flex-start;

    width: auto;

    max-width: min(92%, calc(100vw - 24px));

    height: auto;

    padding: 0;

    background: transparent;

    border: 0;

    border-radius: 0;

    overflow: visible;
}


.image-message .message-content {
    width: 100%;

    height: auto;

    overflow: visible;
}


/* =========================================================
   IMAGE GALLERY
   ========================================================= */

.evaryx-image-gallery {
    width: 100%;

    display: flex;

    flex-direction: column;

    gap: 10px;

    height: auto;

    overflow: visible;
}


/* =========================================================
   GENERATED IMAGE
   ========================================================= */

.evaryx-generated-image {
    display: block;

    width: auto;

    max-width: 100%;

    height: auto;

    min-height: 0;

    object-fit: contain;

    border-radius: 16px;

    background: #10121a;

    border: 1px solid rgba(255, 255, 255, 0.08);

    box-shadow:
        0 8px 28px rgba(0, 0, 0, 0.24);
}


/* =========================================================
   MOBILE SCREEN SAFETY
   ========================================================= */

@media (max-width: 480px) {

    .chat-area {
        padding-left: 12px;
        padding-right: 12px;
    }

    .message {
        max-width: calc(100vw - 32px);
    }

    .assistant-message,
    .user-message {
        max-width: calc(100vw - 32px);
    }

    .image-message {
        max-width: calc(100vw - 24px);
    }

    .evaryx-code-block {
        max-width: 100%;
    }
}


/* =========================================================
   VERY SMALL PHONES
   ========================================================= */

@media (max-width: 360px) {

    .message {
        max-width: calc(100vw - 24px);

        padding: 10px 12px;

        font-size: 13px;
    }

    .assistant-message,
    .user-message {
        max-width: calc(100vw - 24px);
    }

    .image-message {
        max-width: calc(100vw - 20px);
    }
}