.d1-ai{font-family:Arial,sans-serif;color:#17334c;font-size:14px;line-height:1.5;position:relative;z-index:10000}
.d1-ai *{box-sizing:border-box}.d1-ai button{font:inherit;cursor:pointer}.d1-ai button:focus-visible,.d1-ai textarea:focus-visible{outline:3px solid #f0bf57;outline-offset:3px}
.d1-ai-launcher{position:fixed;right:24px;bottom:24px;border:0;border-radius:30px;background:#022f60;color:#fff;padding:14px 22px;box-shadow:0 5px 24px #102b4d33;font-weight:700!important}
.d1-ai-panel{position:fixed;right:24px;bottom:86px;width:410px;height:650px;max-height:calc(100vh - 110px);display:flex;flex-direction:column;background:#fff;border:1px solid #dce4ea;border-radius:18px;overflow:hidden;box-shadow:0 12px 45px #102b4d33}
.d1-ai-header{background:#022f60;color:#fff;display:flex;justify-content:space-between;align-items:center;padding:20px}.d1-ai-header strong{font-size:17px}.d1-ai-header span{display:block;font-size:12px;margin-top:4px;color:#d5e4f3}.d1-ai-header button{background:transparent;color:#fff;border:0;font-size:28px}
.d1-ai-messages{flex:1;overflow-y:auto;padding:18px;min-height:80px;overscroll-behavior:contain;background:#f8fafc}.d1-ai-welcome h2{font-size:21px;margin:0 0 10px}.d1-ai-welcome button{display:block;width:100%;background:#fff;border:1px solid #c8d7e3;padding:11px;text-align:left;border-radius:9px;margin:10px 0}.d1-ai-welcome small{display:block;color:#526475;margin-top:20px}
.d1-ai-message{margin-bottom:18px;background:#fff;border-radius:12px;padding:12px;border:1px solid #e0e8ef;overflow-wrap:anywhere}.d1-ai-message p{white-space:pre-wrap;margin:6px 0}.d1-ai-speaker{font-size:11px;font-weight:700;color:#536b82}.d1-ai-user{margin-left:28px;background:#e6eef7;border:0}.d1-ai-message button{background:#022f60;color:#fff;border:0;border-radius:7px;padding:8px 12px;margin-top:8px}
.d1-ai-product{border-top:1px solid #dce4ea;padding-top:12px;margin-top:12px;display:flex;gap:12px}.d1-ai-product img{width:70px;height:80px;object-fit:contain;background:#fff;border-radius:6px}.d1-ai-product h3{font-size:14px;font-weight:700;margin:3px 0}.d1-ai-product small{display:block;font-size:11px;color:#5b6c7c}.d1-ai-product details{font-size:12px;margin-top:8px}.d1-ai-product summary{cursor:pointer}.d1-ai-product strong{font-size:16px}
.d1-ai-form{padding:12px 16px;border-top:1px solid #dce4ea;margin:0}.d1-ai-form label{font-size:12px;display:block;margin-bottom:6px}.d1-ai-form>div{display:flex;gap:8px}.d1-ai-form textarea{flex:1;min-width:0;border:1px solid #b8c9d8;border-radius:8px;padding:9px;font:inherit;resize:vertical;max-height:120px}.d1-ai-form button{background:#022f60;color:#fff;border:0;border-radius:8px;padding:8px 14px}.d1-ai button:disabled{opacity:.5;cursor:not-allowed}
.d1-ai-footer{padding:0 16px 12px;font-size:10px;color:#5b6c7c;display:flex;align-items:center;gap:10px}.d1-ai-footer button{background:none;border:0;text-decoration:underline;white-space:nowrap;color:#022f60}.d1-ai-error{padding:8px 16px;background:#fff1e8;color:#713814;font-size:12px}.d1-ai-error p{margin:0}.d1-ai-error button{border:0;background:transparent;text-decoration:underline;padding:5px}.d1-ai-thinking{font-size:12px;color:#536b82}
@media(max-width:480px){.d1-ai-panel{right:8px;left:8px;width:auto;bottom:76px;max-height:calc(100dvh - 92px);height:640px}.d1-ai-launcher{right:12px;bottom:16px}.d1-ai-header{padding:14px}.d1-ai-messages{padding:12px}}
/* =========================================
   Structured AI Answers
   ========================================= */

.d1-ai-answer {
    margin-top: 8px;
    color: #17334c;
}

.d1-ai-answer-title {
    margin: 2px 0 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #022f60;
    color: #022f60;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.d1-ai-answer-summary {
    margin: 8px 0 14px !important;
    font-size: 13px;
    line-height: 1.6;
    white-space: normal !important;
}

.d1-ai-answer-section {
    margin: 14px 0;
}

.d1-ai-answer-section h4 {
    margin: 0 0 7px;
    color: #022f60;
    font-size: 13px;
    font-weight: 700;
}

.d1-ai-answer-section p {
    margin: 5px 0 !important;
    white-space: normal !important;
}

.d1-ai-answer-section ul {
    margin: 7px 0 0 18px;
    padding: 0;
}

.d1-ai-answer-section li {
    margin: 5px 0;
    line-height: 1.5;
}

.d1-ai-table-wrap {
    width: 100%;
    overflow-x: auto;
    margin-top: 8px;
    border: 1px solid #dce4ea;
    border-radius: 8px;
    background: #fff;
}

.d1-ai-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 11px;
    table-layout: auto;
}

.d1-ai-table th {
    padding: 9px 8px;
    background: #022f60;
    color: #fff;
    text-align: left;
    vertical-align: middle;
    white-space: normal;
    line-height: 1.3;
    font-weight: 700;
}

.d1-ai-table td {
    padding: 9px 8px;
    border-top: 1px solid #e2e8ee;
    vertical-align: top;
    white-space: normal;
    line-height: 1.4;
    overflow-wrap: break-word;
    word-break: normal;
}

.d1-ai-table tbody tr:nth-child(even) {
    background: #f7f9fb;
}

.d1-ai-table td:first-child {
    color: #022f60;
    font-weight: 700;
}

.d1-ai-table th:first-child,
.d1-ai-table td:first-child {
    min-width: 105px;
}

.d1-ai-table th:not(:first-child),
.d1-ai-table td:not(:first-child) {
    min-width: 80px;
}

.d1-ai-note {
    margin: 14px 0 3px;
    padding: 10px 12px;
    background: #fff8e6;
    border-left: 4px solid #d9a719;
    border-radius: 6px;
    font-size: 12px;
}

.d1-ai-note strong {
    display: block;
    margin-bottom: 4px;
    color: #7a5700;
}

.d1-ai-note p {
    margin: 0 !important;
    white-space: normal !important;
}

.d1-ai-answer-heading {
    margin: 16px 0 7px;
    color: #022f60;
    font-size: 14px;
    font-weight: 700;
}

.d1-ai-answer-text {
    margin: 7px 0 !important;
    white-space: normal !important;
}

.d1-ai-list {
    margin: 7px 0 10px 20px;
    padding: 0;
}

.d1-ai-list li {
    margin-bottom: 5px;
}

/* Better emphasis inside answers */
.d1-ai-answer strong {
    color: #0b2c4a;
    font-weight: 700;
}

/* =========================================
   Voice Input
   ========================================= */

.d1-ai-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.d1-ai-input-row textarea {
    flex: 1;
    min-width: 0;
}

.d1-ai-mic {
    width: 42px;
    height: 42px;
    min-width: 42px;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important;
    font-size: 18px !important;
    line-height: 1;
}

.d1-ai-mic-listening {
    animation: d1-ai-mic-pulse 1s infinite;
}

.d1-ai-voice-status {
    margin-top: 6px;
    font-size: 11px;
    color: #536b82;
}

.d1-ai-voice-error {
    margin-top: 6px;
    font-size: 11px;
    color: #a33a2b;
}

@keyframes d1-ai-mic-pulse {

    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.08);
        opacity: .7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@media(max-width:480px) {
    .d1-ai-answer-title {
        font-size: 16px;
    }

    .d1-ai-table {
        font-size: 10px;
    }

    .d1-ai-table th,
    .d1-ai-table td {
        padding: 7px;
    }
}
