/* Values mirror darwindigital.com's own .chat-with-us / .btn styles */
.dd-agent {
    --dd-blue: #3971dd;
    --dd-ink: #333740;
    --dd-muted: #8a8d94;
    --dd-surface: #f4f4f4;
    --dd-button-size: 90px;
    font-family: Aeonik Pro, sans-serif;
    letter-spacing: .8px;
}

.dd-agent-launcher {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--dd-button-size);
    height: var(--dd-button-size);
    background-color: var(--dd-blue);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 3.2rem;
    box-shadow: 0 12px 24px rgba(0, 0, 0, .2);
    transition: .25s ease;
    cursor: pointer;
    outline: none;
}
.dd-agent-launcher:hover { background-color: #fff; color: var(--dd-blue); scale: 1.1; }
.dd-agent-launcher:active { scale: .9; }
.dd-agent-launcher[aria-expanded=true] { background-color: #fff; color: var(--dd-ink); }
.dd-agent-launcher:focus-visible { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--dd-blue); }

/* Panel corner tucks under the launcher's centre, like the original contact popup */
.dd-agent-panel {
    position: fixed;
    right: calc(var(--dd-button-size) / 2 + 20px);
    bottom: calc(var(--dd-button-size) / 2 + 20px);
    z-index: 1000;
    display: none;
    flex-direction: column;
    width: 520px;
    height: min(640px, calc(100vh - 140px));
    background-color: #fff;
    box-shadow: 0 30px 40px rgba(0, 0, 0, .2);
    color: var(--dd-ink);
}
.dd-agent-panel.open { display: flex; }

.dd-agent-head {
    position: relative;
    padding: 34px 40px 20px;
    border-bottom: 1px solid #ececec;
}
.dd-agent-clear {
    position: absolute;
    top: 16px;
    right: 20px;
    padding: 4px 8px;
    border: 0;
    background: none;
    font: inherit;
    font-size: 12px;
    color: var(--dd-muted);
    text-decoration: underline;
    cursor: pointer;
}
.dd-agent-clear:hover { color: var(--dd-blue); }
.dd-agent-title {
    font-size: 24px;
    letter-spacing: 1.4px;
    line-height: 1.2;
    margin-bottom: 8px;
}
.dd-agent-head p {
    margin: 0;
    font-size: 13px;
    color: var(--dd-muted);
}

.dd-agent-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px 40px 8px;
}
.dd-agent .agent-widget-message { margin-bottom: 14px; }
.dd-agent .agent-widget-bubble {
    max-width: 85%;
    padding: 12px 18px;
    font-size: 15px;
    line-height: 1.6;
    box-shadow: none;
    border: none;
    border-radius: 20px;
}
.dd-agent .agent-widget-message.user .agent-widget-bubble {
    background: var(--dd-blue) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 20px 20px 4px 20px !important;
}
.dd-agent .agent-widget-message.bot .agent-widget-bubble {
    background: var(--dd-surface);
    color: var(--dd-ink);
    border: none;
    border-radius: 20px 20px 20px 4px;
}
.dd-agent .agent-widget-bubble.thinking {
    background: var(--dd-surface) !important;
    color: var(--dd-muted) !important;
    padding: 6px 14px !important;
}
.dd-agent .agent-widget-bubble p { margin: 0 0 8px; }
.dd-agent .agent-widget-bubble p:last-child { margin-bottom: 0; }
.dd-agent .agent-widget-bubble ul,
.dd-agent .agent-widget-bubble ol { margin: 4px 0 8px; padding-left: 20px; }
.dd-agent .agent-widget-bubble ul { list-style: disc; }
.dd-agent .agent-widget-bubble ol { list-style: decimal; }
.dd-agent .agent-widget-bubble li { list-style: inherit; }
.dd-agent .agent-widget-bubble a { color: var(--dd-blue); text-decoration: underline; }

.dd-agent-form {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 16px 40px 12px;
}
.dd-agent-form input {
    flex: 1;
    min-width: 0;
    height: 44px;
    padding: 0 20px;
    border: 1px solid #d9dbe0;
    border-radius: 30px;
    font: inherit;
    font-size: 15px;
    color: var(--dd-ink);
    background: #fff;
    outline: none;
    transition: border-color .25s ease;
}
.dd-agent-form input:focus { border-color: var(--dd-blue); }
.dd-agent-form .btn { height: 44px; flex-shrink: 0; }

.dd-agent-foot {
    padding: 0 40px 22px;
    font-size: 12px;
    color: var(--dd-muted);
    text-align: center;
}
.dd-agent-foot a { color: var(--dd-blue); text-decoration: underline; white-space: nowrap; }
.dd-agent-disclaimer { margin-top: 6px; font-size: 11px; }

@media (max-width: 768px) {
    .dd-agent { --dd-button-size: 60px; }
    .dd-agent-launcher { font-size: 2rem; }
    .dd-agent-panel {
        left: 16px;
        right: 16px;
        bottom: calc(var(--dd-button-size) + 32px);
        width: auto;
        height: calc(100vh - 130px);
        height: calc(100dvh - 130px);
    }
    .dd-agent-head { padding: 24px 20px 16px; }
    .dd-agent-clear { top: 8px; right: 8px; }
    .dd-agent-messages { padding: 20px 20px 8px; }
    .dd-agent-form { padding: 12px 20px 10px; }
    .dd-agent-foot { padding: 0 20px 16px; }
}
