* {
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    margin: 0;
    background: #f3f5f7;
}

.app {
    max-width: 900px;
    height: 100vh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #dcdcdc;
}

.header {
    background: #0b7f86;
    color: #fff;
    padding: 12px 16px;
}

.header .title {
    font-weight: 600;
}

.header .subtitle {
    font-size: 13px;
    opacity: 0.9;
}

.chat {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.message {
    max-width: 75%;
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    line-height: 1.4;
    white-space: pre-wrap;
}

.user {
    background: #e6f2ff;
    align-self: flex-end;
}

.assistant {
    background: #eef7e8;
    align-self: flex-start;
}

.input {
    display: flex;
    padding: 12px;
    border-top: 1px solid #ddd;
    gap: 8px;
}

.input input {
    flex: 1;
    padding: 10px;
    font-size: 14px;
}

.input button {
    background: #0b7f86;
    color: #fff;
    border: none;
    padding: 0 18px;
    cursor: pointer;
    font-weight: 600;
}

.input button:hover {
    opacity: 0.9;
}

/* Индикатор загрузки */
.message.loading {
    background: #eef7e8;
    min-height: 40px;
    display: flex;
    align-items: center;
}

.loading-dots {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.loading-dots span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #0b7f86;
    animation: loading-bounce 1.4s infinite ease-in-out;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0;
}

@keyframes loading-bounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Блокировка input во время загрузки */
.input input:disabled,
.input button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.input button:disabled {
    background: #6b9ba0;
}
