/**
 * In-site assistant chat (ALZAN UI; server calls OpenAI when configured).
 */

.assistant-inline-chat {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    font-family: var(--font-sans, Inter, system-ui, sans-serif);
}

.assistant-inline-chat-intro {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.55;
    color: rgba(244, 235, 224, 0.82);
}

.assistant-chat-setup-hint {
    margin: 0 0 8px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 0.76rem;
    line-height: 1.45;
    color: rgba(247, 230, 200, 0.88);
    border: 1px solid rgba(183, 148, 98, 0.35);
    background: rgba(0, 0, 0, 0.25);
}

.assistant-page .assistant-chat-setup-hint {
    color: rgba(17, 18, 15, 0.75);
    border-color: rgba(17, 18, 15, 0.12);
    background: rgba(255, 248, 236, 0.9);
}

.assistant-dock-chat-wrap .assistant-inline-chat-intro {
    color: rgba(244, 235, 224, 0.72);
}

.assistant-page .assistant-inline-chat-intro {
    color: rgba(17, 18, 15, 0.65);
}

.assistant-chat-welcome {
    margin-bottom: 12px;
}

.assistant-chat-bubble--welcome {
    max-width: 100%;
    margin: 0;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 0.9rem;
    line-height: 1.55;
    font-weight: 600;
    border: 1px solid rgba(183, 148, 98, 0.45);
    background: rgba(30, 28, 24, 0.55);
    color: #faf6ef;
}

.assistant-page .assistant-chat-bubble--welcome {
    border-color: rgba(183, 148, 98, 0.45);
    background: rgba(255, 252, 246, 0.98);
    color: var(--archin-charcoal, #111);
}

.assistant-chat-messages {
    min-height: min(36vh, 280px);
    max-height: min(52vh, 420px);
    overflow-y: auto;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.35);
    scroll-behavior: smooth;
}

.assistant-page .assistant-chat-messages {
    border-color: rgba(17, 18, 15, 0.1);
    background: rgba(255, 255, 255, 0.55);
}

.assistant-chat-row {
    display: flex;
    margin-bottom: 10px;
}

.assistant-chat-row--user {
    justify-content: flex-end;
}

.assistant-chat-row--assistant {
    justify-content: flex-start;
}

.assistant-chat-bubble {
    max-width: min(92%, 520px);
    padding: 10px 14px;
    border-radius: 14px;
    font-size: clamp(0.86rem, 0.25vw + 0.82rem, 0.95rem);
    line-height: 1.58;
    word-break: break-word;
    unicode-bidi: plaintext;
    text-align: start;
}

.assistant-chat-row--user .assistant-chat-bubble {
    background: rgba(183, 148, 98, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f8f1e6;
}

.assistant-page .assistant-chat-row--user .assistant-chat-bubble {
    background: rgba(183, 148, 98, 0.22);
    border-color: rgba(17, 18, 15, 0.1);
    color: var(--archin-charcoal, #111);
}

.assistant-chat-row--assistant .assistant-chat-bubble {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(247, 241, 232, 0.92);
}

.assistant-page .assistant-chat-row--assistant .assistant-chat-bubble {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(17, 18, 15, 0.08);
    color: var(--archin-charcoal, #111);
}

.assistant-chat-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.assistant-chat-input-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}

.assistant-chat-input-row textarea {
    flex: 1 1 180px;
    min-width: 0;
    min-height: 52px;
    max-height: 140px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(0, 0, 0, 0.35);
    color: #f4ebe0;
    font-family: inherit;
    font-size: 0.92rem;
    line-height: 1.5;
    resize: vertical;
}

.assistant-page .assistant-chat-input-row textarea {
    border-color: rgba(17, 18, 15, 0.12);
    background: rgba(255, 255, 255, 0.95);
    color: var(--archin-charcoal, #111);
}

.assistant-chat-media-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.assistant-chat-send {
    flex: 0 0 auto;
    min-height: 48px;
    padding: 0 22px;
    border-radius: 999px;
    border: 1px solid rgba(183, 148, 98, 0.5);
    background: linear-gradient(145deg, #b79462, #8a6d45);
    color: #111;
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
}

.assistant-chat-voice,
.assistant-chat-read {
    flex: 0 1 auto;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(244, 235, 224, 0.92);
    font-weight: 700;
    font-size: 0.74rem;
    letter-spacing: 0.04em;
    text-transform: none;
    cursor: pointer;
    white-space: nowrap;
}

.assistant-page .assistant-chat-voice,
.assistant-page .assistant-chat-read {
    border-color: rgba(17, 18, 15, 0.14);
    background: rgba(255, 255, 255, 0.88);
    color: var(--archin-charcoal, #111);
}

.assistant-chat-send:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.assistant-chat-voice:disabled,
.assistant-chat-read:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.assistant-chat-offline,
.assistant-chat-wait {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(230, 210, 175, 0.9);
}

.assistant-page .assistant-chat-offline,
.assistant-page .assistant-chat-wait {
    color: rgba(17, 18, 15, 0.6);
}

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

.assistant-dock-chat-wrap {
    flex: 1;
    min-height: 0;
    padding: clamp(14px, 3vw, 22px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.assistant-dock .assistant-dock-body {
    display: flex;
    flex-direction: column;
    min-height: min(62vh, 620px);
}
