﻿.chat-page{width:100%;max-width:980px;margin:0 auto;padding:34px 28px 60px}.chat-page-header,.chat-room-header{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-bottom:22px}.chat-page h2{margin:0 0 6px;font-size:28px;font-weight:900;color:#2b2724}.chat-page p{margin:0;color:#7b736c}.chat-list-card,.chat-room-card{background:rgba(255,255,255,.94);border:1px solid #e7ded2;border-radius:18px;box-shadow:0 12px 32px rgba(72,53,36,.08);overflow:hidden}.chat-list-item{display:flex;align-items:center;gap:14px;padding:18px 20px;color:inherit;text-decoration:none;border-bottom:1px solid #eee7df;transition:.18s}.chat-list-item:last-child{border-bottom:0}.chat-list-item:hover{background:#fffaf4;color:inherit}.chat-avatar{width:46px;height:46px;border-radius:50%;display:flex;align-items:center;justify-content:center;flex:0 0 auto;background:#2e9b5f;color:#fff;font-weight:900;font-size:19px}.chat-list-main{min-width:0;flex:1}.chat-list-topline{display:flex;justify-content:space-between;gap:12px}.chat-list-topline strong{font-size:16px}.chat-list-topline time{font-size:14px;color:#9b938b;white-space:nowrap}.chat-trade-title{margin-top:3px;font-size:14px;color:#2e9b5f;font-weight:700}.chat-preview{margin-top:5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#716a64;font-size:15px}.chat-list-side{display:flex;flex-direction:column;align-items:flex-end;gap:8px}.chat-status{font-size:14px;padding:4px 8px;border-radius:999px;background:#f4f0eb;color:#766d64}.chat-unread{min-width:22px;height:22px;padding:0 6px;border-radius:999px;display:flex;align-items:center;justify-content:center;background:#d94747;color:white;font-size:14px;font-weight:800}.chat-empty{padding:60px 24px;text-align:center;display:flex;flex-direction:column;gap:7px;color:#7a7169}.chat-empty strong{color:#37312d}.chat-back{display:inline-block;margin-bottom:9px;color:#2e9b5f;text-decoration:none;font-weight:800}.chat-trade-link{padding:10px 15px;border:1px solid #d9cec2;border-radius:9px;text-decoration:none;color:#433c36;background:white;font-weight:700}.chat-messages{height:560px;overflow-y:auto;padding:24px;background:linear-gradient(180deg,#fbf8f4,#f7f2ec);display:flex;flex-direction:column;gap:12px}.chat-empty-room{text-align:center;color:#9b938b;margin:auto}.chat-message{max-width:74%;display:flex;flex-direction:column}.chat-message.mine{align-self:flex-end;align-items:flex-end}.chat-message.other{align-self:flex-start;align-items:flex-start}.chat-sender{font-size:14px;font-weight:800;color:#675f58;margin:0 0 4px 5px}.chat-bubble{padding:11px 14px;border-radius:15px;white-space:pre-wrap;word-break:break-word;line-height:1.55;font-size:16px}.chat-message.mine .chat-bubble{background:#2e9b5f;color:#fff;border-bottom-right-radius:4px}.chat-message.other .chat-bubble{background:#fff;color:#342f2b;border:1px solid #e5ddd4;border-bottom-left-radius:4px}.chat-message time{margin-top:4px;font-size:14px;color:#9b938b}.chat-compose{display:flex;gap:10px;align-items:flex-end;padding:15px;border-top:1px solid #e9e0d7;background:#fff}.chat-compose textarea{flex:1;resize:none;min-height:48px;max-height:120px;border:1px solid #d9d0c8;border-radius:11px;padding:12px 13px;outline:none}.chat-compose textarea:focus{border-color:#2e9b5f;box-shadow:0 0 0 3px rgba(46,155,95,.1)}.chat-compose button{height:48px;padding:0 22px;border:0;border-radius:11px;background:#2e9b5f;color:white;font-weight:800}.chat-error{padding:0 16px 12px;color:#c0392b;font-size:14px;background:#fff}@media(max-width:760px){.chat-page{padding:20px 12px 40px}.chat-page-header,.chat-room-header{align-items:flex-start;flex-direction:column}.chat-messages{height:60vh;padding:16px}.chat-message{max-width:86%}.chat-list-item{padding:15px 14px}.chat-list-side .chat-status{display:none}}

/* =========================================================
   공통 채팅 팝업 UI - 모든 Portal 화면에서 사용
   ========================================================= */
.chat-token-form{display:none!important}
.profile-header-copy{min-width:0;flex:1}
.profile-chat-button{position:relative;display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;margin-left:auto;flex:0 0 auto;border:1px solid rgba(110,89,67,.22);border-radius:10px;background:rgba(255,255,255,.84);color:#51483f;cursor:pointer;box-shadow:0 3px 10px rgba(60,45,30,.07);transition:.18s ease}
.profile-chat-button:hover{transform:translateY(-1px);border-color:#2e9b5f;color:#2e9b5f;background:#fff}
.profile-chat-button svg{width:18px;height:18px}
.profile-chat-badge{position:absolute;top:-7px;right:-7px;display:flex;align-items:center;justify-content:center;min-width:19px;height:19px;padding:0 5px;border-radius:999px;background:#d94747;color:#fff;border:2px solid #fff;font-size:14px;font-weight:900;line-height:1}
.chat-room-list-popover{position:fixed;right:26px;top:112px;z-index:2100;width:min(390px,calc(100vw - 32px));max-height:min(620px,calc(100vh - 150px));overflow:hidden;border:1px solid #dfd5c9;border-radius:18px;background:rgba(255,255,255,.985);box-shadow:0 22px 60px rgba(45,35,27,.22);backdrop-filter:blur(14px)}
.chat-room-list-popover[hidden]{display:none!important}
.chat-room-list-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:17px 18px;border-bottom:1px solid #ece4db;background:linear-gradient(135deg,#fffaf5,#fff)}
.chat-room-list-header>div{display:flex;flex-direction:column;gap:2px}.chat-room-list-header strong{font-size:18px;color:#342d27}.chat-room-list-header span{font-size:14px;color:#8b8178}.chat-room-list-header button{width:30px;height:30px;border:0;border-radius:9px;background:transparent;color:#756c64;font-size:24px;line-height:1;cursor:pointer}.chat-room-list-header button:hover{background:#f4eee7;color:#26211d}
.chat-room-list-body{max-height:520px;overflow-y:auto}.chat-popup-loading,.chat-popup-empty{padding:38px 20px;text-align:center;color:#8a8178}.chat-popup-empty{display:flex;flex-direction:column;gap:6px}.chat-popup-empty strong{color:#49413a}.chat-popup-empty span{font-size:14px;line-height:1.5}
.chat-popup-room-item{width:100%;display:flex;align-items:center;gap:11px;padding:14px 15px;border:0;border-bottom:1px solid #f0e9e2;background:#fff;text-align:left;color:inherit;cursor:pointer}.chat-popup-room-item:last-child{border-bottom:0}.chat-popup-room-item:hover{background:#fffaf5}.chat-popup-room-avatar{display:flex;align-items:center;justify-content:center;width:42px;height:42px;flex:0 0 auto;border-radius:50%;background:#2e9b5f;color:#fff;font-weight:900}.chat-popup-room-copy{display:flex;flex:1;min-width:0;flex-direction:column;gap:2px}.chat-popup-room-top{display:flex;align-items:center;justify-content:space-between;gap:8px}.chat-popup-room-top strong{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:16px;color:#37312c}.chat-popup-room-top time{white-space:nowrap;font-size:14px;color:#9c938b}.chat-popup-room-trade{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:700;color:#2e9b5f}.chat-popup-room-preview{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;color:#756d65}.chat-popup-room-side{display:flex;flex:0 0 auto;flex-direction:column;align-items:flex-end;gap:6px}.chat-popup-room-status{max-width:80px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:3px 6px;border-radius:999px;background:#f2eee9;color:#756c64;font-size:14px}.chat-popup-room-unread{display:flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 5px;border-radius:999px;background:#d94747;color:#fff;font-size:14px;font-weight:900}
.chat-floating-layer{position:fixed;right:22px;bottom:18px;z-index:2200;display:flex;flex-direction:row-reverse;align-items:flex-end;gap:12px;max-width:calc(100vw - 44px);pointer-events:none}
.chat-float-window{width:350px;height:510px;display:flex;flex:0 0 350px;flex-direction:column;overflow:hidden;border:1px solid #d8cec3;border-radius:17px;background:#fff;box-shadow:0 20px 55px rgba(44,34,25,.24);pointer-events:auto;transform:translateY(0);transition:height .18s ease,box-shadow .18s ease}.chat-float-window.is-active{box-shadow:0 24px 66px rgba(46,38,29,.31)}.chat-float-window.is-minimized{height:58px}.chat-float-window.is-minimized .chat-float-meta,.chat-float-window.is-minimized .chat-float-messages,.chat-float-window.is-minimized .chat-float-compose,.chat-float-window.is-minimized .chat-float-error{display:none!important}
.chat-float-header{height:58px;display:flex;align-items:center;gap:10px;flex:0 0 auto;padding:9px 10px 9px 12px;background:linear-gradient(135deg,#2c493b,#2e9b5f);color:#fff;cursor:pointer}.chat-float-avatar{width:36px;height:36px;display:flex;align-items:center;justify-content:center;flex:0 0 auto;border-radius:50%;background:rgba(255,255,255,.2);border:1px solid rgba(255,255,255,.34);font-weight:900}.chat-float-title{display:flex;min-width:0;flex:1;flex-direction:column}.chat-float-title strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:16px}.chat-float-title span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;opacity:.82}.chat-float-controls{display:flex;align-items:center;gap:2px}.chat-float-controls button{width:29px;height:29px;border:0;border-radius:8px;background:transparent;color:#fff;font-size:20px;line-height:1;cursor:pointer}.chat-float-controls button:hover{background:rgba(255,255,255,.16)}
.chat-float-meta{height:35px;display:flex;align-items:center;justify-content:space-between;gap:10px;flex:0 0 auto;padding:0 12px;border-bottom:1px solid #ece4db;background:#fffaf6;color:#766d65;font-size:14px}.chat-float-meta a{color:#2e8456;text-decoration:none;font-weight:800}.chat-float-meta a:hover{text-decoration:underline}
.chat-float-messages{display:flex;flex:1;min-height:0;flex-direction:column;gap:9px;overflow-y:auto;padding:14px 12px;background:linear-gradient(180deg,#faf7f3,#f4efe9)}.chat-float-empty{margin:auto;text-align:center;color:#9b928a;font-size:14px}.chat-float-message{display:flex;max-width:78%;flex-direction:column}.chat-float-message.mine{align-self:flex-end;align-items:flex-end}.chat-float-message.other{align-self:flex-start;align-items:flex-start}.chat-float-sender{margin:0 0 3px 5px;color:#6e655d;font-size:14px;font-weight:800}.chat-float-bubble{padding:9px 11px;border-radius:13px;white-space:pre-wrap;word-break:break-word;font-size:14px;line-height:1.5}.chat-float-message.mine .chat-float-bubble{border-bottom-right-radius:4px;background:#2e9b5f;color:#fff}.chat-float-message.other .chat-float-bubble{border:1px solid #e2dad2;border-bottom-left-radius:4px;background:#fff;color:#352f2b}.chat-float-message time{margin-top:3px;color:#9b928a;font-size:14px}
.chat-float-error{flex:0 0 auto;padding:6px 11px;background:#fff3f1;color:#c33b32;font-size:14px}.chat-float-compose{display:flex;align-items:flex-end;gap:7px;flex:0 0 auto;padding:9px;border-top:1px solid #e8e0d8;background:#fff}.chat-float-compose textarea{min-height:38px;max-height:90px;flex:1;resize:none;border:1px solid #d8cec5;border-radius:10px;padding:9px 10px;outline:none;font-family:inherit;font-size:14px}.chat-float-compose textarea:focus{border-color:#2e9b5f;box-shadow:0 0 0 2px rgba(46,155,95,.1)}.chat-float-compose button{height:38px;padding:0 13px;border:0;border-radius:10px;background:#2e9b5f;color:#fff;font-size:14px;font-weight:900;cursor:pointer}.chat-float-compose button:disabled{opacity:.55;cursor:default}

@media(max-width:1200px){.chat-room-list-popover{right:18px;top:92px}.chat-floating-layer{right:14px;bottom:14px;max-width:calc(100vw - 28px)}.chat-float-window{width:330px;flex-basis:330px}}
@media(max-width:768px){.profile-chat-button{width:32px;height:32px}.chat-room-list-popover{inset:62px 10px auto 10px;width:auto;max-height:calc(100dvh - 78px);border-radius:16px}.chat-room-list-body{max-height:calc(100dvh - 145px)}.chat-floating-layer{inset:0;display:block;max-width:none;pointer-events:none}.chat-float-window{position:absolute;left:8px;right:8px;bottom:8px;width:auto;height:min(78dvh,620px);max-height:calc(100dvh - 16px);border-radius:18px;transform:none}.chat-float-window.mobile-hidden{display:none}.chat-float-window.is-minimized{left:auto;right:8px;width:min(330px,calc(100vw - 16px));height:58px}.chat-float-header{height:60px}.chat-float-messages{padding:14px 11px}.chat-float-message{max-width:86%}.chat-float-compose{padding-bottom:max(9px,env(safe-area-inset-bottom))}}
@media(max-width:430px){.chat-room-list-popover{inset:54px 6px auto 6px}.chat-float-window{left:0;right:0;bottom:0;height:calc(100dvh - 54px);max-height:none;border-radius:17px 17px 0 0;border-left:0;border-right:0;border-bottom:0}.chat-float-window.is-minimized{right:6px;bottom:6px;width:calc(100vw - 12px);border:1px solid #d8cec3;border-radius:14px}.chat-float-message{max-width:90%}}

/* Hide the unread badge until a count is available. */
.profile-chat-badge[hidden]{display:none!important}
