:root {
    --db24-ai-bg: #07111f;
    --db24-ai-panel: #0b1728;
    --db24-ai-panel-2: #101f34;
    --db24-ai-line: rgba(148, 163, 184, .25);
    --db24-ai-text: #f8fafc;
    --db24-ai-muted: #a9b7ca;
    --db24-ai-accent: #38bdf8;
    --db24-ai-accent-2: #0ea5e9;
    --db24-ai-good: #22c55e;
    --db24-ai-danger: #f87171;
    --db24-ai-shadow: 0 24px 75px rgba(2, 6, 23, .46);
}

.db24-ai { position: fixed !important; right: 22px !important; bottom: 22px !important; left: auto !important; top: auto !important; z-index: 2147482000 !important; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--db24-ai-text); line-height: 1.45; }
.db24-ai *, .db24-ai *::before, .db24-ai *::after { box-sizing: border-box; }
.db24-ai button, .db24-ai input, .db24-ai textarea, .db24-ai select { font: inherit; }
.db24-ai button { cursor: pointer; }

.db24-ai__launcher { width: 62px; height: 62px; padding: 0; border: 1px solid rgba(255,255,255,.24); border-radius: 50%; display: grid; place-items: center; position: relative; overflow: visible; color: #fff; background: linear-gradient(145deg, #0369a1, #0ea5e9 58%, #67e8f9); box-shadow: 0 14px 38px rgba(2,132,199,.4), 0 4px 12px rgba(2,6,23,.28); transition: transform .2s ease, box-shadow .2s ease; }
.db24-ai__launcher:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 17px 46px rgba(2,132,199,.5), 0 4px 12px rgba(2,6,23,.3); }
.db24-ai__launcher:focus-visible, .db24-ai button:focus-visible, .db24-ai input:focus-visible, .db24-ai textarea:focus-visible, .db24-ai select:focus-visible { outline: 3px solid rgba(56,189,248,.48); outline-offset: 2px; }
.db24-ai__launcher-label { position: absolute; right: 73px; top: 50%; min-width: 154px; padding: 9px 13px 9px 14px; border: 1px solid rgba(125,211,252,.38); border-radius: 14px; color: #fff; background: rgba(7,17,31,.96); box-shadow: 0 12px 34px rgba(2,6,23,.38); text-align: left; transform: translateY(-50%); pointer-events: none; backdrop-filter: blur(12px); }
.db24-ai__launcher-label::after { content: ""; position: absolute; right: -7px; top: 50%; width: 12px; height: 12px; border-top: 1px solid rgba(125,211,252,.38); border-right: 1px solid rgba(125,211,252,.38); background: rgba(7,17,31,.96); transform: translateY(-50%) rotate(45deg); }
.db24-ai__launcher-label strong, .db24-ai__launcher-label small { position: relative; z-index: 1; display: block; }
.db24-ai__launcher-label strong { font-size: 13px; line-height: 1.15; letter-spacing: 0; }
.db24-ai__launcher-label small { margin-top: 2px; color: #a9dff8; font-size: 11px; line-height: 1.15; white-space: nowrap; }
.db24-ai.is-open .db24-ai__launcher-label { opacity: 0; visibility: hidden; transform: translateY(-50%) translateX(8px); }
.db24-ai__launcher-mark { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; background: rgba(3, 20, 38, .42); font-weight: 900; letter-spacing: -.05em; font-size: 17px; }
.db24-ai__launcher-pulse { position: absolute; inset: -5px; border: 2px solid rgba(56,189,248,.5); border-radius: 50%; animation: db24-ai-pulse 2.8s ease-out infinite; pointer-events: none; }
@keyframes db24-ai-pulse { 0% { transform: scale(.78); opacity: 0; } 30% { opacity: .7; } 100% { transform: scale(1.25); opacity: 0; } }

.db24-ai__panel { position: absolute; right: 0; bottom: 76px; width: min(410px, calc(100vw - 28px)); height: min(690px, calc(100vh - 116px)); display: grid; grid-template-rows: auto auto minmax(0,1fr) auto auto auto; overflow: hidden; border: 1px solid var(--db24-ai-line); border-radius: 22px; background: radial-gradient(circle at 85% -15%, rgba(14,165,233,.18), transparent 36%), var(--db24-ai-bg); box-shadow: var(--db24-ai-shadow); opacity: 0; visibility: hidden; transform: translateY(16px) scale(.975); transform-origin: bottom right; transition: opacity .2s ease, transform .2s ease, visibility .2s; }
.db24-ai.is-open .db24-ai__panel { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.db24-ai.is-open .db24-ai__launcher { transform: scale(.92); }

.db24-ai__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 16px; border-bottom: 1px solid var(--db24-ai-line); background: rgba(11,23,40,.92); backdrop-filter: blur(14px); }
.db24-ai__brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.db24-ai__brand strong { display: block; color: #fff; font-size: 15px; }
.db24-ai__brand small { display: block; color: var(--db24-ai-muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db24-ai__avatar { flex: 0 0 auto; width: 39px; height: 39px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(145deg,#0284c7,#22d3ee); color: #fff; font-size: 13px; font-weight: 900; letter-spacing: -.04em; box-shadow: 0 8px 24px rgba(14,165,233,.25); }
.db24-ai__header-actions { display: flex; gap: 5px; }
.db24-ai__icon-button { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 10px; color: var(--db24-ai-muted); background: transparent; font-size: 21px; line-height: 1; }
.db24-ai__icon-button:hover, .db24-ai__icon-button[aria-pressed="true"] { color: #fff; border-color: var(--db24-ai-line); background: rgba(148,163,184,.1); }

.db24-ai__toolbar { min-height: 42px; padding: 7px 12px; display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 8px; border-bottom: 1px solid rgba(148,163,184,.13); background: rgba(15,31,52,.64); }
.db24-ai__language { flex: 0 0 auto; max-width: 175px; min-height: 29px; padding: 3px 28px 3px 9px; border: 1px solid var(--db24-ai-line); border-radius: 9px; color: #e2e8f0; background: #0f1f34; font-size: 12px; }
.db24-ai__status { flex: 1 1 185px; min-width: 0; max-width: 100%; color: var(--db24-ai-muted); font-size: 11px; line-height: 1.35; text-align: start; white-space: normal !important; overflow: visible; text-overflow: clip; overflow-wrap: break-word; word-break: normal; hyphens: auto; }
.db24-ai__status.is-busy::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-inline-end: 6px; border-radius: 50%; background: var(--db24-ai-accent); animation: db24-ai-blink 1s ease-in-out infinite; }
@keyframes db24-ai-blink { 50% { opacity: .25; } }

.db24-ai__messages { width: 100%; min-width: 0; min-height: 0; overflow-y: auto; overflow-anchor: none; padding: 16px 13px 12px; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: #334155 transparent; }
.db24-ai__message { width: 100%; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; margin: 0 0 12px; animation: db24-ai-enter .22s ease both; }
.db24-ai__message--user { align-items: flex-end; }
@keyframes db24-ai-enter { from { opacity: 0; transform: translateY(6px); } }
.db24-ai__bubble { min-width: 0; max-width: 88%; padding: 10px 12px; border: 1px solid rgba(148,163,184,.2); border-radius: 15px 15px 15px 5px; color: #e8eef8; background: var(--db24-ai-panel-2); font-size: 14px; line-height: 1.5; white-space: normal !important; overflow-wrap: break-word; word-break: normal; hyphens: auto; }
.db24-ai__message.is-connection-wait .db24-ai__bubble { width: 100%; max-width: 100%; }
.db24-ai__message--user .db24-ai__bubble { border-color: rgba(56,189,248,.3); border-radius: 15px 15px 5px 15px; color: #fff; background: linear-gradient(145deg,#075985,#0369a1); }
.db24-ai__bubble p { margin: 0 0 11px; }
.db24-ai__bubble p + p { margin-top: 3px; }
.db24-ai__bubble p:first-child { margin-top: 0; }
.db24-ai__bubble p:last-child { margin-bottom: 0; }
.db24-ai__bubble ul, .db24-ai__bubble ol { padding-inline-start: 23px; margin: 10px 0 13px; }
.db24-ai__bubble p + ul, .db24-ai__bubble p + ol { margin-top: 4px; }
.db24-ai__bubble li { margin: 0 0 9px; padding-inline-start: 2px; }
.db24-ai__bubble li:last-child { margin-bottom: 0; }
.db24-ai__bubble ul + p, .db24-ai__bubble ol + p { margin-top: 12px; }
.db24-ai__bubble strong { color: #f8fafc; }
.db24-ai__bubble a { color: #7dd3fc; text-decoration: underline; }
.db24-ai__message.is-error .db24-ai__bubble { border-color: rgba(248,113,113,.4); color: #fecaca; background: rgba(127,29,29,.32); }
.db24-ai__typing { width: 58px; padding: 12px; display: flex; align-items: center; gap: 4px; border: 1px solid var(--db24-ai-line); border-radius: 15px 15px 15px 5px; background: var(--db24-ai-panel-2); }
.db24-ai__typing.is-labeled { width: auto; max-width: 88%; gap: 9px; }
.db24-ai__typing-label { min-width: 0; color: #cbd5e1; font-size: 12px; line-height: 1.35; white-space: normal !important; overflow-wrap: break-word; word-break: normal; hyphens: auto; }
.db24-ai__typing-dots { flex: 0 0 auto; display: flex; gap: 4px; }
.db24-ai__typing span { width: 6px; height: 6px; border-radius: 50%; background: #7dd3fc; animation: db24-ai-dot 1.15s infinite ease-in-out; }
.db24-ai__typing span:nth-child(2) { animation-delay: .14s; }
.db24-ai__typing span:nth-child(3) { animation-delay: .28s; }
@keyframes db24-ai-dot { 0%,60%,100% { transform: translateY(0); opacity: .35; } 30% { transform: translateY(-5px); opacity: 1; } }

.db24-ai__extras { width: min(92%, 355px); margin-top: 7px; }
.db24-ai__guide { display: grid; gap: 6px; }
.db24-ai__guide-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 9px; border: 1px solid rgba(148,163,184,.18); border-radius: 10px; color: #dce7f5; background: rgba(15,31,52,.73); font-size: 12px; }
.db24-ai__guide-row span { flex: 1; }
.db24-ai__guide-row button, .db24-ai__actions button, .db24-ai__inline-human, .db24-ai__quick button { padding: 7px 9px; border: 1px solid rgba(56,189,248,.28); border-radius: 9px; color: #dff6ff; background: rgba(2,132,199,.17); font-size: 11px; font-weight: 700; }
.db24-ai__guide-row button:hover, .db24-ai__actions button:hover, .db24-ai__inline-human:hover, .db24-ai__quick button:hover { border-color: rgba(56,189,248,.55); background: rgba(2,132,199,.31); }
.db24-ai__actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 7px; }
.db24-ai__inline-human { margin-top: 7px; }

.db24-ai__dynamic { padding: 0 12px; background: var(--db24-ai-bg); }
.db24-ai__dynamic:empty { display: none; }
.db24-ai__quick { display: flex; gap: 6px; padding: 0 0 10px; overflow-x: auto; scrollbar-width: none; }
.db24-ai__quick::-webkit-scrollbar { display: none; }
.db24-ai__quick button { flex: 0 0 auto; white-space: nowrap; }
.db24-ai__secure-form, .db24-ai__handoff { max-height: 340px; overflow-y: auto; padding: 12px; margin-bottom: 9px; border: 1px solid rgba(56,189,248,.3); border-radius: 14px; background: rgba(15,31,52,.95); }
.db24-ai__secure-form > strong, .db24-ai__handoff > strong { display: block; margin-bottom: 9px; font-size: 13px; }
.db24-ai__code-row { display: grid; grid-template-columns: 1fr auto; gap: 7px; }
.db24-ai__code-row input { text-align: center; letter-spacing: .34em; font-size: 20px; font-weight: 800; }
.db24-ai__secure-form input, .db24-ai__handoff input, .db24-ai__handoff textarea, .db24-ai__handoff select { width: 100%; min-height: 39px; margin-top: 4px; padding: 8px 9px; border: 1px solid rgba(148,163,184,.28); border-radius: 9px; color: #f8fafc; background: #07111f; }
.db24-ai__handoff textarea { resize: vertical; }
.db24-ai__secure-form button, .db24-ai__primary-wide { min-height: 39px; padding: 8px 12px; border: 0; border-radius: 9px; color: #fff; background: linear-gradient(145deg,#0284c7,#0ea5e9); font-weight: 800; }
.db24-ai__text-button { margin-top: 7px; color: #7dd3fc !important; background: transparent !important; font-size: 12px; font-weight: 600 !important; }
.db24-ai__form-note { margin: 8px 0 0; color: #fbbf24; font-size: 11px; }
.db24-ai__known { margin: 0 0 9px; color: var(--db24-ai-muted); font-size: 11px; }
.db24-ai__form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.db24-ai__form-grid label { color: #cbd5e1; font-size: 11px; }
.db24-ai__form-grid .is-wide { grid-column: 1 / -1; }
.db24-ai__confirm { display: flex; align-items: flex-start; gap: 7px; padding: 7px; border-radius: 8px; background: rgba(251,191,36,.08); }
.db24-ai__confirm input { width: auto; min-height: 0; margin: 2px 0 0; }
.db24-ai__handoff .db24-ai__primary-wide { width: 100%; margin-top: 10px; }

.db24-ai__composer { display: grid; grid-template-columns: minmax(0,1fr) 38px 40px; align-items: end; gap: 6px; padding: 10px 11px 8px; border-top: 1px solid rgba(148,163,184,.16); background: rgba(11,23,40,.96); }
.db24-ai__input { width: 100%; min-height: 42px; max-height: 130px; resize: none; padding: 10px 11px; border: 1px solid rgba(148,163,184,.25); border-radius: 12px; color: #f8fafc; background: #07111f; font-size: 14px; line-height: 1.35; }
.db24-ai__input::placeholder { color: #8291a5; }
.db24-ai__mic, .db24-ai__send { width: 38px; height: 38px; padding: 0; display: grid; place-items: center; border: 1px solid rgba(148,163,184,.24); border-radius: 11px; color: #dce7f5; background: #101f34; }
.db24-ai__send { width: 40px; color: #fff; border-color: transparent; background: linear-gradient(145deg,#0284c7,#0ea5e9); }
.db24-ai__mic:hover { background: #172a45; }
.db24-ai.is-listening .db24-ai__mic { color: #fff; border-color: rgba(248,113,113,.65); background: #b91c1c; animation: db24-ai-mic 1s ease-in-out infinite; }
@keyframes db24-ai-mic { 50% { transform: scale(.92); } }
.db24-ai__footer { padding: 0 12px 8px; color: #718198; background: rgba(11,23,40,.96); text-align: center; font-size: 9.5px; }

.db24-ai[dir="rtl"] .db24-ai__panel { transform-origin: bottom left; }
.db24-ai[dir="rtl"] .db24-ai__bubble { border-radius: 15px 15px 5px 15px; }
.db24-ai[dir="rtl"] .db24-ai__message--user .db24-ai__bubble { border-radius: 15px 15px 15px 5px; }

.db24-ai-guide-target { position: relative !important; z-index: 2147481999 !important; outline: 4px solid #38bdf8 !important; outline-offset: 5px !important; border-radius: 8px !important; animation: db24-ai-target 1s ease-in-out infinite alternate !important; }
@keyframes db24-ai-target { from { box-shadow: 0 0 0 4px rgba(56,189,248,.12); } to { box-shadow: 0 0 0 14px rgba(56,189,248,.3); } }

@media (max-width: 600px) {
    .db24-ai { right: 14px !important; bottom: 14px !important; }
    .db24-ai__launcher { width: 58px; height: 58px; }
    .db24-ai__launcher-label { right: 68px; min-width: 126px; padding: 8px 11px; }
    .db24-ai__launcher-label strong { font-size: 12px; }
    .db24-ai__launcher-label small { font-size: 10px; }
    .db24-ai__panel { position: fixed; inset: 0; width: 100vw; height: 100dvh; max-height: none; border-radius: 0; border: 0; transform: translateY(24px); }
    .db24-ai.is-open .db24-ai__panel { transform: translateY(0); }
    .db24-ai.is-open .db24-ai__launcher { opacity: 0; pointer-events: none; }
    .db24-ai__header { padding-top: max(14px, env(safe-area-inset-top)); }
    .db24-ai__footer { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
    .db24-ai__messages { padding-inline: 12px; }
    .db24-ai__bubble { max-width: 91%; }
    .db24-ai__secure-form, .db24-ai__handoff { max-height: 46vh; }
}

@media (prefers-reduced-motion: reduce) {
    .db24-ai *, .db24-ai *::before, .db24-ai *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .001ms !important; }
}

@media (max-width: 520px) {
    .db24-ai__toolbar { display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; }
    .db24-ai__language { width: 100%; max-width: none; }
    .db24-ai__status { width: 100%; text-align: start; }
}
