:root {
    --bg: #f3f1eb;
    --surface: #fffcf7;
    --ink: #1a231c;
    --muted: #445248;
    --line: #cfc9ba;
    --accent: #1c4a38;
    --accent-hover: #143528;
    --user: #e7eee9;
    --bot: #ffffff;
    --focus: #0b57d0;
    --danger: #7f1d1d;
    --font: "Segoe UI", "Liberation Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.45;
}

a { color: var(--accent); }

a:focus, button:focus, textarea:focus {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    left: -999px;
}
.skip-link:focus {
    left: 8px;
    top: 8px;
    background: #fff;
    padding: 8px;
    z-index: 2;
}

.beabot {
    height: 100%;
    min-height: 650px;
    max-height: 750px;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
}

.beabot-header, .beabot-footer, .welcome, .examples, .composer, .status-line {
    padding: 10px 14px;
}

.beabot-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--line);
    align-items: baseline;
}

.eyebrow {
    margin: 0;
    color: var(--muted);
    font-size: 0.85rem;
}

h1 {
    margin: 0;
    font-size: 1.25rem;
}

.contact {
    margin: 0;
    font-size: 0.9rem;
}

.welcome, .beabot-footer p {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.examples {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.examples button, .secondary {
    background: #fff;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 4px;
    font: inherit;
    padding: 6px 10px;
    cursor: pointer;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 8px 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
}

.bubble {
    max-width: 92%;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid var(--line);
}

.bubble.user {
    align-self: flex-end;
    background: var(--user);
}

.bubble.bot {
    align-self: flex-start;
    background: var(--bot);
}

.bubble .who {
    display: block;
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 4px;
}

.sources {
    margin: 8px 0 0;
    padding-left: 18px;
    font-size: 0.88rem;
}

.status-line {
    color: var(--muted);
    font-size: 0.9rem;
}

.composer {
    border-top: 1px solid var(--line);
}

textarea {
    width: 100%;
    resize: none;
    font: inherit;
    padding: 8px 10px;
    border: 1px solid #667066;
    border-radius: 4px;
    background: #fff;
}

.actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

#enviar {
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: 4px;
    font: inherit;
    font-weight: 600;
    padding: 8px 14px;
    cursor: pointer;
}

#enviar:hover { background: var(--accent-hover); }
#enviar:disabled, .examples button:disabled { opacity: 0.6; cursor: not-allowed; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.beabot-footer {
    border-top: 1px solid var(--line);
}

@media (max-width: 640px) {
    html { font-size: 15px; }
    .beabot { max-height: none; }
}
