
.anmed-chat-floating{position:fixed;right:20px;bottom:90px;z-index:10000}
.anmed-toggle{background:#2563eb;color:#fff;border:none;padding:12px 18px;border-radius:999px;cursor:pointer;box-shadow:0 4px 16px rgba(0,0,0,.15);font-size:18px;font-weight:bold;outline:2px solid transparent;outline-offset:2px;transition:box-shadow .2s,outline .2s}
.anmed-toggle:focus-visible{outline:2px solid #1a202c;box-shadow:0 0 0 4px #93c5fd}

/* Toggle button group for department selection */
.anmed-toggle-group{display:flex;gap:10px;flex-wrap:wrap}


.anmed-box{width:380px;max-width:98vw;max-height:calc(100vh - 90px);background:#fff;border:2px solid #2563eb;border-radius:16px;display:flex;flex-direction:column;overflow:hidden;box-shadow:0 12px 32px rgba(0,0,0,.18)}
.anmed-header{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;border-bottom:2px solid #2563eb;background:#2563eb;color:#fff;}
.anmed-header .title{font-size:18px;font-weight:bold;letter-spacing:0.5px;}
.anmed-header .actions{display:flex;gap:6px}
.anmed-header .gear,
.anmed-header .close{background:transparent;border:0;font-size:20px;cursor:pointer;line-height:1;padding:4px 8px;border-radius:8px;color:#fff;}
.anmed-header .gear{color:#fff}
.anmed-header .gear svg{display:block;fill:currentColor;color:#fff;width:20px;height:20px}
.anmed-header .mute{background:transparent;border:0;font-size:18px;color:#fff;cursor:pointer;line-height:1;padding:4px 8px;border-radius:8px}
.anmed-header .minimize{background:transparent;border:0;font-size:18px;color:#fff;cursor:pointer;line-height:1;padding:4px 8px;border-radius:8px}
.anmed-header .gear:focus-visible,
.anmed-header .close:focus-visible{outline:2px solid #fff;background:#1e293b;}
.anmed-header .gear:hover,
.anmed-header .close:hover{background:#1e293b;color:#fff;}


.settings-panel{padding:8px 10px;border-bottom:1.5px solid #2563eb;background:#f3f4f6;}
.settings-row{font-size:15px;display:flex;align-items:center;gap:8px;color:#1a202c;}


.msgs{padding:12px;overflow:auto;flex:1;min-height:320px;background:#fff;}
.anmed-dept-bar{background:#eff6ff;color:#1e3a8a;border-bottom:1.5px solid #2563eb;padding:8px 12px;font-weight:700;letter-spacing:.3px}
.msg{margin:8px 0;padding:10px 14px;border-radius:10px;max-width:85%;font-size:16px;line-height:1.5;word-break:break-word;box-shadow:0 1px 4px rgba(0,0,0,.04);}
.msg{display:flex;gap:10px;align-items:flex-start}
.msg .avatar{width:32px;height:32px;border-radius:999px;flex:0 0 32px;overflow:hidden;background:#cbd5e1;display:none}
.msg .avatar img{width:100%;height:100%;object-fit:cover;display:block}
.msg .sender-label{display:block;font-size:12px;color:#374151;font-weight:700;text-transform:uppercase;margin-bottom:6px}
.msg .time{opacity:.7;font-size:13px;margin-right:8px;}
.msg .payload{flex:1}
.msg.visitor{background:#e0e7ff;color:#1e293b;}
.msg.operator{background:#d1fae5;margin-left:auto;color:#065f46;}
.msg.operator .avatar{display:block}
.msg.system{background:#f8fafc;color:#334155;border:1.5px dashed #2563eb;}
.msg.system.transfer{background:#fef9c3;color:#78350f;border-color:#f59e0b}


.composer{display:flex;flex-direction:column;gap:10px;border-top:2px solid #2563eb;padding:12px;background:#f9fafb;}
.composer label{font-size:15px;font-weight:bold;color:#1a202c;margin-bottom:2px;}
.composer input[type="email"],
.composer input[type="text"],
.composer textarea{flex:1;border:2px solid #2563eb;border-radius:10px;padding:10px;font-size:16px;background:#fff;color:#1a202c;outline:none;transition:border-color .2s,box-shadow .2s;max-width:320px;margin:10px;}
.composer input[type="email"]:focus,
.composer textarea:focus{border-color:#1e293b;box-shadow:0 0 0 2px #93c5fd;}
.composer .send{background:#2563eb;color:#fff;border:none;padding:10px 18px;border-radius:10px;font-size:16px;font-weight:bold;cursor:pointer;outline:2px solid transparent;outline-offset:2px;transition:box-shadow .2s,outline .2s;max-width:120px;margin:10px;}

@media (max-width:480px), (max-height:720px){
/* Allow the chat to breathe on short screens so the send button stays visible */
.anmed-box{width:min(360px,96vw);max-height:calc(100vh - 80px);}
.msgs{min-height:200px;}
.composer{padding:10px;gap:8px;}
.composer input[type="email"],
.composer input[type="text"],
.composer textarea{max-width:100%;margin:0;}
.composer .send{max-width:none;width:100%;margin:0;}
}
.composer .send:focus-visible{outline:2px solid #1a202c;box-shadow:0 0 0 4px #93c5fd;}
.composer .send:hover{background:#1e293b;}


/* Wybór oddziału nad polem pisania */
.dept-chooser{display:flex;gap:8px;align-items:center;padding:10px 14px;border-top:2px dashed #2563eb;border-bottom:2px dashed #2563eb;background:#f3f4f6;}
.dept-chooser .dept-label{font-size:15px;color:#1a202c;font-weight:bold;}
.dept-chooser .dept-select{flex:1;border:2px solid #2563eb;border-radius:8px;padding:8px;font-size:16px;background:#fff;color:#1a202c;}

/* Centered modal (custom confirm) */
.anmed-modal-overlay{position:fixed;inset:0;z-index:200000;background:rgba(15,23,42,.55);display:flex;align-items:center;justify-content:center;padding:20px;animation:anmedFadeIn .15s ease-out;}
@keyframes anmedFadeIn{from{opacity:0}to{opacity:1}}
.anmed-modal{background:#fff;border:2px solid #2563eb;border-radius:18px;max-width:420px;width:100%;box-shadow:0 12px 40px rgba(0,0,0,.25);display:flex;flex-direction:column;outline:none;font-family:inherit;}
.anmed-modal-header{font-size:19px;font-weight:700;padding:18px 20px;background:#2563eb;color:#fff;border-bottom:2px solid #1e40af;border-top-left-radius:16px;border-top-right-radius:16px;}
.anmed-modal-body{padding:18px 20px;font-size:15px;line-height:1.5;color:#1e293b;}
.anmed-modal-actions{display:flex;gap:12px;justify-content:flex-end;padding:16px 20px;background:#f1f5f9;border-top:1.5px solid #e2e8f0;border-bottom-left-radius:16px;border-bottom-right-radius:16px;}
.anmed-btn{font-size:15px;font-weight:600;padding:10px 18px;border-radius:10px;border:2px solid transparent;cursor:pointer;line-height:1;background:#2563eb;color:#fff;transition:background .15s,box-shadow .15s,transform .05s;}
.anmed-btn:hover{background:#1e3a8a;}
.anmed-btn:active{transform:translateY(1px);}
.anmed-btn:focus-visible{outline:2px solid #1e293b;box-shadow:0 0 0 4px #93c5fd;}
.anmed-btn-cancel{background:#64748b;}
.anmed-btn-cancel:hover{background:#475569;}
.anmed-btn-danger{background:#dc2626;}
.anmed-btn-danger:hover{background:#b91c1c;}
