.ferrum-chat {position:fixed;right:24px;bottom:24px;z-index:1500;font-family:"Segoe UI",Tahoma,sans-serif;color:#1f2937;}
.ferrum-chat *, .ferrum-chat *::before, .ferrum-chat *::after {box-sizing:border-box;}
.ferrum-chat [hidden] {display:none!important;}
.ferrum-chat__launcher {position:relative;display:inline-flex;align-items:center;gap:12px;border:0;border-radius:999px;padding:14px 18px;background:linear-gradient(135deg,#f36b21,#ff914d);color:#102230;box-shadow:0 18px 42px #181b2647;cursor:pointer;font-size:14px;font-weight:700;}
.ferrum-chat__launcher-icon {display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:50%;background:#ffffff2e;}
.ferrum-chat__unread {position:absolute;right:0;bottom:100%;padding:5px 10px;background:#111827;color:#fff;border-radius:8px;white-space:nowrap;font-size:12px;}
.ferrum-chat__panel {display:flex;flex-direction:column;width:min(420px,calc(100vw - 48px));height:min(640px,calc(100vh - 48px));height:min(640px,calc(100dvh - 48px));border-radius:20px;overflow:hidden;background:#fff;border:1px solid #cbd5e1;box-shadow:0 24px 60px #0f172a38;}
.ferrum-chat[data-expanded="true"] .ferrum-chat__panel {width:min(960px,calc(100vw - 48px));height:calc(100vh - 48px);height:calc(100dvh - 48px);}
.ferrum-chat__header {display:flex;align-items:flex-start;justify-content:space-between;gap:8px;padding:14px;color:#fff;background:linear-gradient(135deg,#111827,#1f2937);flex-shrink:0;}
.ferrum-chat__heading {min-width:0;}
.ferrum-chat__heading strong {display:block;font-size:15px;line-height:1.35;}
.ferrum-chat__status {margin-top:5px;font-size:12px;color:#d1d5db;line-height:1.4;}
.ferrum-chat__tools {display:flex;gap:2px;flex-shrink:0;}
.ferrum-chat__tool {display:inline-flex;align-items:center;justify-content:center;width:34px;height:36px;border:0;border-radius:8px;background:transparent;color:#fff;cursor:pointer;font-size:15px;}
.ferrum-chat__tool:hover {background:#ffffff24;}
.ferrum-chat__tool:disabled {opacity:.4;cursor:not-allowed;}
.ferrum-chat button:focus-visible,.ferrum-chat a:focus-visible {outline:3px solid #f59e0b;outline-offset:2px;}
.ferrum-chat__messages {flex:1;min-height:0;display:flex;flex-direction:column;gap:10px;padding:16px;overflow-y:auto;overscroll-behavior:contain;background:linear-gradient(180deg,#fff7f1,#fff);}
.ferrum-chat__message {max-width:92%;padding:12px 14px;border-radius:16px;font-size:14px;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere;flex-shrink:0;}
.ferrum-chat__message--assistant {align-self:flex-start;color:#1f2937;background:#fff;border:1px solid #cbd5e1;}
.ferrum-chat__message--user {align-self:flex-end;color:#102230;background:#ff994f;}
.ferrum-chat__message--error {border-color:#c2410c;background:#fff7ed;}
.ferrum-chat__message a {display:block;margin-top:8px;color:#075985;text-decoration:underline;font-weight:600;}
.ferrum-chat__form {flex-shrink:0;padding:12px 16px;border-top:1px solid #e2e8f0;background:#fff;}
.ferrum-chat__input {display:block;width:100%;resize:vertical;min-height:58px;max-height:120px;padding:10px 12px;border-radius:12px;border:1px solid #94a3b8;background:#fff;color:#111827;font:inherit;font-size:14px;line-height:1.45;}
.ferrum-chat__input:focus {outline:2px solid #0369a1;outline-offset:1px;}
.ferrum-chat__actions {display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:9px;}
.ferrum-chat__contact-link {color:#334155;font-size:13px;font-weight:600;text-decoration:underline;}
.ferrum-chat__send {border:0;border-radius:999px;padding:9px 18px;background:#111827;color:#fff;cursor:pointer;font-weight:700;}
.ferrum-chat__send:disabled {opacity:.55;cursor:not-allowed;}
.ferrum-chat__storage-note {margin:8px 0 0;color:#64748b;font-size:11px;line-height:1.3;}
@media(max-width:767px) {
  .ferrum-chat {right:12px;bottom:12px;}
  .ferrum-chat__launcher-label {display:none;}
  .ferrum-chat__launcher {padding:12px;}
  .ferrum-chat__panel {width:calc(100vw - 40px);height:min(640px,calc(100dvh - 24px));}
  .ferrum-chat[data-expanded="true"] {left:0;right:0;bottom:0;}
  .ferrum-chat[data-expanded="true"] .ferrum-chat__panel {width:100%;height:100dvh;border-radius:0;}
  .ferrum-chat__header {padding:12px 10px;}
  .ferrum-chat__tool {width:36px;height:40px;}
  .ferrum-chat__input {font-size:16px;}
}
@media(max-height:480px) {.ferrum-chat__storage-note {display:none;}.ferrum-chat__input {min-height:36px;height:36px;}.ferrum-chat__header {padding:8px 12px;}}
