:root {
    --bg: #f9f9f9;
    --panel: #ffffff;
    --text: #202123;
    --accent: #10a37f;
    --border: #e5e5e5;
    --ai-msg: #f7f7f8;
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, system-ui, sans-serif;
    background: var(--bg);
    margin: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

#app-container {
    width: 100%;
    max-width: 800px;
    height: 100%;
    margin: auto;
    background: var(--panel);
    display: flex;
    flex-direction: column;
    position: relative;
}

header {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: #6e6e80;
    font-weight: 600;
}

#chat {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.msg {
    max-width: 90%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
}

.user {
    align-self: flex-end;
    background: var(--accent);
    color: white;
    border-bottom-right-radius: 4px;
}

.ai {
    align-self: flex-start;
    background: var(--ai-msg);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

#input-container {
    padding: 15px;
    background: #fff;
    border-top: 1px solid var(--border);
}

.ai-tools {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.tool-btn {
    white-space: nowrap;
    background: #f0f0f0;
    border: 1px solid var(--border);
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 11px;
    cursor: pointer;
}

.input-wrapper {
    display: flex;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--border);
    padding: 6px 10px;
    border-radius: 20px;
}

input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px; /* Предотвращает зум на iPhone */
}

button#send-btn {
    background: var(--accent);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: bold;
    cursor: pointer;
}