/* === Reserve AI Assistant === */
.assistant-widget {
    position: fixed;
    right: clamp(1rem, 3vw, 2rem);
    bottom: clamp(1rem, 3vw, 2rem);
    z-index: 880;
    font-family: var(--font);
    color: var(--text-dark);
}

.assistant-toggle {
    width: 4rem;
    height: 4rem;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: white;
    box-shadow: 0 18px 44px rgba(15, 26, 28, 0.22);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.assistant-logo {
    width: 1.8rem;
    height: 1.8rem;
    object-fit: contain;
    filter: brightness(0) invert(1);
    display: block;
}

.assistant-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 52px rgba(15, 26, 28, 0.28);
    background: var(--bg-teal);
}

.assistant-panel {
    position: absolute;
    right: 0;
    bottom: 5rem;
    width: min(25rem, calc(100vw - 2rem));
    height: min(42rem, calc(100vh - 7rem));
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(15, 26, 28, 0.08);
    border-radius: 1.25rem;
    box-shadow: 0 28px 80px rgba(15, 26, 28, 0.24);
    overflow: hidden;
    display: none;
    flex-direction: column;
}

.assistant-widget.open .assistant-panel {
    display: flex;
}

.assistant-header {
    padding: 1rem 1rem 0.85rem;
    background: var(--bg-dark);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.assistant-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.assistant-mark {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.85rem;
    background: rgba(100, 213, 179, 0.16);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-light);
    flex-shrink: 0;
}

.assistant-mark .assistant-logo {
    width: 1.35rem;
    height: 1.35rem;
}

.assistant-title strong {
    display: block;
    font-size: 0.95rem;
    line-height: 1.2;
}

.assistant-title span {
    display: block;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.75rem;
    line-height: 1.35;
    margin-top: 0.15rem;
}

.assistant-close {
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
}

.assistant-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: linear-gradient(180deg, #f7fbf8 0%, #ffffff 100%);
}

.assistant-message {
    display: flex;
    margin-bottom: 0.8rem;
}

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

.assistant-bubble {
    max-width: 88%;
    padding: 0.75rem 0.85rem;
    border-radius: 1rem;
    font-size: 0.9rem;
    line-height: 1.55;
    white-space: pre-wrap;
}

.assistant-message.assistant .assistant-bubble {
    background: white;
    border: 1px solid rgba(15, 26, 28, 0.08);
    color: var(--text-dark);
}

.assistant-message.user .assistant-bubble {
    background: var(--accent);
    color: white;
    border-bottom-right-radius: 0.3rem;
}

.assistant-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0 1rem 0.8rem;
    background: white;
}

.assistant-chip {
    border: 1px solid rgba(22, 107, 88, 0.18);
    background: var(--bg-mint);
    color: var(--accent);
    border-radius: 999px;
    padding: 0.45rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
}

.assistant-lead {
    border-top: 1px solid rgba(15, 26, 28, 0.08);
    padding: 0.9rem 1rem;
    background: white;
    display: none;
}

.assistant-widget.lead-open .assistant-lead {
    display: block;
}

.assistant-lead-back {
    display: inline-flex;
    align-items: center;
    width: auto;
    margin: 0 0 0.7rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
}

.assistant-lead-back::before {
    content: "←";
    margin-right: 0.35rem;
}

.assistant-lead p {
    margin: 0 0 0.65rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.45;
}

.assistant-lead-grid {
    display: grid;
    gap: 0.55rem;
}

.assistant-lead input {
    width: 100%;
    border: 1px solid rgba(15, 26, 28, 0.12);
    background: #f5f7f6;
    border-radius: 0.8rem;
    padding: 0.65rem 0.75rem;
    outline: none;
    font-size: 0.85rem;
}

.assistant-lead input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(22, 107, 88, 0.12);
}

.assistant-consent {
    margin: 0.15rem 0 0.25rem;
}

.assistant-lead .assistant-consent input {
    width: 1.05rem;
    height: 1.05rem;
    padding: 0;
    border-radius: 0.25rem;
}

.assistant-lead-grid button,
.assistant-input button {
    border: 0;
    border-radius: 0.85rem;
    background: var(--bg-dark);
    color: white;
    font-weight: 800;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.assistant-lead-grid button {
    padding: 0.7rem 0.9rem;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.assistant-lead-grid button:disabled,
.assistant-input button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.assistant-status {
    min-height: 1.1rem;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.assistant-status.error {
    color: #dc2626;
}

.assistant-status.success {
    color: var(--accent);
}

.assistant-input {
    display: flex;
    gap: 0.55rem;
    padding: 0.85rem 1rem 1rem;
    border-top: 1px solid rgba(15, 26, 28, 0.08);
    background: white;
}

.assistant-input textarea {
    flex: 1;
    height: 2.8rem;
    min-height: 2.8rem;
    max-height: 7rem;
    resize: none;
    overflow: hidden;
    border: 1px solid rgba(15, 26, 28, 0.12);
    background: #f5f7f6;
    border-radius: 0.95rem;
    padding: 0.75rem 0.85rem;
    outline: none;
    font-size: 0.88rem;
    line-height: 1.2;
    white-space: nowrap;
}

.assistant-input textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(22, 107, 88, 0.12);
}

.assistant-input button {
    width: 2.8rem;
    height: 2.8rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 640px) {
    .assistant-widget {
        right: 1rem;
        bottom: 1rem;
    }

    .assistant-toggle {
        width: 3.5rem;
        height: 3.5rem;
    }

    .assistant-panel {
        position: fixed;
        inset: auto 0 0 0;
        width: 100vw;
        height: min(86vh, 42rem);
        border-radius: 1.25rem 1.25rem 0 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .assistant-toggle,
    .assistant-lead-grid button,
    .assistant-input button {
        transition: none;
    }
}
