.ku-ai-chatbot {
    --ku-ai-blue: #00AEEF;
    --ku-ai-blue-dark: #087FAE;
    --ku-ai-orange: #F58220;
    --ku-ai-ink: #15384B;
    --ku-ai-muted: #6E8491;
    --ku-ai-border: #E5EDF2;
    --ku-ai-surface: #FFFFFF;
    --ku-ai-soft: #F4FAFD;
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 99990;
    font-family: "Public Sans", "Roboto", Arial, sans-serif;
    color: var(--ku-ai-ink);
    line-height: 1.45;
}
.ku-ai-chatbot[hidden],
.ku-ai-panel[hidden],
.ku-ai-greeting[hidden] { display: none !important; }
.ku-ai-launcher {
    position: relative;
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 58px;
    padding: 0 19px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--ku-ai-blue), var(--ku-ai-blue-dark));
    color: #fff;
    box-shadow: 0 12px 34px rgba(0, 117, 166, .28);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
}
.ku-ai-launcher:hover { transform: translateY(-2px); box-shadow: 0 16px 38px rgba(0,117,166,.34); }
.ku-ai-launcher-spark { font-size: 23px; color: #FFE3C7; }
.ku-ai-launcher-label { font-size: 14px; letter-spacing: .1px; }
.ku-ai-launcher-pulse {
    position: absolute;
    top: 5px;
    right: 6px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--ku-ai-orange);
    box-shadow: 0 0 0 4px rgba(245,130,32,.17);
}
.ku-ai-panel {
    position: absolute;
    right: 0;
    bottom: 74px;
    display: flex;
    flex-direction: column;
    width: 390px;
    max-width: calc(100vw - 32px);
    height: min(620px, calc(100vh - 125px));
    min-height: 390px;
    overflow: hidden;
    border: 1px solid rgba(21,56,75,.10);
    border-radius: 20px;
    background: var(--ku-ai-surface);
    box-shadow: 0 22px 70px rgba(12,43,59,.22);
}
.ku-ai-header {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 16px 17px;
    background: linear-gradient(120deg, #087FAE, #00AEEF);
    color: #fff;
}
.ku-ai-header-mark {
    display: grid;
    place-items: center;
    width: 39px;
    height: 39px;
    flex: 0 0 39px;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 13px;
    background: rgba(255,255,255,.15);
    color: #FFE2C6;
    font-size: 23px;
}
.ku-ai-header-copy { display: flex; flex-direction: column; min-width: 0; }
.ku-ai-header-copy strong { font-size: 14px; font-weight: 750; }
.ku-ai-header-copy span { margin-top: 2px; color: rgba(255,255,255,.86); font-size: 10px; }
.ku-ai-online-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 4px;
    border-radius: 50%;
    background: #B8F4D2;
}
.ku-ai-panel-close {
    margin-left: auto;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.13);
    color: #fff;
    font-size: 23px;
    line-height: 1;
    cursor: pointer;
}
.ku-ai-trust-note {
    padding: 8px 14px;
    border-bottom: 1px solid var(--ku-ai-border);
    background: #F8FCFE;
    color: #6C8290;
    font-size: 10px;
    text-align: center;
}
.ku-ai-messages {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    overflow-y: auto;
    padding: 15px 13px;
    background: #FBFDFE;
}
.ku-ai-welcome-card {
    margin: auto 0;
    padding: 17px 13px;
    border: 1px solid #E6F0F5;
    border-radius: 15px;
    background: #fff;
    text-align: center;
}
.ku-ai-welcome-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    margin: 0 auto 9px;
    border-radius: 13px;
    background: #E9F8FE;
    color: var(--ku-ai-blue-dark);
    font-size: 22px;
}
.ku-ai-welcome-card strong { display: block; color: var(--ku-ai-ink); font-size: 14px; }
.ku-ai-welcome-card p { margin: 6px auto 13px; max-width: 285px; color: var(--ku-ai-muted); font-size: 11px; }
.ku-ai-quick-prompts { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.ku-ai-quick-prompts button {
    padding: 7px 9px;
    border: 1px solid #D9EDF6;
    border-radius: 999px;
    background: #F5FBFE;
    color: #176A8D;
    font: inherit;
    font-size: 10px;
    cursor: pointer;
}
.ku-ai-message {
    max-width: 88%;
    padding: 10px 12px;
    border-radius: 14px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 12px;
    line-height: 1.55;
}
.ku-ai-message-user {
    align-self: flex-end;
    border-bottom-right-radius: 5px;
    background: #E4F5FC;
    color: #164C66;
}
.ku-ai-message-assistant {
    align-self: flex-start;
    max-width: 96%;
    border: 1px solid #E7EEF2;
    border-bottom-left-radius: 5px;
    background: #fff;
    color: #294858;
}
.ku-ai-markdown {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
}
.ku-ai-markdown > :first-child { margin-top: 0; }
.ku-ai-markdown > :last-child { margin-bottom: 0; }
.ku-ai-markdown p { margin: 0 0 9px; line-height: 1.65; }
.ku-ai-markdown h1,
.ku-ai-markdown h2,
.ku-ai-markdown h3,
.ku-ai-markdown h4 {
    margin: 13px 0 7px;
    color: #15384B;
    font-weight: 750;
    line-height: 1.35;
}
.ku-ai-markdown h1 { font-size: 16px; }
.ku-ai-markdown h2 { font-size: 14px; }
.ku-ai-markdown h3 { font-size: 13px; }
.ku-ai-markdown h4 { font-size: 12px; }
.ku-ai-markdown strong { color: #173F55; font-weight: 750; }
.ku-ai-markdown a { color: #087FAE; text-decoration: underline; text-underline-offset: 2px; }
.ku-ai-markdown ul,
.ku-ai-markdown ol {
    margin: 4px 0 11px;
    padding-left: 21px;
}
.ku-ai-markdown li { margin: 4px 0; padding-left: 2px; line-height: 1.55; }
.ku-ai-markdown blockquote {
    margin: 8px 0 11px;
    padding: 7px 10px;
    border-left: 3px solid #7BC8E4;
    border-radius: 0 7px 7px 0;
    background: #F4FAFD;
    color: #486474;
}
.ku-ai-markdown hr { margin: 11px 0; border: 0; border-top: 1px solid #E7EEF2; }
.ku-ai-markdown code {
    padding: 1px 4px;
    border-radius: 4px;
    background: #F0F5F7;
    color: #31566A;
    font-family: Consolas, Monaco, monospace;
    font-size: .92em;
}
.ku-ai-markdown .ku-ai-code-block {
    max-width: 100%;
    margin: 8px 0 11px;
    padding: 10px;
    overflow-x: auto;
    border: 1px solid #E5EDF2;
    border-radius: 8px;
    background: #F6F9FA;
    white-space: pre;
}
.ku-ai-markdown .ku-ai-code-block code { padding: 0; background: transparent; }
.ku-ai-table-wrap {
    max-width: 100%;
    margin: 8px 0 11px;
    overflow-x: auto;
    border: 1px solid #E1EAF0;
    border-radius: 8px;
    -webkit-overflow-scrolling: touch;
}
.ku-ai-markdown-table {
    width: 100%;
    min-width: 290px;
    border-collapse: collapse;
    font-size: 10px;
    line-height: 1.45;
}
.ku-ai-markdown-table th,
.ku-ai-markdown-table td {
    min-width: 65px;
    padding: 7px 8px;
    border-right: 1px solid #E8EEF2;
    border-bottom: 1px solid #E8EEF2;
    text-align: left;
    vertical-align: top;
}
.ku-ai-markdown-table th {
    background: #F0F8FB;
    color: #174B64;
    font-weight: 750;
    white-space: nowrap;
}
.ku-ai-markdown-table tr:last-child td { border-bottom: 0; }
.ku-ai-markdown-table th:last-child,
.ku-ai-markdown-table td:last-child { border-right: 0; }
.ku-ai-citation {
    display: inline-block;
    margin: 0 1px;
    padding: 0 4px;
    border: 1px solid #D6EAF3;
    border-radius: 5px;
    background: #F2FAFD;
    color: #087FAE;
    font-size: .85em;
    font-weight: 700;
    vertical-align: 1px;
}
.ku-ai-answer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #EDF2F5;
}
.ku-ai-answer-action {
    padding: 4px 8px;
    border: 1px solid #DCECF3;
    border-radius: 7px;
    background: #F8FCFE;
    color: #176A8D;
    font: inherit;
    font-size: 10px;
    cursor: pointer;
}
.ku-ai-answer-action:hover { background: #EAF7FC; }
.ku-ai-download-primary { border-color: #B9DCEB; background: #F0F9FD; font-weight: 650; }
.ku-ai-download-menu { position: relative; display: inline-block; font-size: 10px; }
.ku-ai-download-menu > summary {
    display: inline-flex; align-items: center; gap: 6px; list-style: none;
    padding: 4px 9px; border: 1px solid #B9DCEB; border-radius: 7px;
    background: #F0F9FD; color: #176A8D; font: inherit; font-size: 10px;
    font-weight: 650; cursor: pointer;
}
.ku-ai-download-menu > summary::-webkit-details-marker { display: none; }
.ku-ai-download-menu > summary::after { content: '▾'; font-size: 10px; }
.ku-ai-download-options {
    position: absolute; z-index: 5; left: 0; bottom: calc(100% + 5px);
    display: flex; flex-direction: column; min-width: 132px; padding: 5px;
    border: 1px solid #DCE8EE; border-radius: 9px; background: #fff;
    box-shadow: 0 8px 22px rgba(20, 55, 72, .14);
}
.ku-ai-download-option {
    padding: 7px 9px; border: 0; border-radius: 6px; background: transparent;
    color: #176A8D; text-align: left; font: inherit; font-size: 10px; cursor: pointer;
}
.ku-ai-download-option:hover { background: #EAF7FC; }
.ku-ai-message-error { border-color: #F4D6C4; background: #FFF9F5; }
.ku-ai-message-error .ku-ai-markdown { white-space: pre-wrap; }
.ku-ai-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 9px;
    padding-top: 8px;
    border-top: 1px solid #EDF2F5;
}
.ku-ai-source-link,
.ku-ai-source-label {
    display: inline-flex;
    align-items: center;
    padding: 4px 7px;
    border: 1px solid #DCECF3;
    border-radius: 7px;
    background: #F6FBFD;
    color: #087FAE;
    font-size: 9px;
    text-decoration: none;
}
.ku-ai-source-link:hover { color: #075E82; background: #EAF7FC; }
.ku-ai-typing { display: inline-flex; align-items: center; gap: 4px; min-width: 49px; }
.ku-ai-typing span { width: 5px; height: 5px; border-radius: 50%; background: #8BA5B2; animation: ku-ai-bounce .9s infinite ease-in-out; }
.ku-ai-typing span:nth-child(2) { animation-delay: .12s; }
.ku-ai-typing span:nth-child(3) { animation-delay: .24s; }
@keyframes ku-ai-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .55; } 30% { transform: translateY(-4px); opacity: 1; } }
.ku-ai-composer {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 11px 7px;
    border-top: 1px solid var(--ku-ai-border);
    background: #fff;
}
.ku-ai-composer textarea {
    display: block;
    flex: 1;
    min-width: 0;
    max-height: 105px;
    resize: none;
    padding: 10px 11px;
    border: 1px solid #DDE8EE;
    border-radius: 12px;
    outline: none;
    background: #FAFCFD;
    color: var(--ku-ai-ink);
    font: inherit;
    font-size: 12px;
    line-height: 1.4;
}
.ku-ai-composer textarea:focus { border-color: var(--ku-ai-blue); box-shadow: 0 0 0 3px rgba(0,174,239,.10); }
.ku-ai-composer button {
    display: grid;
    place-items: center;
    width: 39px;
    height: 39px;
    flex: 0 0 39px;
    border: 0;
    border-radius: 12px;
    background: var(--ku-ai-blue-dark);
    color: #fff;
    cursor: pointer;
}
.ku-ai-composer button:disabled { opacity: .5; cursor: not-allowed; }
.ku-ai-composer button svg { width: 19px; height: 19px; fill: currentColor; }
.ku-ai-footer-note { padding: 0 12px 9px; background: #fff; color: #9AAAB2; font-size: 9px; text-align: center; }
.ku-ai-greeting {
    position: absolute;
    right: 0;
    bottom: 72px;
    display: flex;
    align-items: center;
    gap: 8px;
    width: max-content;
    max-width: min(310px, calc(100vw - 36px));
    padding: 11px 12px;
    border: 1px solid #DCECF3;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(12,43,59,.15);
    color: #315366;
    font-size: 11px;
}
.ku-ai-greeting-dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--ku-ai-orange); }
.ku-ai-greeting-close { margin-left: 4px; border: 0; background: transparent; color: #8296A0; font-size: 18px; cursor: pointer; }
.ku-ai-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 520px) {
    .ku-ai-chatbot { right: 13px; bottom: 13px; }
    .ku-ai-launcher { min-height: 52px; padding: 0 15px; }
    .ku-ai-panel { right: -2px; bottom: 64px; width: calc(100vw - 26px); max-width: calc(100vw - 26px); height: min(74vh, 610px); min-height: 350px; border-radius: 17px; }
    .ku-ai-message-assistant { max-width: 99%; }
    .ku-ai-markdown-table { font-size: 9px; }
    .ku-ai-markdown-table th, .ku-ai-markdown-table td { padding: 6px 7px; }
}
