
:root {
    --green: #173c32;
    --green-light: #eaf4ef;
    --green-hover: #245748;
    --background: #f4f7f5;
    --text: #202a26;
    --muted: #748078;
    --border: #e4e9e5;
    --white: #ffffff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, #e3f0e8, transparent 40%),
        var(--background);
    -webkit-font-smoothing: antialiased;
}

button,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.app {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 36px 20px 24px;
}

.chat-card {
    display: flex;
    flex-direction: column;
    height: min(780px, calc(100vh - 100px));
    min-height: 500px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 18px 60px rgba(23, 60, 50, 0.09);
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 26px;
    color: var(--white);
    background: var(--green);
}

.brand {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
}

.brand-logo {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    color: var(--green);
    background: white;
    border-radius: 14px;
    font-size: 25px;
    font-weight: 800;
}

.brand h1 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.brand p {
    margin: 5px 0 0;
    color: #d1e1d9;
    font-size: 13px;
}

.online-status {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    padding: 9px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    font-size: 12px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #79e0a4;
    box-shadow: 0 0 0 3px rgba(121, 224, 164, 0.13);
}

.welcome-banner {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 22px 24px 12px;
    padding: 19px;
    border: 1px solid #e1eee5;
    border-radius: 15px;
    background: linear-gradient(110deg, #f0f7f2, #f9fbf9);
}

.welcome-icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    color: white;
    background: var(--green);
    border-radius: 13px;
    font-size: 23px;
}

.welcome-banner h2 {
    margin: 0 0 6px;
    font-size: 16px;
}

.welcome-banner p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 22px 26px;
    scroll-behavior: smooth;
}

.message-row {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-bottom: 22px;
}

.avatar {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    color: var(--green);
    background: var(--green-light);
    font-size: 13px;
    font-weight: 700;
}

.message-content {
    max-width: min(78%, 590px);
    min-width: 0;
}

.sender {
    margin-bottom: 7px;
    color: #657169;
    font-size: 12px;
    font-weight: 600;
}

.bubble {
    padding: 13px 16px;
    border: 1px solid var(--border);
    border-radius: 4px 15px 15px 15px;
    background: #f7f9f7;
    color: var(--text);
    font-size: 14px;
    line-height: 1.7;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.message-time {
    display: block;
    margin-top: 6px;
    color: #99a19b;
    font-size: 10px;
}

.user-row {
    flex-direction: row-reverse;
}

.user-row .avatar {
    color: white;
    background: var(--green);
}

.user-row .message-content {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.user-row .bubble {
    color: white;
    background: var(--green);
    border-color: var(--green);
    border-radius: 15px 4px 15px 15px;
}

.user-row .sender {
    text-align: right;
}

.typing-dots {
    display: inline-flex;
    gap: 5px;
    align-items: center;
}

.typing-dots i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #87978d;
    animation: typing 1s infinite ease-in-out;
}

.typing-dots i:nth-child(2) {
    animation-delay: 0.15s;
}

.typing-dots i:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.35;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-4px);
    }
}

.suggestions {
    padding: 0 26px 17px;
}

.suggestions[hidden] {
    display: none;
}

.suggestions > p {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.suggestion-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.suggestion {
    padding: 9px 12px;
    border: 1px solid #dbe5de;
    border-radius: 20px;
    background: white;
    color: var(--green);
    font-size: 12px;
    transition: background 0.2s, border-color 0.2s;
}

.suggestion:hover {
    background: var(--green-light);
    border-color: #b7d3c0;
}

.chat-form {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin: 0 24px;
    padding: 10px;
    border: 1px solid #dce4de;
    border-radius: 16px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-form:focus-within {
    border-color: #7ca895;
    box-shadow: 0 0 0 3px rgba(23, 60, 50, 0.06);
}

.chat-form textarea {
    flex: 1;
    min-width: 0;
    max-height: 120px;
    min-height: 42px;
    padding: 12px 9px;
    border: none;
    outline: none;
    resize: none;
    color: var(--text);
    background: transparent;
    font-size: 14px;
    line-height: 1.5;
}

.chat-form textarea::placeholder {
    color: #9ba59e;
}

.send-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    flex-shrink: 0;
    min-height: 42px;
    padding: 0 17px;
    border: none;
    border-radius: 11px;
    background: var(--green);
    color: white;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
}

.send-button:hover {
    background: var(--green-hover);
}

.send-button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.send-button svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chat-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 26px 17px;
    color: #89948c;
    font-size: 10px;
}

.page-note {
    margin: 20px 0 0;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
}

.page-note a {
    color: var(--green);
    font-weight: 600;
    text-decoration: none;
}

.page-note a:hover {
    text-decoration: underline;
}

.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;
}

@media (max-width: 600px) {
    .app {
        padding: 0;
    }

    .chat-card {
        height: 100dvh;
        min-height: 460px;
        border: none;
        border-radius: 0;
    }

    .chat-header {
        padding: 17px 15px;
    }

    .brand-logo {
        width: 40px;
        height: 40px;
    }

    .brand h1 {
        font-size: 14px;
    }

    .online-status {
        padding: 8px;
        font-size: 10px;
    }

    .welcome-banner {
        margin: 14px 13px 6px;
        padding: 13px;
        gap: 10px;
    }

    .welcome-banner h2 {
        font-size: 14px;
    }

    .welcome-banner p {
        font-size: 12px;
    }

    .welcome-icon {
        width: 36px;
        height: 36px;
    }

    .messages {
        padding: 17px 13px;
    }

    .message-content {
        max-width: 85%;
    }

    .suggestions {
        padding: 0 13px 12px;
    }

    .suggestion-list {
        gap: 6px;
    }

    .suggestion {
        padding: 8px 10px;
        font-size: 11px;
    }

    .chat-form {
        margin: 0 12px;
        padding: 7px;
        gap: 5px;
    }

    .send-button {
        padding: 0 12px;
    }

    .chat-footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 5px;
        padding: 12px;
    }

    .page-note {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
