.chat-dock{position:fixed;z-index:40;bottom:max(15px,env(safe-area-inset-bottom));right:clamp(12px,3vw,28px);color:#202955;font-size:13px}
.chat-launch{display:flex;align-items:center;gap:7px;margin-left:auto;padding:9px 12px;border:1px solid #4e4b87;border-radius:9px;background:#393268;color:#fff;box-shadow:0 4px 14px #29265337;font-size:12px;font-weight:800}
.chat-launch span{color:#d5b95a;font-size:10px}.chat-launch b{color:#261e46;background:#f3df9d;border-radius:20px;padding:1px 6px;font-size:11px}
.chat-panel{position:absolute;bottom:46px;right:0;width:min(365px,calc(100vw - 24px));max-height:min(580px,calc(100dvh - 72px));display:flex;flex-direction:column;background:#fcfcff;border:1px solid #8d8ab6;border-radius:10px;box-shadow:0 18px 55px #1c24453f;overflow:hidden}
.chat-panel .chat-head{min-height:0;padding:9px 12px;display:flex;align-items:center;justify-content:space-between;background:linear-gradient(105deg,#48468c,#5b3c78);color:white;border:none;border-bottom:1px solid #9b88c0}
.chat-head b{font-size:16px}.chat-head small{display:block;font-size:10px;color:#efe6ff;margin-top:2px}
.chat-head .chat-minimize{background:#ffffff26;color:white;border:1px solid #ffffff71;border-radius:5px;font-size:17px;width:30px;height:29px;line-height:1}
.chat-status{display:flex;align-items:center;justify-content:space-between;padding:7px 10px;border-bottom:1px solid #dddaf0;background:#f2effb;color:#443e72;font-weight:800;min-height:34px}
.chat-status button,.chat-nickname button,.chat-compose button{border:1px solid #9691bc;background:#eeebfa;border-radius:5px;color:#37316c;padding:4px 7px;font-weight:750}
.chat-roster{margin:0;padding:5px 10px;font-size:11px;color:#4b526f;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
.chat-nickname{padding:7px 10px;background:#f7f4ff;border-bottom:1px solid #dcd8f0}.chat-nickname label{display:block;margin-bottom:4px;font-weight:700}.chat-nickname div{display:flex;gap:6px}
.chat-nickname input,.chat-compose textarea{min-width:0;flex:1;color:#26284b;background:#fff;border:1px solid #a7a8c8;border-radius:5px;padding:5px 7px}
.chat-log{overflow-y:auto;min-height:0;flex:1;padding:8px 10px;background:#fff;overscroll-behavior:contain}
.chat-empty{font-size:12px;color:#5e6382}.chat-message{padding:4px 2px}.chat-message small{color:#5b5489;font-weight:800;font-size:11px}.chat-message.mine small{color:#345c79}.chat-message p{margin:3px 0 2px;white-space:pre-wrap;overflow-wrap:anywhere;color:#262b49}
.chat-hint{padding:4px 10px;margin:0;min-height:23px;font-size:11px;color:#574b76;background:#f6f4fc;border-top:1px solid #ece8f4}
.chat-compose{display:flex;padding:6px 10px;gap:6px;background:#f7f6fd}.chat-compose textarea{resize:none;font-size:13px}.chat-compose button:disabled{opacity:.55;cursor:default}
.chat-meta{font-size:10px;padding:0 10px 6px;margin:0;color:#676784;background:#f7f6fd}

.chat-message{display:flex;flex-direction:column;align-items:flex-start}
.chat-message.mine{align-items:flex-end;text-align:right}
.chat-message p{max-width:85%;padding:5px 8px;border-radius:8px;background:#f0eef8}
.chat-message.mine p{background:#e6f1fa;text-align:left}

.header-actions{display:flex;align-items:center;gap:8px}
.chat-dock{position:relative;inset:auto;z-index:40}
.chat-launch{white-space:nowrap;box-shadow:none}
.chat-panel{top:calc(100% + 8px);bottom:auto;right:0;height:min(430px,calc(100dvh - 105px))}
@media(max-width:600px){
  .header-actions{grid-column:2;grid-row:1;gap:5px}
  .header-actions .passport{min-height:36px}
  .chat-launch{padding:6px;font-size:11px;gap:4px}
}

.chat-panel > :not(.chat-conversation){flex-shrink:0}
.chat-conversation{position:relative;display:flex;flex-direction:column;flex:1 1 0;min-height:0;overflow:hidden}
.chat-hint:empty{display:none}
.chat-nudge-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:6px 10px;background:#f7f6fd;border-top:1px solid #ece8f4}
.chat-nudge-bar .chat-meta{min-width:0;padding:0;line-height:1.35;font-size:11px}
.chat-nudge-bar .chat-nudge{flex:none;white-space:nowrap}
@media(max-width:600px){
 .chat-panel{height:min(400px,calc(100dvh - 82px))}
 .chat-nudge-bar{gap:12px;padding-inline:10px}
 .chat-nudge-bar .chat-nudge{padding-inline:8px}
}
.chat-nudge{border:1px solid #d9cde8;border-radius:8px;background:#f6effb;color:#49346b;padding:5px 9px;font:inherit;font-size:12px}
.chat-nudge:disabled{opacity:.5;cursor:default}
.chat-nudge-pop{position:absolute;top:12px;inset-inline:10px;z-index:2;pointer-events:none;display:flex;align-items:center;justify-content:center;gap:8px;padding:10px;border:1px solid #e7c19a;border-radius:12px;background:#fff3df;color:#4a3422;box-shadow:0 6px 20px #39264a29;font-size:13px;overflow-wrap:anywhere}
.chat-nudge-traveler{font-size:26px}
@media(prefers-reduced-motion:no-preference){
 .chat-message-new{animation:chat-message-in 240ms ease-out both}
 @keyframes chat-message-in{from{opacity:0}to{opacity:1}}
 .chat-nudge-pop{animation:nudge-arrive 340ms cubic-bezier(.2,.75,.25,1) both}
 .chat-nudge-traveler{animation:nudge-wave 420ms ease-in-out 2 alternate}
 @keyframes nudge-arrive{from{opacity:0;transform:translateY(-8px) scale(.94)}to{opacity:1;transform:none}}
 @keyframes nudge-wave{from{transform:rotate(-12deg)}to{transform:rotate(12deg)}}
}
