.fml-chatbot { position: fixed; right: 22px; bottom: 22px; z-index: 9998; font-family: Inter, system-ui, sans-serif; color: #0f172a; }
.fml-chatbot button, .fml-chatbot textarea { font: inherit; }
.fml-chatbot__sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; clip-path: inset(50%) !important; white-space: nowrap !important; border: 0 !important; }
.fml-chatbot__launcher { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 18px; border: 0; border-radius: 999px; color: #fff; background: linear-gradient(135deg, #4338ca, #6d28d9 58%, #0891b2); box-shadow: 0 12px 34px rgba(15, 23, 42, .24); cursor: pointer; font-weight: 700; }
.fml-chatbot__robot { width: 28px; height: 28px; flex: 0 0 28px; overflow: visible; filter: drop-shadow(0 2px 3px rgba(15,23,42,.2)); transition: transform .2s ease; }
.fml-chatbot__robot-face, .fml-chatbot__robot-ear, .fml-chatbot__robot-antenna-dot { fill: #fff; }
.fml-chatbot__robot-antenna { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; }
.fml-chatbot__robot-eye { fill: #4338ca; }
.fml-chatbot__robot-smile { fill: none; stroke: #4338ca; stroke-width: 1.8; stroke-linecap: round; }
.fml-chatbot__launcher:hover .fml-chatbot__robot { transform: translateY(-1px) rotate(-3deg); }
.fml-chatbot__launcher--attention { animation: fml-chatbot-pulse 1.8s ease-in-out 3; }
.fml-chatbot__nudge { position: absolute; right: calc(100% + 12px); bottom: 0; width: 230px; padding: 13px 34px 13px 15px; border: 1px solid #c7d2fe; border-radius: 14px; color: #1e293b; background: #fff; box-shadow: 0 14px 38px rgba(15,23,42,.18); animation: fml-chatbot-nudge-in .35s ease-out both; }
.fml-chatbot__nudge[hidden] { display: none; }
.fml-chatbot__nudge::after { content: ''; position: absolute; right: -7px; bottom: 17px; width: 12px; height: 12px; border-top: 1px solid #c7d2fe; border-right: 1px solid #c7d2fe; background: #fff; transform: rotate(45deg); }
.fml-chatbot__nudge strong, .fml-chatbot__nudge span { display: block; }
.fml-chatbot__nudge strong { margin-bottom: 3px; color: #312e81; font-size: 14px; }
.fml-chatbot__nudge span { color: #475569; font-size: 13px; line-height: 1.4; }
.fml-chatbot__nudge-close { position: absolute; top: 5px; right: 6px; width: 25px; height: 25px; padding: 0; border: 0; border-radius: 50%; color: #64748b; background: transparent; cursor: pointer; font-size: 19px; line-height: 1; }
.fml-chatbot__nudge-close:hover { color: #312e81; background: #eef2ff; }
.fml-chatbot__launcher:focus-visible, .fml-chatbot button:focus-visible, .fml-chatbot textarea:focus-visible, .fml-chatbot a:focus-visible { outline: 3px solid #67e8f9; outline-offset: 3px; }
.fml-chatbot__panel { position: absolute; right: 0; bottom: 62px; display: grid; grid-template-rows: auto minmax(180px, 1fr) auto auto auto; width: min(380px, calc(100vw - 28px)); height: min(570px, calc(100vh - 110px)); overflow: hidden; border: 1px solid #cbd5e1; border-radius: 18px; background: #fff; box-shadow: 0 22px 60px rgba(11, 16, 32, .28); }
.fml-chatbot__panel[hidden] { display: none; }
.fml-chatbot__header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; color: #f8fafc; background: radial-gradient(circle at 90% 10%, rgba(8,145,178,.35), transparent 45%), #0b1020; }
.fml-chatbot__header strong, .fml-chatbot__header small { display: block; }
.fml-chatbot__header small { margin-top: 2px; color: #cbd5e1; }
.fml-chatbot__close { width: 36px; height: 36px; border: 0; border-radius: 50%; color: #fff; background: rgba(255,255,255,.12); cursor: pointer; font-size: 24px; line-height: 1; }
.fml-chatbot__messages { display: flex; flex-direction: column; align-items: flex-start; overflow-y: auto; padding: 18px; background: linear-gradient(180deg, #f8faff, #eef2ff); }
.fml-chatbot__message { flex: 0 0 auto; width: auto; max-width: 86%; margin: 0 0 12px; padding: 10px 13px; border-radius: 14px; box-shadow: 0 2px 8px rgba(15,23,42,.06); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.fml-chatbot__message p { margin: 0; line-height: 1.5; }
.fml-chatbot__message--assistant { border: 1px solid #e2e8f0; border-bottom-left-radius: 4px; background: #fff; }
.fml-chatbot__stream-word { color: #0f172a; opacity: .08; transition: opacity .48s cubic-bezier(.22, 1, .36, 1); }
.fml-chatbot__stream-word.is-visible { opacity: 1; }
.fml-chatbot__message--user { align-self: flex-end; margin-left: 0; border-bottom-right-radius: 4px; color: #fff; background: #4338ca; }
.fml-chatbot__message--error { border: 1px solid #fed7aa; color: #9a3412; background: #fff7ed; }
.fml-chatbot__message a { display: inline-block; margin-top: 8px; color: #3730a3; font-weight: 700; }
.fml-chatbot__status { min-height: 20px; margin: 0; padding: 4px 16px; color: #475569; background: #fff; font-size: 13px; }
.fml-chatbot__form { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px 12px; border-top: 1px solid #e2e8f0; background: #fff; }
.fml-chatbot__form textarea { min-height: 42px; max-height: 110px; resize: vertical; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 10px; color: #0f172a; background: #fff; }
.fml-chatbot__form button { align-self: end; min-height: 42px; padding: 0 14px; border: 0; border-radius: 10px; color: #fff; background: #c2410c; cursor: pointer; font-weight: 700; }
.fml-chatbot__form button:hover { background: #9a3412; }
.fml-chatbot__form button:disabled, .fml-chatbot__form textarea:disabled { cursor: not-allowed; opacity: .6; }
.fml-chatbot__privacy { padding: 0 14px 12px; color: #64748b; background: #fff; line-height: 1.35; }
@media (max-width: 600px) {
    .fml-chatbot { right: 12px; bottom: 12px; }
    .fml-chatbot__launcher span:last-child { display: none; }
    .fml-chatbot__launcher { width: 50px; padding: 0; justify-content: center; }
    .fml-chatbot__nudge { right: 0; bottom: 62px; width: min(250px, calc(100vw - 36px)); }
    .fml-chatbot__nudge::after { right: 18px; bottom: -7px; transform: rotate(135deg); }
    .fml-chatbot__panel { position: fixed; inset: 10px; width: auto; height: auto; max-height: none; border-radius: 15px; }
}
@media (prefers-reduced-motion: reduce) {
    .fml-chatbot * { scroll-behavior: auto !important; }
    .fml-chatbot__robot { transition: none; }
    .fml-chatbot__launcher:hover .fml-chatbot__robot { transform: none; }
    .fml-chatbot__launcher--attention, .fml-chatbot__nudge { animation: none; }
    .fml-chatbot__stream-word { opacity: 1; transition: none; }
}

@keyframes fml-chatbot-pulse {
    0%, 100% { box-shadow: 0 12px 34px rgba(15,23,42,.24); }
    50% { box-shadow: 0 0 0 9px rgba(99,102,241,.18), 0 16px 40px rgba(15,23,42,.3); }
}
@keyframes fml-chatbot-nudge-in {
    from { opacity: 0; transform: translateX(12px) scale(.96); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}
