* {
    box-sizing: border-box;
}

:root {
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    color-scheme: light;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #f4f5f7;
    color: #17191d;
}

button,
input,
textarea {
    font: inherit;
}

.hidden {
    display: none !important;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(420px, 100%);
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    padding: 34px;
    box-shadow:
        0 16px 50px
        rgba(0,0,0,.07);
}

.brand {
    font-size: 27px;
    font-weight: 700;
    letter-spacing: -.6px;
}

.subtitle {
    margin-top: 8px;
    margin-bottom: 28px;
    color: #6b7280;
    line-height: 1.5;
}

.field {
    margin-top: 15px;
}

.field label {
    display: block;
    margin-bottom: 7px;
    font-size: 14px;
    font-weight: 600;
}

.field input {
    width: 100%;
    height: 48px;
    border: 1px solid #d7dbe2;
    border-radius: 12px;
    padding: 0 14px;
    outline: none;
    background: #fff;
}

.field input:focus {
    border-color: #111827;
}

.primary-button {
    width: 100%;
    height: 49px;
    margin-top: 22px;
    border: 0;
    border-radius: 12px;
    background: #15171b;
    color: #fff;
    cursor: pointer;
    font-weight: 650;
}

.primary-button:disabled {
    opacity: .55;
    cursor: default;
}

.error {
    min-height: 20px;
    margin-top: 13px;
    color: #b42318;
    font-size: 14px;
}

.app {
    height: 100vh;
    display: grid;
    grid-template-rows: 66px 1fr;
}

.header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.header-brand {
    font-size: 20px;
    font-weight: 720;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-name {
    color: #6b7280;
    font-size: 14px;
}

.secondary-button {
    border: 1px solid #d9dde4;
    background: #fff;
    border-radius: 10px;
    min-height: 38px;
    padding: 0 13px;
    cursor: pointer;
}

.workspace {
    min-height: 0;
    display: grid;
    grid-template-columns: 260px 1fr;
}

.sidebar {
    background: #fafafa;
    border-right: 1px solid #e5e7eb;
    padding: 18px;
}

.sidebar-title {
    font-size: 12px;
    color: #818793;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 13px;
}

.sidebar-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 13px;
    padding: 13px;
    font-size: 14px;
    line-height: 1.45;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #17a673;
    margin-right: 7px;
}

.clear-button {
    width: 100%;
    margin-top: 12px;
}

.chat-panel {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: 1fr auto;
}

.messages {
    overflow-y: auto;
    padding: 32px max(
        24px,
        calc((100% - 900px) / 2)
    );
}

.empty {
    max-width: 720px;
    margin: 13vh auto 0;
    text-align: center;
}

.empty h1 {
    margin: 0;
    font-size: 35px;
    letter-spacing: -1px;
}

.empty p {
    color: #707782;
    font-size: 17px;
    line-height: 1.55;
}

.examples {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 28px;
    text-align: left;
}

.example {
    border: 1px solid #e0e3e8;
    background: #fff;
    border-radius: 13px;
    padding: 14px;
    cursor: pointer;
    line-height: 1.4;
}

.message {
    max-width: 900px;
    margin: 0 auto 18px;
    display: flex;
}

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

.bubble {
    max-width: 82%;
    border-radius: 16px;
    padding: 13px 16px;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.user .bubble {
    background: #17191d;
    color: #fff;
}

.assistant .bubble {
    background: #fff;
    border: 1px solid #e1e4e8;
}

.composer-wrap {
    padding:
        14px
        max(
            24px,
            calc((100% - 900px) / 2)
        )
        24px;

    background:
        linear-gradient(
            to top,
            #f4f5f7 75%,
            rgba(244,245,247,0)
        );
}

.composer {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 10px;
    background: #fff;
    border: 1px solid #d9dde4;
    border-radius: 17px;
    padding: 10px;
    box-shadow:
        0 10px 30px
        rgba(0,0,0,.05);
}

.composer textarea {
    border: 0;
    outline: 0;
    resize: none;
    min-height: 42px;
    max-height: 160px;
    padding: 10px;
    line-height: 1.45;
}

.send {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: #17191d;
    color: #fff;
    cursor: pointer;
    font-size: 20px;
}

.send:disabled {
    opacity: .45;
}

.typing {
    opacity: .65;
}

@media (max-width: 760px) {
    .workspace {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .header {
        padding: 0 15px;
    }

    .messages {
        padding: 22px 14px;
    }

    .composer-wrap {
        padding: 10px 14px 16px;
    }

    .bubble {
        max-width: 92%;
    }

    .examples {
        grid-template-columns: 1fr;
    }

    .empty {
        margin-top: 6vh;
    }

    .empty h1 {
        font-size: 28px;
    }
}
