.dk-ai-chat {
    bottom: 86px;
    font-family: Arial, sans-serif;
    position: fixed;
    right: 18px;
    z-index: 10020;
}

.dk-ai-toggle {
    align-items: center;
    background: #0b1536;
    border: 0;
    border-radius: 999px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .24);
    color: #fff;
    cursor: pointer;
    display: flex;
    font-weight: 700;
    gap: 9px;
    padding: 8px 14px 8px 8px;
}

.dk-ai-toggle:hover,
.dk-ai-toggle:focus-visible {
    background: #111f4d;
    outline: 3px solid rgba(22, 163, 74, .3);
}

.dk-ai-toggle-icon {
    align-items: center;
    background: #16a34a;
    border-radius: 50%;
    display: inline-flex;
    font-size: 12px;
    height: 36px;
    justify-content: center;
    width: 36px;
}

.dk-ai-panel {
    background: #fff;
    border: 1px solid #dbe4f0;
    border-radius: 16px;
    bottom: 58px;
    box-shadow: 0 22px 55px rgba(15, 23, 42, .24);
    display: flex;
    flex-direction: column;
    height: min(580px, calc(100vh - 125px));
    overflow: hidden;
    position: absolute;
    right: 0;
    width: min(390px, calc(100vw - 24px));
}

.dk-ai-panel[hidden] { display: none; }

.dk-ai-header {
    align-items: center;
    background: #0b1536;
    color: #fff;
    display: flex;
    justify-content: space-between;
    padding: 14px 16px;
}

.dk-ai-title { font-size: 16px; font-weight: 800; }
.dk-ai-title span { background: #16a34a; border-radius: 999px; font-size: 10px; margin-left: 5px; padding: 3px 6px; text-transform: uppercase; }
.dk-ai-subtitle { color: #cbd5e1; font-size: 12px; margin-top: 3px; }
.dk-ai-close { background: transparent; border: 0; color: #fff; cursor: pointer; font-size: 27px; line-height: 1; padding: 2px 5px; }

.dk-ai-messages {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    padding: 14px;
}

.dk-ai-message {
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.55;
    max-width: 92%;
    padding: 11px 13px;
    word-break: break-word;
}

.dk-ai-message.assistant { align-self: flex-start; background: #fff; border: 1px solid #dbe4f0; box-shadow: 0 2px 8px rgba(15, 23, 42, .04); color: #172033; }
.dk-ai-message.user { align-self: flex-end; background: #16a34a; color: #fff; white-space: pre-wrap; }
.dk-ai-message.loading { color: #64748b; font-style: italic; }
.dk-ai-message a { color: #047857; font-weight: 700; text-decoration: underline; }
.dk-ai-message p { margin: 0 0 10px; }
.dk-ai-message p:last-child { margin-bottom: 0; }
.dk-ai-message h4 { color: #0f172a; font-size: 14px; line-height: 1.35; margin: 2px 0 7px; }
.dk-ai-message ul,
.dk-ai-message ol { margin: 4px 0 10px; padding-left: 20px; }
.dk-ai-message li { margin: 4px 0; padding-left: 2px; }

.dk-ai-copy {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 7px;
    color: #64748b;
    cursor: pointer;
    display: flex;
    font-size: 11px;
    font-weight: 700;
    margin: 8px 0 -3px auto;
    min-height: 28px;
    padding: 4px 7px;
}
.dk-ai-copy::before { content: '\29C9'; font-size: 14px; margin-right: 5px; }
.dk-ai-copy:hover,
.dk-ai-copy:focus-visible { background: #f1f5f9; color: #166534; outline: 2px solid rgba(22, 163, 74, .16); }
.dk-ai-copy.copied { color: #15803d; }
.dk-ai-copy.copied::before { content: '\2713'; }

.dk-ai-opportunity-list {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dk-ai-opportunity-card {
    background: #fff;
    border: 1px solid #a7f3d0;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .08);
    overflow: hidden;
    padding: 14px;
}

.dk-ai-opportunity-badge {
    color: #047857;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.dk-ai-opportunity-card h3 {
    color: #0f172a;
    font-size: 15px;
    line-height: 1.35;
    margin: 0 0 8px;
}

.dk-ai-opportunity-description {
    color: #475569;
    display: -webkit-box;
    font-size: 12px;
    line-height: 1.45;
    margin: 0 0 10px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.dk-ai-opportunity-posts {
    background: #f0fdf4;
    border-radius: 9px;
    color: #14532d;
    font-size: 12px;
    line-height: 1.4;
    margin-bottom: 10px;
    padding: 8px 9px;
}

.dk-ai-opportunity-posts span {
    display: block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
    margin-bottom: 2px;
    text-transform: uppercase;
}

.dk-ai-opportunity-deadline {
    align-items: center;
    border-top: 1px solid #e2e8f0;
    color: #64748b;
    display: flex;
    font-size: 12px;
    justify-content: space-between;
    padding-top: 10px;
}

.dk-ai-opportunity-deadline strong { color: #0f172a; font-size: 12px; }

.dk-ai-opportunity-actions { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; margin-top: 12px; }
.dk-ai-opportunity-action {
    align-items: center;
    border: 1px solid #16a34a;
    border-radius: 10px;
    display: flex;
    font-size: 12px;
    font-weight: 800;
    justify-content: center;
    min-height: 42px;
    padding: 7px 8px;
    text-align: center;
    text-decoration: none;
}
.dk-ai-opportunity-action.secondary { background: #fff; color: #15803d; }
.dk-ai-opportunity-action.primary { background: #16a34a; color: #fff; }
.dk-ai-opportunity-action:hover,
.dk-ai-opportunity-action:focus-visible { filter: brightness(.96); outline: 3px solid rgba(22, 163, 74, .16); text-decoration: none; }

.dk-ai-message.dk-ai-progress {
    min-width: 245px;
    padding: 12px 14px;
}

.dk-ai-progress-step {
    align-items: center;
    color: #64748b;
    display: flex;
    font-size: 13px;
    gap: 9px;
    min-height: 27px;
    opacity: .45;
    transition: color .25s ease, opacity .25s ease, transform .25s ease;
}

.dk-ai-progress-step.active {
    color: #172033;
    opacity: 1;
    transform: translateX(2px);
}

.dk-ai-progress-step.complete {
    color: #475569;
    opacity: .8;
}

.dk-ai-progress-icon {
    align-items: center;
    display: inline-flex;
    flex: 0 0 18px;
    height: 18px;
    justify-content: center;
    position: relative;
    width: 18px;
}

.dk-ai-progress-step.pending .dk-ai-progress-icon::before {
    background: #cbd5e1;
    border-radius: 50%;
    content: '';
    height: 5px;
    width: 5px;
}

.dk-ai-progress-step.active .dk-ai-progress-icon::before {
    animation: dk-ai-progress-spin .8s linear infinite;
    border: 2px solid #bbf7d0;
    border-radius: 50%;
    border-top-color: #16a34a;
    content: '';
    height: 14px;
    width: 14px;
}

.dk-ai-progress-step.complete .dk-ai-progress-icon::before {
    color: #16a34a;
    content: '\2713';
    font-size: 16px;
    font-weight: 800;
}

.dk-ai-progress-step.active .dk-ai-progress-label::after {
    animation: dk-ai-progress-dots 1.25s steps(4, end) infinite;
    content: '...';
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
    width: 0;
}

@keyframes dk-ai-progress-spin {
    to { transform: rotate(360deg); }
}

@keyframes dk-ai-progress-dots {
    to { width: 1.2em; }
}

.dk-ai-suggestions { display: flex; gap: 6px; overflow-x: auto; padding: 9px 12px 3px; }
.dk-ai-suggestions button { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 999px; color: #166534; cursor: pointer; flex: 0 0 auto; font-size: 12px; padding: 6px 9px; }

.dk-ai-whatsapp {
    align-items: center;
    background: #eefdf3;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    color: #166534;
    display: flex;
    font-size: 13px;
    font-weight: 700;
    gap: 8px;
    justify-content: center;
    margin: 8px 12px 0;
    padding: 8px 10px;
    text-decoration: none;
}

.dk-ai-whatsapp:hover,
.dk-ai-whatsapp:focus-visible {
    background: #dcfce7;
    color: #14532d;
    outline: 2px solid rgba(22, 163, 74, .22);
    text-decoration: none;
}

.dk-ai-whatsapp img {
    display: block;
    height: 20px;
    width: 20px;
}

.dk-ai-form { align-items: flex-end; display: flex; gap: 8px; padding: 9px 12px; }
.dk-ai-form textarea { border: 1px solid #cbd5e1; border-radius: 10px; max-height: 96px; min-height: 42px; padding: 10px; resize: none; width: 100%; }
.dk-ai-form textarea:focus { border-color: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, .12); outline: none; }
.dk-ai-form button { background: #16a34a; border: 0; border-radius: 10px; color: #fff; cursor: pointer; font-weight: 700; min-height: 42px; padding: 9px 13px; }
.dk-ai-form button:disabled { cursor: wait; opacity: .65; }
.dk-ai-privacy { color: #64748b; font-size: 10px; padding: 0 12px 10px; text-align: center; }

@media (max-width: 576px) {
    .dk-ai-chat { bottom: 54px; right: 8px; }
    .dk-ai-toggle-label { display: none; }
    .dk-ai-toggle { padding: 7px; }
    .dk-ai-toggle-icon { height: 32px; width: 32px; }
    .dk-ai-panel { bottom: 54px; height: min(640px, calc(100vh - 74px)); height: min(640px, calc(100dvh - 74px)); width: calc(100vw - 16px); }
    .dk-ai-messages { padding: 12px; }
    .dk-ai-message { font-size: 13.5px; max-width: 94%; }
    .dk-ai-opportunity-card { padding: 13px; }
    .dk-ai-opportunity-actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .dk-ai-progress-step,
    .dk-ai-progress-step.active .dk-ai-progress-icon::before,
    .dk-ai-progress-step.active .dk-ai-progress-label::after {
        animation: none;
        transition: none;
    }
}
