* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    font-family: Arial, sans-serif;
    background:
        radial-gradient(
            circle at center,
            rgba(190, 220, 200, 0.45),
            transparent 35%
        ),
        #fcf6f7;
    color: #1f1f1f;
}

button,
input {
    font: inherit;
}

button,
a {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

a {
    color: inherit;
    text-decoration: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.app-layout {
    min-height: 100vh;
    min-height: 100dvh;
}

.sidebar {
    display: none;
}

.chat-main {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 1.5rem 1rem;
}

.chat-start {
    display: flex;
    min-height: 75vh;
    min-height: 75dvh;
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
    max-width: 48rem;
    margin: 0 auto;
}

.chat-header {
    text-align: center;
}

.chat-header h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 500;
    line-height: 1.2;
}

.chat-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: #ffffff;
    border-radius: 9999px;
    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.08);
}

.chat-form:focus-within {
    box-shadow:
        0 0 0 2px rgba(63, 122, 94, 0.2),
        0 12px 30px rgba(0, 0, 0, 0.08);
}

.chat-form input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
}

.chat-form input:disabled {
    cursor: not-allowed;
    color: #666666;
    opacity: 1;
}

.chat-form input:disabled::placeholder {
    color: #777777;
}

.chat-form button {
    border: 0;
    background: transparent;
}

.chat-error {
    margin: 0;
    text-align: center;
}

.auth-guide {
    text-align: center;
}

.auth-guide nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.conversation {
    display: grid;
    gap: 1rem;
    max-width: 48rem;
    margin: 0 auto 2rem;
}

.message {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.88);
    border-radius: 1rem;
}

.message h2,
.message p {
    margin: 0;
}

.message p {
    margin-top: 0.5rem;
}

.auth-guide p {
    margin: 0 0 1rem;
}

.auth-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

.auth-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 6rem;
    padding: 0.625rem 1rem;

    border-radius: 9999px;

    font-size: 0.875rem;
    font-weight: 600;
}

.auth-action--primary {
    background: #3f7a5e;
    color: #ffffff;
}

.auth-action--primary:hover {
    background: #35694f;
}

.auth-action--secondary {
    border: 1px solid rgba(63, 122, 94, 0.2);
    background: rgba(255, 255, 255, 0.72);
    color: #3f7a5e;
}

.auth-action--secondary:hover {
    background: rgba(63, 122, 94, 0.08);
}

@media (min-width: 768px) {
    .app-layout {
        display: grid;
        grid-template-columns: 8rem 1fr;
    }

    .sidebar {
        display: flex;
        position: sticky;
        top: 0;
        height: 100vh;
        height: 100dvh;
        padding: 1rem 0.75rem;
        flex-direction: column;
        justify-content: space-between;
        align-items: center;
    }

    .sidebar-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    }

    .sidebar-header {
        width: 100%;
    }

    .sidebar-brand {
        display: inline-flex;
        align-items: center;
        justify-content: center;

        width: 100%;
        padding: 0.5rem 0.75rem;

        border: 1px solid rgba(63, 122, 94, 0.14);
        border-radius: 9999px;

        background: rgba(255, 255, 255, 0.65);
        color: #3f7a5e;

        font-size: 0.875rem;
        font-weight: 600;
        white-space: nowrap;
    }

    .sidebar-brand:hover {
        background: rgba(255, 255, 255, 0.9);
    }

    .sidebar-nav {
        width: 100%;
    }

    .sidebar-new-chat {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    padding: 0.625rem 0.75rem;

    border-radius: 0.75rem;

    color: #1f1f1f;
    font-size: 0.875rem;
    font-weight: 500;
    }

    .sidebar-new-chat:hover {
        background: rgba(63, 122, 94, 0.08);
    }

    .sidebar-footer {
        width: 100%;
    }

    .sidebar-footer form {
    width: 100%;
    }

    .sidebar-auth-button {
        display: flex;
        align-items: center;
        justify-content: center;

        width: 100%;
        padding: 0.625rem 0.75rem;

        border: 1px solid rgba(63, 122, 94, 0.18);
        border-radius: 9999px;

        background: rgba(255, 255, 255, 0.7);
        color: #3f7a5e;

        font-size: 0.875rem;
        font-weight: 600;
    }

    button.sidebar-auth-button {
        cursor: pointer;
    }

    .sidebar-auth-button:hover {
        background: rgba(63, 122, 94, 0.1);
    }

    .chat-header h1 {
        font-size: 3rem;
    }
}
