@import url('https://fonts.googleapis.com/css2?family=Varela+Round&display=swap');

body {
    margin: 0;
    min-height: 100vh;
    background: #ffffff;
    color: #111;
    font-family: "Varela Round", sans-serif;
}

.back-button {
    position: fixed;
    top: 16px;
    left: 16px;
    text-decoration: none;
    font-size: 1.25rem;
    padding: 0.9rem 1.8rem;
    border-radius: 0.75rem;
    background: #ffffff;
    color: #111;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.back-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
    background: #f7f7f7;
}

.back-button:active {
    transform: translateY(0);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
}

.back-button:focus-visible {
    outline: 3px solid rgba(17, 17, 17, 0.3);
    outline-offset: 3px;
}

.chat-shell {
    max-width: 900px;
    margin: 0 auto;
    padding: 5rem 1.5rem 3rem;
}

h1 {
    text-align: center;
    font-size: 2.5rem;
    margin: 0 0 0.5rem;
}

.subtitle {
    text-align: center;
    margin: 0 0 2rem;
    font-size: 1.1rem;
    color: rgba(0, 0, 0, 0.6);
}

.chat-log {
    background: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
    padding: 1.2rem;
    min-height: 360px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.message {
    max-width: 75%;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    line-height: 1.4;
    word-break: break-word;
}

.message.user {
    align-self: flex-end;
    background: #111;
    color: #fff;
}

.message.ai {
    align-self: flex-start;
    background: #f5f5f5;
    color: #111;
}

.message.system {
    align-self: center;
    background: #fff4d6;
    color: #6b4e00;
    font-size: 0.95rem;
}

.chat-form {
    margin-top: 1.2rem;
    display: flex;
    gap: 0.75rem;
}

#chat-input {
    flex: 1;
    padding: 0.9rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.15);
    font-size: 1rem;
    font-family: "Varela Round", sans-serif;
}

#chat-input:focus-visible {
    outline: 3px solid rgba(17, 17, 17, 0.2);
    outline-offset: 2px;
}

#send-button {
    padding: 0.9rem 1.6rem;
    border-radius: 0.75rem;
    border: 0;
    background: #111;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

#send-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
}

#send-button:active {
    transform: translateY(0);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
}

#send-button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

.footnote {
    text-align: center;
    margin-top: 1.5rem;
    color: rgba(0, 0, 0, 0.5);
    font-size: 0.9rem;
}

@media (max-width: 700px) {
    .chat-form {
        flex-direction: column;
    }

    #send-button {
        width: 100%;
    }

    .message {
        max-width: 100%;
    }
}
