/* Issue #360: de assistent als vast paneel rechts naast de inhoud (de body-rij van het hoofdvenster is een flex-rij; de inhoud
   schuift opzij). Dicht: verborgen, maar het gesprek blijft bestaan. Onder 992px een laag over de volle breedte. */

.fc-assistant {
    display: none;
    flex: 0 0 420px;
    width: 420px;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    background: var(--fc-surface);
    border-left: 1px solid var(--fc-card-border);
    color: var(--fc-text);
}

    .fc-assistant.is-open {
        display: flex;
    }

.fc-assistant-head {
    height: 56px;
    flex: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px 0 16px;
    border-bottom: 1px solid var(--fc-border);
}

.fc-assistant-title {
    flex: 1;
    font-weight: 700;
    font-size: 1rem;
}

.fc-assistant-icon-btn {
    width: 36px;
    height: 36px;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius-control);
    background: var(--fc-surface);
    color: var(--fc-text);
    cursor: pointer;
}

    .fc-assistant-icon-btn:hover {
        background: color-mix(in srgb, var(--fc-text) 8%, var(--fc-surface));
    }

    .fc-assistant-icon-btn.is-active {
        background: var(--fc-brand-tint);
        border-color: var(--fc-brand);
        color: var(--fc-brand-text);
    }

    .fc-assistant-icon-btn:focus-visible {
        outline: none;
        box-shadow: var(--fc-focus-ring);
    }

/* De chat vult de rest van het paneel. */
.fc-assistant .fc-assistant-chat {
    flex: 1;
    min-height: 0;
    width: 100%;
    border: 0;
    border-radius: 0;
}

/* Even groot als de tekst in de rest van de app; de standaard van DxAIChat is kleiner. */
.fc-assistant .fc-assistant-chat {
    font-size: 0.9375rem;
}

    .fc-assistant .fc-assistant-chat textarea {
        font-size: 0.9375rem;
    }

.fc-assistant-answer,
.fc-assistant-question {
    font-size: 0.9375rem;
    line-height: 1.5;
    white-space: normal;
    overflow-wrap: anywhere;
}

.fc-assistant-question {
    white-space: pre-wrap;
}

    .fc-assistant-answer p {
        margin: 0 0 8px;
    }

        .fc-assistant-answer p:last-child {
            margin-bottom: 0;
        }

    .fc-assistant-answer ul,
    .fc-assistant-answer ol {
        margin: 4px 0 8px;
        padding-left: 20px;
    }

    .fc-assistant-answer li {
        margin: 2px 0;
    }

.fc-assistant-link {
    color: var(--fc-brand-text);
    font-weight: 600;
    text-decoration: none;
}

    .fc-assistant-link:hover {
        text-decoration: underline;
    }

/* Issue #434: een voorstel van de assistent (taak, contactmoment, aanvraag) met Uitvoeren/Annuleren. */
.fc-assistant-proposal {
    flex: none;
    border-top: 1px solid var(--fc-border);
    background: var(--fc-brand-tint);
}

.fc-assistant-proposal__title {
    padding: 10px 12px 0;
    font-size: 0.875rem;
    font-weight: 600;
}

.fc-assistant-proposal__lines {
    margin: 4px 0 0;
    padding: 0 12px 0 28px;
    font-size: 0.8125rem;
    max-height: 9rem;
    overflow-y: auto;
    white-space: pre-line;
}

.fc-assistant-proposal .fc-assistant-actionbar {
    border-top: none;
}

/* Een offertevoorstel klaar: de knoppen onder de chat. */
.fc-assistant-actionbar {
    flex: none;
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--fc-border);
    background: var(--fc-brand-tint);
}

.fc-assistant-primary,
.fc-assistant-secondary {
    height: 36px;
    padding: 0 14px;
    border-radius: var(--fc-radius-control);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

.fc-assistant-primary {
    flex: 1;
    border: 0;
    background: var(--fc-brand-solid);
    color: #fff;
}

    .fc-assistant-primary:hover {
        background: var(--fc-brand-solid-hover);
    }

.fc-assistant-secondary {
    border: 1px solid var(--fc-border);
    background: var(--fc-surface);
    color: var(--fc-text);
}

/* Eerdere gesprekken. */
.fc-assistant-conversations {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 8px 12px;
}

.fc-assistant-conversation {
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--fc-border);
}

    .fc-assistant-conversation.is-current .fc-assistant-conversation-title {
        color: var(--fc-brand-text);
    }

.fc-assistant-conversation-open {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 4px;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.fc-assistant-conversation-title {
    font-weight: 600;
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fc-assistant-muted {
    color: var(--fc-text-muted);
    font-size: 0.75rem;
}

/* De kopknop als hij open staat. */
.focara-header-icon-btn.fc-assistant-toggle.is-active {
    background: var(--fc-brand-tint);
    box-shadow: inset 0 0 0 1px var(--fc-brand);
}

@media (max-width: 991.98px) {
    .fc-assistant.is-open {
        position: fixed;
        top: 56px;
        right: 0;
        bottom: 0;
        width: min(420px, 100vw);
        z-index: 1050;
        box-shadow: -8px 0 24px rgba(0, 0, 0, 0.15);
    }
}

@media (max-width: 575.98px) {
    .fc-assistant.is-open {
        width: 100vw;
        border-left: 0;
    }
}
