.melostic-chat-view { padding:0; }
.chat-shell { display:grid; gap:16px; max-width:1400px; margin:0 auto; color:#17233d; }
.chat-hero { display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:18px; padding:24px 27px; border-radius:23px; color:#fff; background:linear-gradient(125deg,#172a52,#3157c8 68%,#168a7a); box-shadow:0 18px 45px rgba(32,55,112,.18); }
.chat-hero-icon { display:grid; place-items:center; width:64px; height:64px; border:2px solid rgba(255,255,255,.45); border-radius:19px; background:rgba(255,255,255,.13); font-size:20px; font-weight:900; }
.chat-hero h2 { margin:2px 0 4px; color:#fff; font-size:31px; }.chat-hero p { margin:0; color:#dfe8ff; }
.chat-eyebrow { font-size:10px; font-weight:900; letter-spacing:.11em; text-transform:uppercase; }
.chat-access { display:flex; align-items:center; gap:8px; padding:9px 13px; border:1px solid rgba(255,255,255,.3); border-radius:999px; background:rgba(255,255,255,.1); font-weight:800; }
.chat-access i { width:8px; height:8px; border-radius:50%; background:#72e2b8; box-shadow:0 0 0 4px rgba(114,226,184,.14); }
.chat-workspace { display:grid; grid-template-columns:300px minmax(0,1fr); gap:14px; align-items:stretch; }
.chat-contacts-panel { display:grid; grid-template-rows:auto auto minmax(0,1fr) auto; min-height:620px; overflow:hidden; border:1px solid #dce3ef; border-radius:21px; background:#fff; box-shadow:0 12px 34px rgba(30,50,88,.08); }
.chat-contacts-title { display:flex; align-items:center; justify-content:space-between; padding:18px 18px 12px; }.chat-contacts-title div { display:grid; gap:3px; }.chat-contacts-title span { color:#7d899d; font-size:9px; font-weight:900; letter-spacing:.11em; }.chat-contacts-title strong { font-size:20px; }.chat-contacts-title em { display:grid; place-items:center; min-width:28px; height:28px; border-radius:999px; background:#edf2fa; color:#425372; font-size:11px; font-style:normal; font-weight:900; }
.chat-contact-search { display:flex; align-items:center; gap:8px; margin:0 14px 12px; padding:9px 11px; border:1px solid #d6deea; border-radius:11px; background:#f8faff; color:#7b879b; }.chat-contact-search input { width:100%; border:0; outline:0; background:transparent; color:#1b2945; font:inherit; font-size:12px; }
.chat-contact-list { display:grid; align-content:start; gap:5px; overflow-y:auto; padding:0 9px 12px; }.chat-contact { position:relative; display:grid; grid-template-columns:40px minmax(0,1fr) auto; align-items:center; gap:9px; width:100%; padding:10px; border:0; border-radius:13px; background:transparent; color:#1d2d4c; text-align:left; cursor:pointer; }.chat-contact:hover { background:#f3f6fb; }.chat-contact.active { background:linear-gradient(125deg,#e9efff,#e5f7f4); box-shadow:inset 3px 0 #2f55bd; }.chat-contact.hidden { display:none; }.chat-contact > span:nth-child(2) { display:grid; gap:2px; min-width:0; }.chat-contact strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; }.chat-contact small { overflow:hidden; color:#7d899d; text-overflow:ellipsis; white-space:nowrap; font-size:10px; }.chat-contact-avatar,.chat-conversation-avatar { display:grid; place-items:center; border-radius:12px; background:linear-gradient(135deg,#dfe7ff,#d8f6ef); color:#21386f; font-weight:900; }.chat-contact-avatar { width:40px; height:40px; }.chat-contact-avatar.group { background:linear-gradient(135deg,#253f7b,#3370d2); color:#fff; }.chat-admin-badge { padding:4px 6px; border-radius:999px; background:#fff0cf; color:#99620a; font-size:8px; }.chat-contact-unread { display:grid; place-items:center; min-width:20px; height:20px; padding:0 4px; border-radius:999px; background:#e53d5d; color:#fff; font-size:9px; font-style:normal; font-weight:900; }.chat-private-note { margin:10px; padding:10px; border-radius:11px; background:#f4f7fb; color:#718097; font-size:10px; line-height:1.4; }.chat-no-contacts { padding:20px 10px; color:#8390a4; text-align:center; font-size:11px; }
.chat-panel { overflow:hidden; border:1px solid #dce3ef; border-radius:21px; background:#fff; box-shadow:0 12px 34px rgba(30,50,88,.08); }
.chat-panel-header { display:flex; justify-content:space-between; align-items:center; gap:15px; padding:17px 21px; border-bottom:1px solid #e4e9f1; }.chat-panel-header h3 { margin:0; font-size:20px; }.chat-panel-header p { margin:3px 0 0; color:#748198; font-size:12px; }
.chat-conversation-title { display:flex; align-items:center; gap:10px; }.chat-conversation-avatar { width:42px; height:42px; }
.chat-refresh { padding:9px 13px; border:1px solid #ccd6e6; border-radius:10px; background:#fff; color:#24365f; font-weight:800; cursor:pointer; }
.chat-header-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; }
.chat-notification-toggle { display:flex; align-items:center; gap:7px; padding:9px 13px; border:1px solid #d6deeb; border-radius:10px; background:#f6f8fc; color:#5f6d84; font-weight:850; cursor:pointer; }
.chat-notification-toggle.enabled { border-color:#9bd8c8; background:#e6f6f1; color:#08705e; }
.chat-notification-toggle span { font-size:15px; }
.chat-nav-badge { display:grid; place-items:center; min-width:20px; height:20px; margin-left:auto; padding:0 5px; border-radius:999px; background:#e53d5d; color:#fff; font-size:10px; font-weight:900; }
.chat-messages { display:grid; align-content:start; gap:15px; height:min(52vh,520px); min-height:330px; overflow-y:auto; padding:22px; background:linear-gradient(180deg,#f7f9fd,#fff); }
.chat-message { display:grid; grid-template-columns:42px minmax(0,1fr); align-items:start; gap:10px; max-width:78%; }.chat-message.own { justify-self:end; grid-template-columns:minmax(0,1fr) 42px; }.chat-message.own .chat-avatar { grid-column:2; }.chat-message.own .chat-message-body { grid-column:1; grid-row:1; background:#24459c; color:#fff; border-color:#24459c; }.chat-message.own .chat-message-meta span,.chat-message.own .chat-message-meta time { color:#d8e3ff; }
.chat-avatar,.chat-current-avatar { display:grid; place-items:center; border-radius:13px; background:linear-gradient(135deg,#dfe7ff,#d8f6ef); color:#21386f; font-weight:900; }.chat-avatar { width:42px; height:42px; }
.chat-message-body { padding:11px 14px; border:1px solid #dce3ef; border-radius:5px 16px 16px 16px; background:#fff; box-shadow:0 5px 15px rgba(30,50,88,.05); }.chat-message.own .chat-message-body { border-radius:16px 5px 16px 16px; }
.chat-message-meta { display:flex; flex-wrap:wrap; align-items:center; gap:7px; font-size:11px; }.chat-message-meta strong { font-size:13px; }.chat-message-meta span,.chat-message-meta time { color:#7a879d; }.chat-message-meta time { margin-left:auto; }.chat-message-body p { margin:7px 0 0; line-height:1.48; word-break:break-word; }
.chat-image-attachment { display:grid; gap:7px; margin-top:9px; color:inherit; text-decoration:none; }.chat-image-attachment img { display:block; width:min(360px,100%); max-height:270px; object-fit:cover; border:1px solid rgba(110,130,170,.28); border-radius:12px; background:#eef3fa; }.chat-image-attachment span { font-size:11px; font-weight:750; opacity:.82; }
.chat-document-attachment { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:10px; min-width:280px; margin-top:9px; padding:10px; border:1px solid #d4ddec; border-radius:12px; background:#f4f7fc; color:#21345e; text-decoration:none; }.chat-document-icon { display:grid; place-items:center; width:38px; height:38px; border-radius:10px; background:#e0e9fb; font-size:19px; }.chat-document-attachment span:nth-child(2) { display:grid; gap:2px; overflow:hidden; }.chat-document-attachment strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }.chat-document-attachment small { color:#76839a; }.chat-document-attachment b { font-size:11px; }.chat-message.own .chat-document-attachment { border-color:rgba(255,255,255,.25); background:rgba(255,255,255,.12); color:#fff; }.chat-message.own .chat-document-attachment small { color:#d8e3ff; }.chat-attachment-loading { margin-top:9px; color:#78859a; font-size:11px; }
.chat-empty { display:grid; place-items:center; align-self:center; gap:5px; color:#748198; text-align:center; }.chat-empty span { font-size:38px; }.chat-empty strong { color:#24365f; font-size:18px; }.chat-empty p { margin:0; }
.chat-composer { display:grid; grid-template-columns:46px 1fr auto; gap:12px; align-items:end; padding:17px 20px; border-top:1px solid #e4e9f1; background:#fff; }.chat-current-avatar { width:46px; height:46px; }.chat-composer .chat-message-field { display:grid; gap:6px; color:#66748b; font-size:11px; }.chat-composer textarea { width:100%; min-height:68px; max-height:150px; resize:vertical; padding:11px 13px; border:1px solid #ccd6e5; border-radius:13px; background:#f9fbff; color:#17233d; font:inherit; }.chat-file-preview { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:9px; padding:8px 10px; border:1px solid #cbd8ea; border-radius:11px; background:#f1f6fc; }.chat-file-preview > span:nth-child(2) { display:grid; gap:1px; overflow:hidden; }.chat-file-preview strong { overflow:hidden; color:#20345d; text-overflow:ellipsis; white-space:nowrap; }.chat-file-preview small { color:#7c899e; }.chat-file-preview button { border:0; background:transparent; color:#b22c43; font:inherit; font-weight:850; cursor:pointer; }.chat-file-icon { font-size:19px; }.chat-compose-actions { display:grid; gap:7px; justify-items:end; }.chat-compose-actions > span { color:#8995a8; font-size:10px; }.chat-attach-button { display:flex; align-items:center; justify-content:center; min-width:130px; padding:9px 13px; border:1px solid #cbd6e7; border-radius:10px; background:#f7f9fd; color:#273a64; font-size:12px; font-weight:850; cursor:pointer; }.chat-attach-button input { position:absolute; width:1px; height:1px; overflow:hidden; opacity:0; pointer-events:none; }.chat-compose-actions button { min-width:130px; padding:12px 16px; border:0; border-radius:11px; background:#172a52; color:#fff; font-weight:900; cursor:pointer; }.chat-compose-actions button:disabled { opacity:.55; }.chat-status { grid-column:2/-1; min-height:0; margin:0; color:#08705e; font-size:12px; }.chat-status.error { color:#b02f40; }
.chat-loading,.chat-error { padding:70px 25px; border:1px solid #dce3ef; border-radius:20px; background:#fff; text-align:center; }.chat-error h3 { color:#b02f40; }.chat-error p { color:#637087; }.chat-error small { color:#8490a5; }
@media(max-width:900px){.chat-workspace{grid-template-columns:1fr}.chat-contacts-panel{min-height:0;max-height:310px}.chat-contact-list{max-height:190px}.chat-private-note{display:none}}
@media(max-width:720px){.chat-hero{grid-template-columns:auto 1fr}.chat-access{grid-column:1/-1;justify-self:start}.chat-panel-header{align-items:flex-start;flex-direction:column}.chat-header-actions{width:100%;justify-content:flex-start}.chat-messages{height:52vh;padding:14px}.chat-message{max-width:92%}.chat-document-attachment{min-width:0}.chat-composer{grid-template-columns:1fr}.chat-current-avatar{display:none}.chat-compose-actions{grid-template-columns:1fr auto;align-items:center;justify-items:stretch}.chat-compose-actions>span{grid-column:1/-1}.chat-status{grid-column:1}.chat-hero{padding:20px}.chat-hero-icon{width:52px;height:52px}}
