/* =========================================================
   KAELIZ AI
   ========================================================= */


:root {

    --black: #000000;

    --panel: #090909;

    --panel-hover: #101010;

    --border: #1d1d1d;

    --border-light: #252525;

    --text: #eeeeee;

    --text-secondary: #bdbdbd;

    --muted: #666666;

    --user: #151515;

    --chat-width: 820px;

}


/* =========================================================
   RESET
   ========================================================= */


*,
*::before,
*::after {

    box-sizing: border-box;

}


html,
body {

    width: 100%;
    height: 100%;

    margin: 0;

    padding: 0;

    background: #000000;

}


body {

    overflow: hidden;

    color: var(--text);

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

    -webkit-font-smoothing: antialiased;

}


/* =========================================================
   APP
   ========================================================= */


#app {

    width: 100%;
    height: 100dvh;

    display: flex;

    flex-direction: column;

    background: #000000;

    overflow: hidden;

}


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


.topbar {

    width: 100%;

    height: 58px;

    flex: 0 0 58px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: 0 20px;

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

    background: #000000;

}


.brand {

    display: flex;

    align-items: center;

    gap: 10px;

}


.brand-icon {

    width: 30px;

    height: 30px;

    display: grid;

    place-items: center;

    border-radius: 9px;

    background: #0b0b0b;

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

}


.brand-icon svg {

    width: 18px;

    height: 18px;

    fill: none;

    stroke: #eeeeee;

    stroke-width: 2.5;

    stroke-linecap: round;

    stroke-linejoin: round;

}


.brand-title {

    font-size: 14px;

    font-weight: 650;

    color: #eeeeee;

}


.online {

    display: flex;

    align-items: center;

    gap: 6px;

    color: #5d5d5d;

    font-size: 11px;

}


.online span {

    width: 6px;

    height: 6px;

    border-radius: 50%;

    background: #777777;

}


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


#chat {

    width: 100%;

    max-width: var(--chat-width);

    flex: 1;

    margin: 0 auto;

    padding:
        30px
        20px
        155px;

    overflow-x: hidden;

    overflow-y: auto;

    scrollbar-width: thin;

    scrollbar-color:
        #242424
        transparent;

}


#chat::-webkit-scrollbar {

    width: 6px;

}


#chat::-webkit-scrollbar-track {

    background: transparent;

}


#chat::-webkit-scrollbar-thumb {

    background: #242424;

    border-radius: 99px;

}


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


.welcome {

    width: 100%;

    min-height: 100%;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    padding-bottom: 50px;

    text-align: center;

}


.welcome-icon {

    width: 58px;

    height: 58px;

    display: grid;

    place-items: center;

    margin-bottom: 18px;

    border-radius: 17px;

    background: #090909;

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

}


.welcome-icon svg {

    width: 28px;

    height: 28px;

    fill: none;

    stroke: #eeeeee;

    stroke-width: 2.2;

    stroke-linecap: round;

    stroke-linejoin: round;

}


.welcome h1 {

    margin: 0;

    font-size: 25px;

    line-height: 1.25;

    font-weight: 650;

    letter-spacing: -0.8px;

}


.welcome p {

    margin: 9px 0 0;

    color: #5e5e5e;

    font-size: 13px;

}


/* =========================================================
   MESSAGE — COMMON
   ========================================================= */


.message {

    width: 100%;

    display: flex;

    margin-bottom: 28px;

}


.message-inner {

    min-width: 0;

}


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


.message.assistant {

    justify-content: flex-start;

}


.message.assistant .message-inner {

    width: 100%;

    display: grid;

    grid-template-columns: 30px minmax(0, 1fr);

    column-gap: 11px;

}


.message.assistant .avatar {

    width: 30px;

    height: 30px;

    display: grid;

    place-items: center;

    border-radius: 9px;

    background: #0b0b0b;

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

    color: #dddddd;

    font-size: 10px;

    font-weight: 700;

}


.message.assistant .message-content {

    min-width: 0;

    width: 100%;

}


.message.assistant .name {

    margin: 1px 0 6px;

    color: #c8c8c8;

    font-size: 12px;

    line-height: 1.2;

    font-weight: 650;

}


.message.assistant .text {

    width: 100%;

    color: #d0d0d0;

    font-size: 14px;

    line-height: 1.65;

    white-space: pre-wrap;

    overflow-wrap: anywhere;

}


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


.message.user {

    justify-content: flex-end;

}


.message.user .message-inner {

    /*
       IMPORTANT:
       The container itself does NOT fill the row.
    */

    display: block;

    width: fit-content;

    max-width: 54%;

}


.message.user .message-content {

    width: fit-content;

    max-width: 100%;

}


.message.user .avatar,
.message.user .name {

    display: none;

}


.message.user .text {

    display: block;

    width: fit-content;

    max-width: 100%;

    padding:
        8px
        12px;

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

    border-radius:
        14px
        14px
        4px
        14px;

    background: var(--user);

    color: #eeeeee;

    font-size: 14px;

    line-height: 1.5;

    white-space: pre-wrap;

    overflow-wrap: anywhere;

}


/* =========================================================
   TYPING
   ========================================================= */


.typing-cursor {

    display: inline-block;

    width: 2px;

    height: 15px;

    margin-left: 3px;

    vertical-align: -2px;

    background: #dddddd;

    animation:
        blink 850ms steps(1) infinite;

}


@keyframes blink {

    0%,
    45% {

        opacity: 1;

    }

    46%,
    100% {

        opacity: 0;

    }

}


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


.composer-wrapper {

    position: fixed;

    left: 0;

    right: 0;

    bottom: 0;

    width: 100%;

    padding:
        0
        20px
        max(15px, env(safe-area-inset-bottom));

    background:
        linear-gradient(
            to bottom,
            transparent,
            #000000 28px,
            #000000 100%
        );

    pointer-events: none;

}


.composer-container {

    width: 100%;

    max-width: var(--chat-width);

    margin: 0 auto;

    padding-top: 14px;

    pointer-events: auto;

}


.disclaimer {

    width: 100%;

    margin-bottom: 7px;

    color: #505050;

    font-size: 10px;

    line-height: 1.4;

    text-align: center;

}


.composer {

    width: 100%;

    display: flex;

    align-items: flex-end;

    gap: 7px;

    padding: 7px;

    background: #090909;

    border: 1px solid #202020;

    border-radius: 16px;

}


.composer:focus-within {

    border-color: #2a2a2a;

}


textarea {

    width: 100%;

    min-width: 0;

    min-height: 40px;

    max-height: 145px;

    margin: 0;

    padding:
        10px
        9px;

    resize: none;

    border: 0;

    outline: 0;

    background: transparent;

    color: #eeeeee;

    font-size: 14px;

    line-height: 1.45;

    overflow-y: auto;

    scrollbar-width: none;

}


textarea::-webkit-scrollbar {

    display: none;

}


textarea::placeholder {

    color: #5d5d5d;

}


#send {

    width: 39px;

    height: 39px;

    flex: 0 0 39px;

    display: grid;

    place-items: center;

    padding: 0;

    border: 0;

    border-radius: 11px;

    background: #eeeeee;

    color: #050505;

    cursor: pointer;

    transition:
        transform 120ms ease,
        background 120ms ease,
        opacity 120ms ease;

}


#send svg {

    width: 16px;

    height: 16px;

}


#send:hover {

    background: #ffffff;

    transform: translateY(-1px);

}


#send:active {

    transform: scale(0.94);

}


#send:disabled {

    opacity: 0.3;

    transform: none;

    cursor: default;

}


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


@media (max-width: 600px) {

    .topbar {

        height: 54px;

        flex-basis: 54px;

        padding: 0 13px;

    }


    #chat {

        padding:
            22px
            12px
            145px;

        scrollbar-width: none;

    }


    #chat::-webkit-scrollbar {

        display: none;

    }


    .welcome h1 {

        font-size: 22px;

    }


    .welcome p {

        max-width: 280px;

        font-size: 12px;

    }


    .message {

        margin-bottom: 22px;

    }


    .message.assistant .message-inner {

        grid-template-columns:
            27px
            minmax(0, 1fr);

        column-gap: 8px;

    }


    .message.assistant .avatar {

        width: 27px;

        height: 27px;

    }


    .message.assistant .text,
    .message.user .text {

        font-size: 14px;

    }


    .message.user .message-inner {

        max-width: 72%;

    }


    .message.user .text {

        padding:
            8px
            11px;

    }


    .composer-wrapper {

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

    }


    .composer-container {

        padding-top: 11px;

    }


    .disclaimer {

        font-size: 9px;

        margin-bottom: 6px;

    }


    .composer {

        padding: 6px;

        border-radius: 15px;

    }


    #send {

        width: 38px;

        height: 38px;

        flex-basis: 38px;

    }

}