.dya-ai-wrapper, .dya-ai-wrapper * {
    box-sizing: border-box;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.dya-ai-toggle {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 46px;
    padding: 0 18px;
    border: none;
    border-radius: 99px;
    background: #0f172a;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, background 0.2s ease;
}

.dya-ai-toggle:hover { background: #1e293b; transform: translateY(-2px); }
.dya-ai-toggle:focus-visible, .dya-ai-send:focus-visible, .dya-ai-close:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }

.dya-ai-box {
    position: fixed;
    right: 20px;
    bottom: 78px;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    width: 360px;
    max-height: calc(100vh - 100px);
    height: 520px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.98);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.dya-ai-box.is-open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }

.dya-ai-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #0f172a;
    color: #ffffff;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    font-size: 14px;
}

.dya-ai-close { background: transparent; border: none; color: #ffffff; font-size: 22px; cursor: pointer; line-height: 1; }

.dya-ai-disclosure {
    padding: 8px 14px;
    background: #fef9c3;
    border-bottom: 1px solid #fde68a;
    color: #713f12;
    font-size: 11.5px;
    line-height: 1.4;
}

.dya-ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background: #f8fafc;
    font-size: 14px;
    color: #334155;
    line-height: 1.55;
}

.dya-msg { margin-bottom: 12px; padding: 10px 12px; border-radius: 10px; max-width: 90%; word-wrap: break-word; }
.dya-msg p { margin: 0 0 8px 0; }
.dya-msg p:last-child { margin-bottom: 0; }

.dya-msg.user { background: #0f172a; color: #fff; margin-left: auto; border-bottom-right-radius: 2px; white-space: pre-wrap; }
.dya-msg.assistant { background: #ffffff; border: 1px solid #e2e8f0; color: #1e293b; margin-right: auto; border-bottom-left-radius: 2px; }
.dya-msg.assistant a { color: #2563eb; text-decoration: underline; }

.dya-ai-list { margin: 4px 0 0 0; padding-left: 18px; }
.dya-ai-list li { margin-bottom: 4px; }

.dya-crisis { margin-top: 10px; padding: 10px 12px; background: #fff1f2; border: 1px solid #fecdd3; border-radius: 8px; color: #881337; }
.dya-crisis p { margin: 0 0 6px 0; }
.dya-crisis p:last-child { margin-bottom: 0; }

.dya-typing { display: flex; gap: 4px; align-items: center; width: 56px; }
.dya-typing span { width: 6px; height: 6px; border-radius: 50%; background: #94a3b8; animation: dya-bounce 1.2s infinite ease-in-out; }
.dya-typing span:nth-child(2) { animation-delay: 0.15s; }
.dya-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes dya-bounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
    40% { transform: translateY(-4px); opacity: 1; }
}

.dya-ai-form {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    padding: 12px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}

.dya-ai-input {
    flex: 1;
    min-height: 36px;
    max-height: 110px;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
    resize: none;
    outline: none;
    color: #1e293b;
    background: #ffffff;
}

.dya-ai-input:focus { border-color: #2563eb; }

.dya-ai-send { height: 36px; padding: 0 14px; background: #2563eb; color: #fff; border: none; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; }
.dya-ai-send:hover { background: #1d4ed8; }
.dya-ai-send:disabled { background: #94a3b8; cursor: not-allowed; }

@media (max-width: 480px) {
    .dya-ai-box { right: 10px; left: 10px; width: auto; height: 70vh; }
}

@media (prefers-reduced-motion: reduce) {
    .dya-ai-toggle, .dya-ai-box { transition: none; }
    .dya-typing span { animation: none; }
}
