/* AI chat widget. Everything is prefixed with .dre-ai so nothing here touches the rest of the site. */
.dre-ai, .dre-ai * {
    box-sizing: border-box;
}
.dre-ai {
    --dre-ai-main: #5f574c;
    --dre-ai-accent: #ab9889;
    --dre-ai-bg: #ffffff;
    --dre-ai-soft: #f5f2ef;
    --dre-ai-text: #2e2a25;
    --dre-ai-muted: #7a7168;
    --dre-ai-border: #e4ddd6;
    font-family: var(--main-font, 'Giga Sans', sans-serif);
    font-size: 14px;
    line-height: 1.5;
    color: var(--dre-ai-text);
    text-align: left;
}

/* Launcher: bottom left, because WhatsApp and the live-agent button sit bottom right. */
.dre-ai-launcher {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 9998;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border: 1px solid #eee;
    border-radius: 28px;
    background: var(--dre-ai-main);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    transition: transform 0.15s ease, background 0.15s ease;
}
.dre-ai-launcher:hover {
    background: var(--dre-ai-accent);
    transform: translateY(-1px);
}
.dre-ai-launcher:focus-visible,
.dre-ai button:focus-visible,
.dre-ai textarea:focus-visible,
.dre-ai a:focus-visible {
    outline: 2px solid var(--dre-ai-accent);
    outline-offset: 2px;
}
.dre-ai-launcher svg {
    width: 20px;
    height: 20px;
    flex: none;
}
.dre-ai-open .dre-ai-launcher {
    display: none;
}

.dre-ai-panel {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 9999;
    display: none;
    flex-direction: column;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 580px;
    max-height: calc(100vh - 40px);
    background: var(--dre-ai-bg);
    border: 1px solid var(--dre-ai-border);
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
    overflow: hidden;
}
.dre-ai-open .dre-ai-panel {
    display: flex;
}

.dre-ai-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 14px 14px 18px;
    background: var(--dre-ai-main);
    color: #fff;
}
.dre-ai-title {
    flex: 1;
    min-width: 0;
}
.dre-ai-title strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
}
.dre-ai-title span {
    display: block;
    font-size: 12px;
    opacity: 0.85;
}
.dre-ai-header button {
    flex: none;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #fff;
    cursor: pointer;
}
.dre-ai-header button:hover {
    background: rgba(255, 255, 255, 0.16);
}
.dre-ai-header svg {
    width: 18px;
    height: 18px;
    vertical-align: middle;
}

.dre-ai-notice {
    padding: 8px 18px;
    background: var(--dre-ai-soft);
    border-bottom: 1px solid var(--dre-ai-border);
    color: var(--dre-ai-muted);
    font-size: 12px;
}
.dre-ai-notice a {
    color: var(--dre-ai-main);
    text-decoration: underline;
}

.dre-ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overscroll-behavior: contain;
}
.dre-ai-msg {
    max-width: 88%;
    padding: 10px 13px;
    border-radius: 14px;
    overflow-wrap: anywhere;
}
.dre-ai-msg-bot {
    align-self: flex-start;
    background: var(--dre-ai-soft);
    border-bottom-left-radius: 4px;
}
.dre-ai-msg-user {
    align-self: flex-end;
    background: var(--dre-ai-main);
    color: #fff;
    border-bottom-right-radius: 4px;
    white-space: pre-wrap;
}
.dre-ai-msg p {
    margin: 0 0 8px;
    color: inherit;
    font-size: inherit;
    line-height: inherit;
    text-align: left;
}
.dre-ai-msg p:last-child,
.dre-ai-msg ul:last-child {
    margin-bottom: 0;
}
.dre-ai-msg ul {
    margin: 0 0 8px;
    padding-left: 18px;
    list-style: disc;
}
.dre-ai-msg li {
    margin-bottom: 4px;
    list-style: disc;
    text-align: left;
}
.dre-ai-msg a {
    color: var(--dre-ai-main);
    font-weight: 600;
    text-decoration: underline;
}
.dre-ai-status {
    align-self: flex-start;
    color: var(--dre-ai-muted);
    font-size: 12px;
    padding: 0 6px;
}
.dre-ai-dots {
    display: inline-flex;
    gap: 4px;
    padding: 4px 0;
}
.dre-ai-dots i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--dre-ai-muted);
    animation: dre-ai-blink 1.2s infinite ease-in-out;
}
.dre-ai-dots i:nth-child(2) {
    animation-delay: 0.2s;
}
.dre-ai-dots i:nth-child(3) {
    animation-delay: 0.4s;
}
@keyframes dre-ai-blink {
    0%, 80%, 100% { opacity: 0.25; }
    40% { opacity: 1; }
}

.dre-ai-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 14px 10px;
}
.dre-ai-suggestions button {
    padding: 6px 11px;
    border: 1px solid var(--dre-ai-border);
    border-radius: 16px;
    background: #fff;
    color: var(--dre-ai-main);
    font: inherit;
    font-size: 12.5px;
    cursor: pointer;
    text-align: left;
}
.dre-ai-suggestions button:hover {
    border-color: var(--dre-ai-accent);
    background: var(--dre-ai-soft);
}

.dre-ai-form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px 12px;
    border-top: 1px solid var(--dre-ai-border);
}
.dre-ai-form textarea {
    flex: 1;
    min-height: 42px;
    max-height: 110px;
    padding: 10px 12px;
    border: 1px solid var(--dre-ai-border);
    border-radius: 12px;
    background: #fff;
    color: var(--dre-ai-text);
    font: inherit;
    resize: none;
}
.dre-ai-form button {
    flex: none;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: var(--dre-ai-main);
    color: #fff;
    cursor: pointer;
}
.dre-ai-form button:disabled {
    background: #c9c1b9;
    cursor: not-allowed;
}
.dre-ai-form svg {
    width: 18px;
    height: 18px;
    vertical-align: middle;
}
.dre-ai-count {
    padding: 0 16px 8px;
    color: var(--dre-ai-muted);
    font-size: 11px;
    text-align: right;
}
.dre-ai-count.dre-ai-over {
    color: #b3261e;
}

@media (max-width: 480px) {
    .dre-ai-launcher {
        left: 12px;
        bottom: 12px;
        padding: 11px 14px;
    }
    .dre-ai-launcher span {
        display: none;
    }
    .dre-ai-panel {
        left: 0;
        bottom: 0;
        width: 100vw;
        max-width: 100vw;
        height: 100%;
        max-height: 100%;
        border: 0;
        border-radius: 0;
    }
}
@media (prefers-reduced-motion: reduce) {
    .dre-ai-dots i,
    .dre-ai-launcher {
        animation: none;
        transition: none;
    }
}
