/* =========================================================
   MY AI ASSISTANT
   COMPLETE RESPONSIVE STYLESHEET
   Desktop + Mobile
   ========================================================= */


/* =========================================================
   1. GLOBAL
   ========================================================= */

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

html {
    width: 100%;
    height: 100%;
}

body {
    width: 100%;
    height: 100%;
    min-height: 100vh;

    margin: 0;

    background: #0b0b0f;
    color: #f5f5f5;

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    overflow: hidden;
}


/* =========================================================
   2. HIDDEN ELEMENTS
   ========================================================= */

[hidden] {
    display: none !important;
}


/* =========================================================
   3. AUTHENTICATION SCREEN
   ========================================================= */

.auth-screen {
    width: 100%;
    height: 100dvh;

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

    padding: 20px;

    background:
        radial-gradient(
            circle at top,
            rgba(255, 255, 255, 0.04),
            transparent 45%
        ),
        #0b0b0f;

    overflow-y: auto;
}

.auth-card {
    width: 100%;
    max-width: 430px;

    padding: 32px;

    background: #141419;

    border: 1px solid #2a2a31;
    border-radius: 18px;

    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.45);
}

.auth-logo {
    width: 64px;
    height: 64px;

    margin: 0 auto 18px;

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

    background: #202027;

    border: 1px solid #34343d;
    border-radius: 16px;

    font-size: 32px;
}

.auth-title {
    text-align: center;

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

    margin-bottom: 8px;
}

.auth-subtitle {
    text-align: center;

    color: #9999a3;

    font-size: 14px;

    margin-bottom: 26px;
}


/* =========================================================
   4. AUTH TABS
   ========================================================= */

.auth-tabs {
    display: flex;

    gap: 4px;

    margin-bottom: 22px;

    padding: 4px;

    background: #0e0e12;

    border: 1px solid #27272e;
    border-radius: 10px;
}

.auth-tab {
    flex: 1;

    border: none;
    border-radius: 7px;

    padding: 10px;

    background: transparent;

    color: #92929c;

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

    cursor: pointer;

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

.auth-tab:hover {
    color: #ffffff;
}

.auth-tab.active {
    background: #292930;
    color: #ffffff;
}


/* =========================================================
   5. AUTH FORMS
   ========================================================= */

.auth-form {
    display: none;

    flex-direction: column;

    gap: 14px;
}

.auth-form.active {
    display: flex;
}

.auth-label {
    color: #c8c8d0;

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

.auth-input {
    width: 100%;

    padding: 13px 14px;

    background: #0d0d11;

    color: #ffffff;

    border: 1px solid #303039;
    border-radius: 10px;

    outline: none;

    font-size: 15px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.auth-input::placeholder {
    color: #65656e;
}

.auth-input:focus {
    border-color: #666671;

    box-shadow:
        0 0 0 3px rgba(255, 255, 255, 0.05);
}

.auth-button {
    width: 100%;

    margin-top: 6px;

    padding: 13px 16px;

    border: none;
    border-radius: 10px;

    background: #ffffff;

    color: #111111;

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

    cursor: pointer;

    transition:
        opacity 0.2s ease,
        transform 0.1s ease;
}

.auth-button:hover {
    opacity: 0.9;
}

.auth-button:active {
    transform: scale(0.99);
}

.auth-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.auth-message {
    min-height: 20px;

    margin-top: 4px;

    text-align: center;

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

.auth-message.error {
    color: #ff7070;
}

.auth-message.success {
    color: #7ee2a8;
}

.auth-footer {
    margin-top: 22px;

    text-align: center;

    color: #707079;

    font-size: 12px;
}


/* =========================================================
   6. MAIN APPLICATION
   ========================================================= */

#appShell {
    position: relative;

    width: 100%;
    height: 100dvh;

    display: flex;

    overflow: hidden;

    background: #0b0b0f;
}


/* =========================================================
   7. SIDEBAR
   ========================================================= */

.sidebar {
    width: 260px;
    min-width: 260px;

    height: 100dvh;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    background: #111116;

    border-right: 1px solid #29292f;

    z-index: 1000;
}


/* =========================================================
   8. BRAND
   ========================================================= */

.brand {
    display: flex;
    align-items: center;

    gap: 12px;

    padding: 20px 18px;

    border-bottom: 1px solid #25252c;
}

.brand-icon {
    width: 38px;
    height: 38px;

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

    background: #202027;

    border: 1px solid #35353e;
    border-radius: 10px;

    font-size: 21px;

    flex-shrink: 0;
}

.brand-text {
    color: #ffffff;

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

    white-space: nowrap;
}


/* =========================================================
   9. NEW CHAT BUTTON
   ========================================================= */

.new-chat-btn {
    margin: 16px 14px 12px;

    padding: 12px 14px;

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

    gap: 8px;

    border: 1px solid #35353e;
    border-radius: 10px;

    background: #1c1c22;

    color: #ffffff;

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

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}

.new-chat-btn:hover {
    background: #25252c;
    border-color: #45454e;
}


/* =========================================================
   10. NAVIGATION
   ========================================================= */

.sidebar-nav {
    flex: 1;

    padding: 4px 10px;

    overflow-y: auto;
}

.nav-item {
    width: 100%;

    display: flex;
    align-items: center;

    gap: 12px;

    margin-bottom: 4px;

    padding: 11px 12px;

    border: none;
    border-radius: 9px;

    background: transparent;

    color: #a7a7b0;

    text-align: left;

    font-size: 14px;

    cursor: pointer;

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

.nav-item:hover {
    background: #1c1c22;
    color: #ffffff;
}

.nav-item.active {
    background: rgba(0, 229, 255, 0.1);
    color: #00e5ff;

    border-left: 3px solid #00e5ff;
}

.nav-icon {
    width: 22px;

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

    font-size: 17px;

    flex-shrink: 0;
}


/* =========================================================
   11. USER ACCOUNT
   ========================================================= */

.user-account {
    display: flex;
    align-items: center;

    gap: 10px;

    margin: 10px 12px;

    padding: 10px;

    background: #18181e;

    border: 1px solid #292930;
    border-radius: 10px;
}

.user-avatar {
    width: 34px;
    height: 34px;

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

    border-radius: 50%;

    background: #303039;

    color: #ffffff;

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

    flex-shrink: 0;
}

.user-details {
    min-width: 0;

    flex: 1;
}

.user-label {
    color: #777780;

    font-size: 10px;

    margin-bottom: 2px;
}

.user-email {
    color: #ddddE3;

    font-size: 12px;

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

.logout-button {
    border: none;

    background: transparent;

    color: #85858e;

    font-size: 12px;

    cursor: pointer;
}

.logout-button:hover {
    color: #ffffff;
}


/* =========================================================
   12. SIDEBAR FOOTER
   ========================================================= */

.sidebar-footer {
    padding: 0 14px 16px;
}

.online-status {
    display: flex;
    align-items: center;

    gap: 8px;

    color: #85858e;

    font-size: 11px;
}

.status-dot {
    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: #50d890;

    box-shadow:
        0 0 8px rgba(80, 216, 144, 0.5);
}


/* =========================================================
   13. MAIN CONTENT
   ========================================================= */

.main-content {
    flex: 1;

    min-width: 0;

    height: 100dvh;

    display: flex;
    flex-direction: column;

    overflow: hidden;

    background: #0b0b0f;
}


/* =========================================================
   14. TOPBAR
   ========================================================= */

.topbar {
    min-height: 74px;

    display: flex;
    align-items: center;

    padding: 14px 24px;

    background: #0e0e13;

    border-bottom: 1px solid #29292f;

    flex-shrink: 0;
}

.page-heading {
    min-width: 0;
}

#pageTitle {
    color: #f4f4f6;

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

    margin-bottom: 4px;
}

#pageSubtitle {
    color: #85858e;

    font-size: 13px;
}


/* =========================================================
   15. MOBILE MENU BUTTON
   ========================================================= */

.mobile-menu-button {
    display: none;

    width: 42px;
    height: 42px;

    margin-right: 12px;

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

    border: 1px solid #303039;
    border-radius: 10px;

    background: #18181e;

    color: #ffffff;

    font-size: 22px;

    cursor: pointer;

    flex-shrink: 0;
}

.mobile-menu-button:hover {
    background: #25252c;
}


/* =========================================================
   15b. MOBILE SIDEBAR OVERLAY
   (a real element instead of a ::after pseudo-element,
   so it can carry its own click-to-close handler)
   ========================================================= */

.sidebar-overlay {
    display: none;

    position: fixed;

    inset: 0;

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

    z-index: 999;
}


/* =========================================================
   16. CONTENT SECTIONS
   ========================================================= */

.content-section {
    display: none;

    flex: 1;

    min-height: 0;

    overflow: hidden;
}

.content-section.active {
    display: flex;
    flex-direction: column;
}


/* =========================================================
   17. CHAT SECTION
   ========================================================= */

#chatSection {
    position: relative;

    min-height: 0;
}


/* =========================================================
   18. CHATBOX
   ========================================================= */

#chatbox {
    flex: 1;

    min-height: 0;

    width: 100%;

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

    padding: 28px 30px 150px;

    scroll-behavior: smooth;
}


/* Scrollbar */

#chatbox::-webkit-scrollbar,
.sidebar-nav::-webkit-scrollbar {
    width: 7px;
}

#chatbox::-webkit-scrollbar-track,
.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

#chatbox::-webkit-scrollbar-thumb,
.sidebar-nav::-webkit-scrollbar-thumb {
    background: #303039;

    border-radius: 10px;
}

#chatbox::-webkit-scrollbar-thumb:hover,
.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: #45454e;
}


/* =========================================================
   19. WELCOME MESSAGE
   ========================================================= */

.welcome-message {
    width: 100%;

    min-height: 60vh;

    display: flex;
    flex-direction: column;

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

    text-align: center;

    padding: 40px 20px;
}

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

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

    margin-bottom: 28px;

    background: #1d1d23;

    border: 1px solid #34343c;
    border-radius: 22px;

    font-size: 48px;

    box-shadow:
        0 10px 35px rgba(0, 0, 0, 0.25);
}

.welcome-message h2 {
    color: #f5f5f6;

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

    margin-bottom: 12px;
}

.welcome-message p {
    max-width: 650px;

    color: #92929c;

    font-size: 16px;
    line-height: 1.6;
}


/* =========================================================
   20. CHAT MESSAGES
   ========================================================= */

.message {
    width: 100%;

    display: flex;

    margin-bottom: 18px;

    animation:
        messageAppear 0.18s ease;
}

@keyframes messageAppear {

    from {
        opacity: 0;
        transform: translateY(5px);
    }

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

}


/* USER MESSAGE */

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

    padding-left: 15%;
}

.user-message .message-content {
    max-width: 75%;

    padding: 11px 15px;

    background: #2b2b33;

    color: #ffffff;

    border-radius: 16px 16px 4px 16px;

    line-height: 1.5;

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


/* AI MESSAGE */

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

    padding-right: 15%;
}

.ai-message .message-content {
    max-width: 75%;

    padding: 11px 15px;

    background: transparent;

    color: #eeeeF1;

    border-radius: 16px;

    line-height: 1.6;

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


/* =========================================================
   21. MESSAGE CONTENT
   ========================================================= */

.message-content {
    font-size: 15px;

    white-space: pre-wrap;
}


/* =========================================================
   21b. TYPING INDICATOR (animated triple dots)
   ========================================================= */

.typing-dots {
    display: inline-flex;

    align-items: center;

    gap: 4px;

    padding: 4px 0;
}

.typing-dot {
    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: #00e5ff;

    box-shadow: 0 0 6px rgba(0, 229, 255, 0.7);

    opacity: 0.4;

    animation:
        typing-bounce
        1.2s
        infinite
        ease-in-out;
}

.typing-dot:nth-child(1) {
    animation-delay: 0s;
}

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

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;

    background: #39ff8c;
    box-shadow: 0 0 6px rgba(57, 255, 140, 0.7);
}

@keyframes typing-bounce {

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

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

}


/* =========================================================
   22. COMPOSER
   ========================================================= */

.composer-container {
    position: absolute;

    left: 50%;
    bottom: 18px;

    transform: translateX(-50%);

    width: min(
        900px,
        calc(100% - 48px)
    );

    z-index: 100;
}


/* =========================================================
   23. COMPOSER BOX
   ========================================================= */

.composer-box {
    position: relative;

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

    gap: 8px;

    padding: 8px;

    background: #19191f;

    border: 1px solid #34343d;

    border-radius: 17px;

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


/* =========================================================
   24. ATTACHMENT BUTTON
   ========================================================= */

.attachment-btn {
    width: 40px;
    height: 40px;

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

    border: none;
    border-radius: 10px;

    background: transparent;

    color: #a3a3ad;

    font-size: 22px;

    cursor: pointer;

    flex-shrink: 0;
}

.attachment-btn:hover {
    background: #292930;

    color: #ffffff;
}


/* =========================================================
   25. TEXT INPUT
   ========================================================= */

#userInput {
    flex: 1;

    min-width: 0;

    min-height: 40px;
    max-height: 180px;

    padding: 10px 8px;

    resize: none;

    border: none;
    outline: none;

    background: transparent;

    color: #ffffff;

    font-family: inherit;

    font-size: 15px;

    line-height: 1.45;

    overflow-y: auto;
}

#userInput::placeholder {
    color: #777780;
}


/* =========================================================
   26. SEND BUTTON
   ========================================================= */

.send-btn {
    width: 40px;
    height: 40px;

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

    border: none;
    border-radius: 10px;

    background: linear-gradient(135deg, #00e5ff, #39ff8c);

    color: #06110d;

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

    cursor: pointer;

    flex-shrink: 0;

    transition:
        opacity 0.2s ease,
        transform 0.1s ease,
        box-shadow 0.2s ease;
}

.send-btn:hover {
    opacity: 0.92;
    box-shadow: 0 0 14px rgba(0, 229, 255, 0.4);
}

.send-btn:active {
    transform: scale(0.95);
}

.send-btn:disabled {
    opacity: 0.45;

    cursor: not-allowed;
}


/* =========================================================
   27. ATTACHMENT MENU
   ========================================================= */

.attachment-menu {
    position: absolute;

    left: 8px;
    bottom: calc(100% + 8px);

    width: 190px;

    display: none;

    padding: 7px;

    background: #19191f;

    border: 1px solid #34343d;
    border-radius: 12px;

    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.45);

    z-index: 200;
}

.attachment-menu.show {
    display: block;
}

.attachment-option {
    width: 100%;

    display: flex;
    align-items: center;

    gap: 10px;

    padding: 10px 11px;

    border: none;
    border-radius: 8px;

    background: transparent;

    color: #ddddE3;

    text-align: left;

    font-size: 13px;

    cursor: pointer;
}

.attachment-option:hover {
    background: #292930;

    color: #ffffff;
}


/* =========================================================
   28. UPLOAD STATUS
   ========================================================= */

.upload-status {
    min-height: 0;

    margin-top: 7px;

    text-align: center;

    font-size: 12px;
}

.upload-status.loading {
    color: #aaaab4;
}

.upload-status.success {
    color: #75dfa1;
}

.upload-status.error {
    color: #ff7474;
}


/* =========================================================
   29. HISTORY SECTION
   ========================================================= */

#historySection {
    padding: 24px;

    overflow-y: auto;
}

.history-list {
    display: flex;
    flex-direction: column;

    gap: 8px;
}


/* =========================================================
   30. HISTORY ITEM
   ========================================================= */

.history-item {
    display: flex;
    align-items: center;

    gap: 15px;

    padding: 15px;

    background: #15151a;

    border: 1px solid #292930;
    border-radius: 12px;

    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}

.history-item:hover {
    background: #1b1b21;

    border-color: #3a3a43;
}

.history-item-main {
    min-width: 0;

    flex: 1;
}

.history-title {
    color: #eeeeF2;

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

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

.history-date {
    margin-top: 5px;

    color: #777780;

    font-size: 11px;
}

.history-open-btn {
    padding: 8px 12px;

    border: 1px solid #35353e;
    border-radius: 8px;

    background: #202027;

    color: #ddddE3;

    font-size: 12px;

    cursor: pointer;

    flex-shrink: 0;
}

.history-open-btn:hover {
    background: #2b2b33;
}


/* =========================================================
   31. EMPTY STATE
   ========================================================= */

.empty-state {
    padding: 60px 20px;

    text-align: center;
}

.empty-icon {
    margin-bottom: 14px;

    font-size: 36px;
}

.empty-state h3 {
    margin-bottom: 7px;

    font-size: 18px;
}

.empty-state p {
    color: #777780;

    font-size: 13px;
}


/* =========================================================
   32. DANGER BUTTON
   ========================================================= */

.danger-btn {
    padding: 10px 14px;

    border: 1px solid #572d2d;
    border-radius: 9px;

    background: #261719;

    color: #ff8585;

    font-size: 13px;

    cursor: pointer;

    flex-shrink: 0;
}

.danger-btn:hover {
    background: #351d1f;
}


/* =========================================================
   33. DOCUMENTS / VISION / HARDWARE / SETTINGS
   ========================================================= */

#documentsSection,
#visionSection,
#hardwareSection,
#settingsSection {
    padding: 28px;

    overflow-y: auto;
}

.documents-container {
    width: 100%;
    max-width: 1000px;

    margin: 0 auto;
}


/* =========================================================
   33b. SECTION HEADER
   (title + optional action button, used by every
   non-chat section: History, Documents, Vision,
   Hardware, Settings)
   ========================================================= */

.section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 16px;

    flex-wrap: wrap;

    max-width: 1000px;
    margin: 0 auto 22px;
}

.section-header h2 {
    margin-bottom: 6px;

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

    color: #f4f4f6;
}

.section-header p {
    color: #85858e;

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


/* =========================================================
   34. PRIMARY BUTTON
   ========================================================= */

.primary-btn {
    padding: 11px 16px;

    border: none;
    border-radius: 9px;

    background: #ffffff;

    color: #111111;

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

    cursor: pointer;

    flex-shrink: 0;
}

.primary-btn:hover {
    opacity: 0.9;
}


/* =========================================================
   35. MOBILE RESPONSIVE
   ========================================================= */

@media (max-width: 768px) {

    html,
    body {
        width: 100%;
        height: 100%;

        overflow: hidden;
    }


    /* -----------------------------------------------------
       APP
       ----------------------------------------------------- */

    #appShell {
        width: 100%;
        height: 100dvh;

        min-height: 100dvh;

        overflow: hidden;
    }


    /* -----------------------------------------------------
       MOBILE SIDEBAR
       ----------------------------------------------------- */

    .sidebar {
        position: fixed;

        top: 0;
        left: 0;

        width: 280px;
        max-width: 82vw;

        height: 100dvh;

        z-index: 1000;

        transform: translateX(-100%);

        transition:
            transform 0.25s ease;

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

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


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


    /* -----------------------------------------------------
       DARK OVERLAY
       (shown/hidden via the real .sidebar-overlay element,
       not a ::after pseudo-element, so it can be clicked)
       ----------------------------------------------------- */

    body.sidebar-open .sidebar-overlay {
        display: block;
    }


    /* -----------------------------------------------------
       MAIN CONTENT
       ----------------------------------------------------- */

    .main-content {
        width: 100%;

        min-width: 0;

        height: 100dvh;

        overflow: hidden;
    }


    /* -----------------------------------------------------
       TOPBAR
       ----------------------------------------------------- */

    .topbar {
        width: 100%;

        min-height: 68px;

        padding: 12px 14px;

        flex-shrink: 0;
    }


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


    #pageTitle {
        font-size: 19px;
    }


    #pageSubtitle {
        font-size: 12px;
    }


    /* -----------------------------------------------------
       CHAT SECTION
       ----------------------------------------------------- */

    #chatSection {
        width: 100%;

        height: calc(100dvh - 68px);

        min-height: 0;

        display: flex;
        flex-direction: column;

        position: relative;

        overflow: hidden;
    }


    /* -----------------------------------------------------
       CHATBOX
       ----------------------------------------------------- */

    #chatbox {
        width: 100%;

        flex: 1;

        min-height: 0;

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

        padding:
            18px
            12px
            125px;
    }


    /* -----------------------------------------------------
       WELCOME
       ----------------------------------------------------- */

    .welcome-message {
        width: 100%;

        min-height: 60vh;

        padding:
            25px
            12px
            40px;
    }


    .welcome-icon {
        width: 82px;
        height: 82px;

        margin-bottom: 22px;

        border-radius: 19px;

        font-size: 40px;
    }


    .welcome-message h2 {
        font-size: 28px;

        line-height: 1.2;

        margin-bottom: 12px;
    }


    .welcome-message p {
        max-width: 360px;

        font-size: 15px;

        line-height: 1.55;
    }


    /* -----------------------------------------------------
       MESSAGES
       ----------------------------------------------------- */

    .message {
        margin-bottom: 14px;
    }


    .user-message {
        padding-left: 8%;
    }


    .ai-message {
        padding-right: 8%;
    }


    .user-message .message-content,
    .ai-message .message-content {
        max-width: 88%;

        font-size: 15px;

        padding: 10px 13px;
    }


    /* -----------------------------------------------------
       COMPOSER
       ----------------------------------------------------- */

    .composer-container {
        position: absolute;

        left: 0;
        right: 0;
        bottom: 0;

        transform: none;

        width: 100%;

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

        z-index: 100;
    }


    .composer-box {
        width: 100%;

        padding: 7px;

        border-radius: 15px;
    }


    .attachment-btn,
    .send-btn {
        width: 40px;
        height: 40px;

        flex-shrink: 0;
    }


    #userInput {
        min-height: 40px;

        max-height: 120px;

        padding:
            9px
            5px;

        font-size: 16px;
    }


    /* -----------------------------------------------------
       ATTACHMENT MENU
       ----------------------------------------------------- */

    .attachment-menu {
        left: 8px;

        bottom: calc(100% + 8px);

        width: 185px;
    }


    /* -----------------------------------------------------
       HISTORY
       ----------------------------------------------------- */

    #historySection {
        padding: 16px 12px;

        overflow-y: auto;
    }


    .history-item {
        padding: 13px;

        gap: 10px;
    }


    .history-title {
        font-size: 13px;
    }


    .history-date {
        font-size: 10px;
    }


    .history-open-btn {
        padding: 7px 10px;

        flex-shrink: 0;
    }


    /* -----------------------------------------------------
       OTHER SECTIONS
       ----------------------------------------------------- */

    #documentsSection,
    #visionSection,
    #hardwareSection,
    #settingsSection {
        padding: 20px 14px;

        overflow-y: auto;
    }


    .section-header h2 {
        font-size: 19px;
    }


    /* -----------------------------------------------------
       SIDEBAR BRAND
       ----------------------------------------------------- */

    .brand {
        padding: 18px 16px;
    }


    .new-chat-btn {
        margin:
            14px
            12px
            10px;
    }


    /* -----------------------------------------------------
       AUTH MOBILE
       ----------------------------------------------------- */

    .auth-screen {
        align-items: flex-start;

        padding:
            25px
            16px;

        padding-top:
            max(
                25px,
                env(safe-area-inset-top)
            );
    }


    .auth-card {
        max-width: 100%;

        margin-top: 30px;

        padding: 25px 20px;

        border-radius: 16px;
    }


    .auth-title {
        font-size: 25px;
    }

}


/* =========================================================
   36. VERY SMALL PHONES
   ========================================================= */

@media (max-width: 390px) {

    .sidebar {
        width: 270px;
    }


    .topbar {
        padding-left: 10px;
        padding-right: 10px;
    }


    #pageTitle {
        font-size: 18px;
    }


    #pageSubtitle {
        font-size: 11px;
    }


    .welcome-message h2 {
        font-size: 25px;
    }


    .welcome-message p {
        font-size: 14px;
    }


    .user-message .message-content,
    .ai-message .message-content {
        max-width: 92%;

        font-size: 14px;
    }


    .composer-container {
        padding-left: 7px;
        padding-right: 7px;
    }

}


/* =========================================================
   37. LANDSCAPE MOBILE
   ========================================================= */

@media (max-width: 900px) and (orientation: landscape) {

    .topbar {
        min-height: 58px;

        padding-top: 8px;
        padding-bottom: 8px;
    }


    #chatSection {
        height: calc(100dvh - 58px);
    }


    .welcome-message {
        min-height: 100%;

        padding-top: 20px;
        padding-bottom: 90px;
    }


    .welcome-icon {
        width: 60px;
        height: 60px;

        font-size: 30px;

        margin-bottom: 12px;
    }


    .welcome-message h2 {
        font-size: 23px;
    }


    .welcome-message p {
        font-size: 13px;
    }


    #chatbox {
        padding-bottom: 105px;
    }

}


/* =========================================================
   38. REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;

        transition: none !important;

        animation: none !important;
    }

}
