/* MIJUONE v1.9 — anchored, non-modal, real-time chat popover */
.mi-chat-trigger{position:relative;display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:36px;padding:7px 12px;color:#0745ae;font-weight:800;font-size:11px;white-space:nowrap;line-height:1;border:1px solid rgba(143,185,248,.75);border-radius:10px;background:linear-gradient(135deg,rgba(242,248,255,.95),#fff);box-shadow:0 3px 12px rgba(20,79,181,.06);cursor:pointer;transition:transform .18s,box-shadow .18s,border-color .18s,background .18s}
.mi-chat-trigger:hover,.mi-chat-trigger[aria-expanded="true"]{transform:translateY(-1px);border-color:#509bff;background:linear-gradient(135deg,#eaf4ff,#fff);box-shadow:0 7px 20px rgba(11,85,215,.13)}
.mi-chat-trigger .icon{height:17px;width:17px;color:#116eff;flex-shrink:0}
.mi-chat-badge{position:absolute;right:-5px;top:-7px;min-width:16px;height:16px;border:2px solid white;border-radius:99px;background:#f04b60;color:#fff;display:grid;place-items:center;font-size:9px;font-weight:900;padding:0 3px;box-shadow:0 3px 9px rgba(207,51,80,.2)}
.mi-chat-badge[hidden]{display:none!important}
.mi-chat-popover{position:fixed;right:clamp(12px,3vw,52px);top:72px;width:min(400px,calc(100vw - 24px));height:min(580px,calc(100dvh - 88px));max-height:calc(100dvh - 88px);border-radius:19px;background:#fff;z-index:95;display:flex;flex-direction:column;isolation:isolate;overflow:hidden;border:1px solid rgba(179,198,234,.85);box-shadow:0 20px 64px rgba(7,35,93,.24),0 3px 18px rgba(25,79,183,.09);transform-origin:90% 0;animation:miChatEnter .24s cubic-bezier(.16,1,.3,1) both}
.mi-chat-popover[hidden]{display:none!important}
.mi-chat-popover::before{content:"";pointer-events:none;position:absolute;top:0;left:0;right:0;height:4px;background:linear-gradient(90deg,#0076fa,#50d0ff 55%,#7770ff);z-index:2}
.mi-chat-popover button{font-family:inherit}
.mi-chat-head{display:flex;align-items:center;gap:11px;flex:0 0 auto;min-height:76px;padding:16px 18px 12px;background:linear-gradient(130deg,#f2f8ff,#fff 80%);border-bottom:1px solid #e7edf8}
.mi-chat-brand-icon,.mi-chat-toast-icon{height:39px;width:39px;border-radius:13px;display:grid;place-items:center;background:linear-gradient(135deg,#1486ff,#0955d9);color:#fff;box-shadow:0 8px 18px rgba(8,85,217,.22)}
.mi-chat-brand-icon .icon,.mi-chat-toast-icon .icon{height:19px;width:19px}
.mi-chat-heading{display:flex;flex-direction:column;gap:5px;min-width:0;flex:1}
.mi-chat-heading strong{font-size:16px;font-weight:900;color:#102e61;letter-spacing:-.04em}
.mi-chat-heading small{display:flex;align-items:center;gap:6px;font-size:9px;letter-spacing:.12em;color:#6281b4;font-weight:900}
.mi-chat-live,.mi-chat-bottom-dot{width:6px;height:6px;border-radius:50%;background:#2dcb9c;box-shadow:0 0 0 3px rgba(45,203,156,.12)}
.mi-chat-close,.mi-chat-back{width:31px;height:31px;border-radius:9px;display:grid;place-items:center;flex-shrink:0;border:1px solid #e5edfb;background:#fff;color:#45668e;cursor:pointer;transition:background .17s,transform .17s}
.mi-chat-close:hover,.mi-chat-back:hover{background:#eaf3ff;transform:translateY(-1px)}
.mi-chat-close .icon,.mi-chat-back .icon{height:17px;width:17px}
.mi-chat-list-view,.mi-chat-thread-view{display:flex;flex:1;flex-direction:column;min-height:0}
.mi-chat-list-view[hidden],.mi-chat-thread-view[hidden]{display:none!important}
.mi-chat-search-wrap{margin:15px 16px 12px;padding:0 11px;height:44px;display:flex;align-items:center;gap:8px;border:1px solid #dce6f7;background:#f6f9fe;border-radius:12px;transition:box-shadow .18s,border-color .18s}
.mi-chat-search-wrap:focus-within{border-color:#528df0;box-shadow:0 0 0 3px rgba(31,103,228,.1);background:#fff}
.mi-chat-search-wrap .icon{height:17px;width:17px;color:#7090c2}
.mi-chat-search-wrap input{min-width:0;width:100%;flex:1;border:0;outline:none;background:none;color:#183864;font-size:12px;font-family:inherit}
.mi-chat-search-wrap input::placeholder{color:#879bb9}
.mi-chat-search-shortcut{font-size:12px;color:#84a0cc;font-weight:900}
.mi-chat-intro{display:flex;justify-content:space-between;align-items:center;gap:9px;padding:0 18px 12px}
.mi-chat-intro strong{font-size:13px;font-weight:900;color:#17305c}
.mi-chat-intro small{font-size:10px;color:#8495b3;max-width:190px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mi-chat-contacts{overflow-y:auto;min-height:0;flex:1;padding:0 10px 10px;scrollbar-width:thin;scrollbar-color:#d0dff4 transparent}
.mi-chat-contact{width:100%;display:flex;align-items:center;gap:11px;border:0;border-radius:13px;text-align:left;padding:11px 9px;background:#fff;color:#1b3868;cursor:pointer;transition:background .15s,transform .15s}
.mi-chat-contact:hover,.mi-chat-contact:focus-visible{background:#edf5ff;transform:translateX(2px)}
.mi-chat-avatar{height:43px;width:43px;flex:0 0 43px;border-radius:14px;display:grid;place-items:center;background:linear-gradient(135deg,#d8eaff,#b4d0ff);font-size:17px;font-weight:900;color:#0e5ed6;box-shadow:inset 0 1px 0 rgba(255,255,255,.65)}
.mi-chat-avatar[data-tone="1"]{background:linear-gradient(135deg,#e4deff,#c7bcfc);color:#6448c9}
.mi-chat-avatar[data-tone="2"]{background:linear-gradient(135deg,#d6f7ea,#a9e8d1);color:#098b69}
.mi-chat-contact-copy{min-width:0;flex:1;display:flex;flex-direction:column;gap:4px}
.mi-chat-contact-copy strong{font-size:12px;font-weight:850;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mi-chat-contact-copy small{font-size:10px;color:#7d8ca7;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mi-chat-contact-side{display:flex;flex-direction:column;align-items:flex-end;gap:7px;max-width:75px}
.mi-chat-contact-side time{font-size:9px;color:#9badc5;white-space:nowrap}
.mi-chat-unread{min-width:17px;height:17px;padding:2px 4px;border-radius:99px;background:#1766ed;color:#fff;font-weight:900;font-size:9px;text-align:center}
.mi-chat-state{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:11px;text-align:center;font-size:11px;color:#8495b1;line-height:1.7;padding:38px 18px;min-height:130px}
.mi-chat-state .icon{height:26px;width:26px;color:#80b3f8}
.mi-chat-loading{display:block;width:20px;height:20px;border-radius:50%;border:2px solid #dceafe;border-top-color:#2375eb;animation:miChatSpin .8s linear infinite}
.mi-chat-tip{display:flex;align-items:center;gap:6px;flex:0 0 auto;padding:13px 17px;color:#8493ab;border-top:1px solid #eef2fa;font-size:10px;line-height:1.5}
.mi-chat-tip .icon{height:13px;width:13px;color:#4d8ff0}
.mi-chat-conversation-head{display:flex;align-items:center;gap:9px;padding:11px 14px;border-bottom:1px solid #e9eff8;flex:0 0 auto;background:#fff}
.mi-chat-avatar-small{height:34px;width:34px;flex-basis:34px;font-size:13px;border-radius:11px}
.mi-chat-peer-meta{min-width:0;display:flex;flex-direction:column;gap:4px;flex:1}
.mi-chat-peer-meta strong{font-size:12px;color:#122e5b;font-weight:900}
.mi-chat-peer-meta small{font-size:10px;color:#96a5be}
.mi-chat-secure .icon{color:#36b48e;width:15px;height:15px}
.mi-chat-messages{flex:1;min-height:0;overflow-y:auto;padding:18px 15px;display:flex;flex-direction:column;gap:11px;background:radial-gradient(circle at 20% 0,rgba(225,240,255,.4),transparent 40%),linear-gradient(180deg,#fafcff,#f6f9ff);scrollbar-width:thin}
.mi-chat-message{display:flex;flex-direction:column;align-items:flex-start;gap:4px;max-width:84%;animation:miChatBubble .19s ease-out both}
.mi-chat-message.is-mine{align-self:flex-end;align-items:flex-end}
.mi-chat-message-bubble{white-space:pre-wrap;overflow-wrap:anywhere;padding:10px 13px;background:#fff;border:1px solid #e4ebfa;box-shadow:0 3px 8px rgba(28,57,107,.045);border-radius:15px 15px 15px 4px;color:#25395c;font-size:12px;line-height:1.55}
.mi-chat-message.is-mine .mi-chat-message-bubble{color:#fff;background:linear-gradient(135deg,#2482ff,#125bdb);border-color:transparent;border-radius:15px 15px 4px 15px;box-shadow:0 4px 14px rgba(25,100,230,.15)}
.mi-chat-message small{color:#9aadc9;font-size:9px;padding-inline:3px}
.mi-chat-empty-chat{margin:auto;text-align:center;font-size:11px;line-height:1.9;color:#8293b0}
.mi-chat-compose{display:flex;align-items:flex-end;gap:10px;flex:0 0 auto;padding:12px;border-top:1px solid #e5ebf8;background:#fff}
.mi-chat-compose textarea{resize:none;flex:1;min-width:0;min-height:42px;max-height:108px;background:#f6f9fe;border:1px solid #e0e9f9;border-radius:12px;padding:12px;outline:none;line-height:1.55;font:inherit;font-size:11px;color:#213c67}
.mi-chat-compose textarea:focus{border-color:#5c9ef9;box-shadow:0 0 0 3px rgba(33,114,236,.1)}
.mi-chat-compose button{height:40px;width:40px;border:0;border-radius:12px;background:linear-gradient(135deg,#2181ff,#0957d8);box-shadow:0 6px 14px rgba(15,98,226,.19);display:grid;place-items:center;color:#fff;cursor:pointer}
.mi-chat-compose button:disabled{opacity:.55;cursor:wait}
.mi-chat-compose button .icon{height:18px;width:18px}
.mi-chat-bottom{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:8px 17px;font-size:9px;font-weight:800;letter-spacing:.035em;color:#8ba0bc;border-top:1px solid #f0f3f9;background:#fff}
.mi-chat-bottom>span:first-child{display:inline-flex;align-items:center;gap:7px}
.mi-chat-guest{text-align:center;padding:34px 26px;flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center}
.mi-chat-guest-visual{width:80px;height:80px;margin-bottom:18px;border-radius:25px;background:linear-gradient(135deg,#eaf4ff,#c9e2ff);color:#1866df;display:grid;place-items:center}
.mi-chat-guest-visual .icon{width:35px;height:35px}
.mi-chat-guest strong{font-size:17px;color:#0e326f;letter-spacing:-.05em}
.mi-chat-guest p{font-size:12px;line-height:1.85;color:#72839f;margin:12px 0 25px;max-width:290px}
.mi-chat-guest-primary{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;max-width:300px;border-radius:11px;color:#fff!important;font-size:12px;font-weight:850;padding:13px 10px;background:linear-gradient(135deg,#1d80ff,#0754d9)}
.mi-chat-guest-primary .icon{width:14px;height:14px}
.mi-chat-guest-secondary{font-size:11px;font-weight:700;color:#3675d8;margin-top:15px}
.mi-chat-toast{display:flex;gap:10px;align-items:center;position:fixed;right:clamp(15px,3vw,55px);bottom:28px;width:min(340px,calc(100vw - 30px));z-index:94;background:#fff;border-radius:14px;border:1px solid #cadcf5;box-shadow:0 14px 48px rgba(20,59,121,.2);padding:12px 13px;cursor:pointer;animation:miChatEnter .22s ease-out both}
.mi-chat-toast[hidden]{display:none!important}
.mi-chat-toast-icon{flex:0 0 36px;width:36px;height:36px;border-radius:11px}
.mi-chat-toast>div:nth-child(2){flex:1;min-width:0;display:flex;flex-direction:column;gap:5px}
.mi-chat-toast strong{font-size:12px;color:#16376c}.mi-chat-toast small{font-size:10px;color:#7892b6;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}
.mi-chat-toast>button{border:0;background:transparent;color:#7990ad;cursor:pointer}.mi-chat-toast>button .icon{height:14px;width:14px}
.mi-chat-popover :focus-visible,.mi-chat-trigger:focus-visible,.mi-chat-toast :focus-visible{outline:3px solid #50a9ff;outline-offset:2px}
@keyframes miChatEnter{from{opacity:0;transform:translateY(-9px) scale(.975)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes miChatBubble{from{opacity:.35;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}
@keyframes miChatSpin{to{transform:rotate(360deg)}}
@media(max-width:1250px){.mi-chat-trigger{padding:8px 10px}.mi-chat-trigger-label{font-size:10px}}
@media(max-width:750px){.mi-chat-trigger{height:34px;min-height:34px;width:36px;padding:7px}.mi-chat-trigger-label{display:none!important}.mi-chat-trigger .icon{width:18px;height:18px}.mi-chat-popover{top:77px;right:8px;width:min(400px,calc(100vw - 16px));height:min(570px,calc(100dvh - 93px));max-height:calc(100dvh - 93px)}.mi-chat-popover::after{display:none}}
@media(max-width:420px){.mi-chat-popover{top:109px;right:6px;width:calc(100vw - 12px);height:min(560px,calc(100dvh - 116px));max-height:calc(100dvh - 116px);border-radius:15px}.mi-chat-head{padding:14px 15px;min-height:68px}}
@media(prefers-reduced-motion:reduce){.mi-chat-popover,.mi-chat-message,.mi-chat-toast,.mi-chat-loading{animation:none!important}.mi-chat-trigger,.mi-chat-contact,.mi-chat-close,.mi-chat-back{transition:none!important}}
:root[data-theme="dark"] .mi-chat-popover,:root[data-theme="dark"] .mi-chat-head,:root[data-theme="dark"] .mi-chat-bottom,:root[data-theme="dark"] .mi-chat-compose,:root[data-theme="dark"] .mi-chat-conversation-head{background:#172438;border-color:#2d4161}
:root[data-theme="dark"] .mi-chat-heading strong,:root[data-theme="dark"] .mi-chat-intro strong,:root[data-theme="dark"] .mi-chat-contact-copy strong,:root[data-theme="dark"] .mi-chat-peer-meta strong,:root[data-theme="dark"] .mi-chat-guest strong{color:#e9f1ff}
:root[data-theme="dark"] .mi-chat-contact{background:transparent;color:#dde9fb}
:root[data-theme="dark"] .mi-chat-contact:hover{background:#253853}
:root[data-theme="dark"] .mi-chat-search-wrap,:root[data-theme="dark"] .mi-chat-compose textarea{background:#1d304b;border-color:#385070;color:#e8f1ff}
:root[data-theme="dark"] .mi-chat-messages{background:#142137}
:root[data-theme="dark"] .mi-chat-message-bubble{background:#263751;color:#edf3fc;border-color:#385074}
:root[data-theme="dark"] .mi-chat-toast{background:#213450;border-color:#385074}
:root[data-theme="dark"] .mi-chat-toast strong{color:#fff}
