@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: #f6f4f2;
  color: #262626;
  height: 100vh;
  overflow: hidden;
}

/* ---------- login ---------- */
#loginScreen {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f6f4f2;
}
#loginCard {
  display: flex;
  width: 900px;
  max-width: 92vw;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.25);
}
#loginLeft {
  width: 42%;
  color: #fff;
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,.04) 0px, rgba(255,255,255,.04) 2px, transparent 2px, transparent 14px),
    linear-gradient(160deg, #9c2027 0%, #5c1010 100%);
}
#loginBrand { display: flex; align-items: center; gap: 12px; }
#loginBrand .login-full-logo { height: 44px; width: auto; display: block; }
#loginHeadline h1 { font-size: 32px; font-weight: 800; line-height: 1.15; margin-bottom: 14px; }
#loginHeadline p { font-size: 14px; color: rgba(255,255,255,.7); line-height: 1.5; max-width: 260px; }
#loginFooterStats { font-size: 10.5px; letter-spacing: .06em; color: rgba(255,255,255,.55); text-transform: uppercase; }
#loginRight {
  width: 58%;
  background: #fdfcfb;
  padding: 48px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
#loginRight h2 { font-size: 24px; font-weight: 800; margin-bottom: 6px; color: #1a1a1a; }
#loginRight p.sub { font-size: 13px; color: #888; margin-bottom: 28px; }
#loginRight label { display: block; font-size: 12.5px; font-weight: 600; color: #444; margin-bottom: 6px; }
#loginRight input[type="text"],
#loginRight input[type="password"] {
  width: 100%; padding: 13px 15px; border: 1px solid #e6e2e0; border-radius: 10px; background: #fff;
  font-size: 14px; font-family: inherit; margin-bottom: 18px; transition: border-color .15s ease;
}
#loginRight input:focus { outline: none; border-color: #b8272c; }
.login-field-row { display: flex; justify-content: space-between; align-items: center; }
#togglePasswordBtn { border: none; background: transparent; color: #b8272c; font-size: 12.5px; font-weight: 700; cursor: pointer; }
#loginExtraRow { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
#loginRight label.remember-check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #555; cursor: pointer; font-weight: 500; margin-bottom: 0; }
.remember-check input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 16px; height: 16px; margin: 0; flex-shrink: 0;
  border: 1.5px solid #ddd; border-radius: 5px; background: #fff; cursor: pointer;
  position: relative; transition: background .15s ease, border-color .15s ease;
}
.remember-check input[type="checkbox"]:checked { background: #b8272c; border-color: #b8272c; }
.remember-check input[type="checkbox"]:checked::after {
  content: ''; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}

#forgotPasswordLink { font-size: 12.5px; color: #b8272c; font-weight: 600; text-decoration: none; outline: none; }
#forgotPasswordLink:hover { text-decoration: underline; }
#loginRight button#loginBtn {
  width: 100%; padding: 14px; border: none; border-radius: 12px;
  background: linear-gradient(135deg, #b8272c, #8f1c1c); color: #fff; font-size: 14.5px; font-weight: 700; cursor: pointer;
  box-shadow: 0 10px 24px rgba(184,39,44,.35); transition: transform .12s ease;
}
#loginRight button#loginBtn:hover { transform: translateY(-1px); }
#loginRight button#loginBtn:disabled { opacity: .6; cursor: default; transform: none; }
#loginError { color: #d33; font-size: 12px; margin-top: 12px; min-height: 14px; font-weight: 600; }
#loginHelp { font-size: 12px; color: #999; margin-top: 18px; text-align: center; }

/* ---------- app shell ---------- */
#app { display: none; height: 100vh; flex-direction: column; }
#app.visible { display: flex; }

#topbar {
  background: linear-gradient(120deg, #b8272c 0%, #7d1717 100%);
  color: #fff;
  padding: 12px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
  z-index: 5;
}
#operatorName { font-weight: 700; }
#topbar .brand { display: flex; align-items: center; gap: 10px; }
#topbar .brand-text { display: flex; flex-direction: column; line-height: 1.3; }
#topbar .brand-title { font-weight: 700; font-size: 14.5px; letter-spacing: .02em; }
#topbar .brand-subtitle { font-size: 11.5px; color: rgba(255,255,255,.75); margin-top: 1px; font-weight: 500; }
#topbar .who { display: flex; align-items: center; gap: 12px; font-size: 13px; }
#topbar .who .op-avatar {
  width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700;
}
#topbar button {
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3); color: #fff; padding: 7px 14px;
  border-radius: 7px; cursor: pointer; font-size: 12.5px; font-weight: 700; transition: background .15s ease;
}
#topbar button:hover { background: rgba(255,255,255,.28); }

#main { flex: 1; display: flex; min-height: 0; }

/* ---------- sidebar ---------- */
#sidebar { width: 330px; background: #fff; border-right: 1px solid #eee; display: flex; flex-direction: column; box-shadow: 2px 0 12px rgba(0,0,0,.03); z-index: 2; flex-shrink: 0; }
#searchBox { padding: 14px; border-bottom: 1px solid #f0eeec; }
#searchBox input {
  width: 100%; padding: 9px 12px 9px 34px; border: 1px solid #e6e2e0; border-radius: 9px; font-size: 13px; font-family: inherit;
  background: #faf9f8 url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23999" stroke-width="2"><circle cx="11" cy="11" r="7"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>') no-repeat 10px center;
  background-size: 15px;
}
#searchBox input:focus { outline: none; border-color: #b8272c; background-color: #fff; }
#tabs { display: flex; gap: 5px; padding: 10px 12px; border-bottom: 1px solid #f0eeec; flex-wrap: wrap; }
#tabs button {
  border: none; background: #f4f3f2; color: #777; padding: 6px 11px; border-radius: 999px;
  font-size: 11.5px; cursor: pointer; font-weight: 700; transition: background .15s ease, color .15s ease;
}
#tabs button:hover { background: #ece9e7; }
#tabs button.active { background: #b8272c; color: #fff; box-shadow: 0 4px 10px rgba(184,39,44,.3); }
#chatList { flex: 1; overflow-y: auto; padding: 10px; background: #f9f7f5; }

.chat-item {
  display: flex; gap: 10px; padding: 12px; border-radius: 12px; cursor: pointer; margin-bottom: 8px;
  background: #fff; border: 1px solid #ddd6cf; box-shadow: 0 1px 6px rgba(0,0,0,.06);
  transition: background .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.chat-item:hover { border-color: #c9c1b8; box-shadow: 0 4px 14px rgba(0,0,0,.1); }
.chat-item.selected { background: #fdeaea; border: 1.5px solid #b8272c; box-shadow: 0 4px 14px rgba(184,39,44,.18); }
.chat-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 14px;
}
.avatar-wrap { position: relative; flex-shrink: 0; align-self: flex-start; }
.online-dot {
  position: absolute; bottom: -1px; right: -1px; width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid #fff; background: #c7c2bf;
}
.online-dot.online { background: #22c55e; }
.chat-status-dot { width: 8px; height: 8px; border-radius: 50%; background: #d8d5d0; flex-shrink: 0; align-self: flex-start; margin-top: 6px; box-shadow: 0 0 0 2px #fff; }
.chat-status-dot.online { background: #22c55e; box-shadow: 0 0 0 2px #fff, 0 0 4px rgba(34,197,94,.5); }

.chat-item-body { min-width: 0; flex: 1; }
.chat-item .row1 { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.chat-item .name { font-weight: 650; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item .time { font-size: 10.5px; color: #aaa; flex-shrink: 0; }
.chat-item .preview { font-size: 12px; color: #888; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item .meta { font-size: 10.5px; color: #aaa; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge {
  display: inline-block; font-size: 9.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-top: 5px;
  text-transform: uppercase; letter-spacing: .02em;
}
.chat-item .row1-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.unread-badge {
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: #b8272c; color: #fff;
  font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; line-height: 1;
}
.badge.new { background: #dbeafe; color: #1d4ed8; }
.badge.active { background: #dcfce7; color: #15803d; }
.badge.awaiting_ai { background: #ede9fe; color: #6d28d9; }
.badge.completed { background: #f0f0f0; color: #888; }
#emptyList { padding: 40px 16px; color: #bbb; font-size: 13px; text-align: center; }

.chat-item { position: relative; }

.chat-select-checkbox {
  display: none; align-self: flex-start; margin-top: 10px; width: 18px; height: 18px; border-radius: 5px;
  border: 2px solid #ddd; flex-shrink: 0; cursor: pointer; position: relative;
}
.chat-item.selection-mode .chat-select-checkbox { display: block; }
.chat-item.selection-mode .chat-menu-btn { display: none; }
.chat-select-checkbox.checked { background: #b8272c; border-color: #b8272c; }
.chat-select-checkbox.checked::after {
  content: ''; position: absolute; left: 6px; top: 3px; width: 5px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}

#selectRow { padding: 0 12px 10px; border-bottom: 1px solid #f0eeec; }

.chat-menu-btn {
  border: none; background: transparent; color: #bbb; cursor: pointer;
  width: 20px; height: 20px; border-radius: 50%; font-size: 15px; line-height: 1;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.chat-menu-btn:hover { background: #f4f3f2; color: #666; }

.chat-menu-dropdown {
  position: absolute; top: 30px; right: 8px; background: #fff; border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.15); padding: 6px; z-index: 20; min-width: 160px; display: none;
}
.chat-menu-dropdown.open { display: block; }
.chat-menu-dropdown button {
  display: block; width: 100%; text-align: left; border: none; background: transparent;
  padding: 9px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: #333; cursor: pointer;
}
.chat-menu-dropdown button:hover { background: #f4f3f2; }
.chat-menu-dropdown button.danger { color: #d33; }

.pin-badge { margin-right: 3px; }

.select-toggle-btn {
  border: none; background: #f4f3f2; color: #777; padding: 6px 11px; border-radius: 999px;
  font-size: 11.5px; cursor: pointer; font-weight: 700;
}
.select-toggle-btn.active { background: #b8272c; color: #fff; }

#bulkActionsBar {
  display: none; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid #f0eeec; background: #fff;
}
#bulkActionsBar.visible { display: flex; }
#bulkActionsBar button { border: none; border-radius: 8px; padding: 8px 12px; font-size: 12px; font-weight: 700; cursor: pointer; }
#selectAllBtn { background: #f4f3f2; color: #555; }
#bulkDeleteBtn { background: #b8272c; color: #fff; flex: 1; }
#bulkDeleteBtn:disabled { opacity: .5; cursor: default; }

/* ---------- chat panel: несколько окон одновременно, перенос вниз ---------- */
#chatPanel {
  flex: 1; position: relative; display: flex; flex-wrap: wrap; align-content: flex-start;
  gap: 16px; padding: 16px; overflow-y: auto; overflow-x: hidden; min-width: 0;
  background: #eeeae5;
}
#chatPlaceholder {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: 10px;
  align-items: center; justify-content: center; color: #c2bcb9; font-size: 14px;
}
#chatPlaceholder svg { width: 44px; height: 44px; opacity: .5; }
#chatPlaceholder.hidden { display: none; }

/* .chat-window {
  flex: 1 1 330px; min-width: 300px; max-width: 420px; height: 560px;
  display: flex; flex-direction: column;
  background: #fff;
  background-size: 22px 22px;
  border: 1px solid #ddd6d0; border-radius: 14px; overflow: hidden;
  box-shadow: 0 10px 28px rgba(30,20,10,0.10), 0 2px 8px rgba(30,20,10,0.05);
  transition: none;
} */

.chat-window {
    flex: 0 0 372px; width: 372px; height: 560px;
    display: flex; flex-direction: column;
    background: #fff;
    background-size: 22px 22px;
    border: 1px solid #ddd6d0; border-radius: 14px; overflow: hidden;
    box-shadow: 0 10px 28px rgba(30,20,10,0.10), 0 2px 8px rgba(30,20,10,0.05);
    transition: none;
  }

#audienceSwitch { display:flex; gap:6px; padding:10px 14px 0; }
#audienceSwitch button { flex:1; border:none; background:#f4f3f2; color:#777; padding:8px 10px; border-radius:8px; font-size:12px; font-weight:700; cursor:pointer; transition:background .15s ease,color .15s ease; }
#audienceSwitch button:hover { background:#ece9e7; }
#audienceSwitch button.active { background:#b8272c; color:#fff; box-shadow:0 4px 10px rgba(184,39,44,.3); }

/* когда один чат развёрнут — остальные прячем, этот занимает всю панель */
#chatPanel.has-expanded { flex-wrap: nowrap; }
#chatPanel.has-expanded .chat-window:not(.expanded) { display: none; }
.chat-window.expanded {
  flex: 1 1 auto; width: 100%; max-width: 100%; height: 100%;
}

.chat-window-header {
  background: #fff; border-bottom: 1px solid #eee; padding: 10px 12px; display: flex;
  align-items: center; gap: 8px; flex-shrink: 0; box-shadow: 0 1px 8px rgba(0,0,0,.03); z-index: 1;
}
.chat-window-header .chat-avatar { width: 30px; height: 30px; font-size: 12px; }
.chat-window-header .contact { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.chat-window-header .contact b { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-window-header .contact span { font-size: 11px; color: #888; }
.typing-hint { font-size: 11px; color: #b8272c; font-style: italic; padding: 4px 16px; display: none; background: #fff; }
.typing-hint.visible { display: block; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: #666; cursor: pointer; flex-shrink: 0; }
.switch input { display: none; }
.switch .track { width: 32px; height: 18px; border-radius: 999px; background: #ddd; position: relative; transition: background .15s ease; }
.switch .track::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; transition: transform .15s ease; box-shadow: 0 1px 3px rgba(0,0,0,.35);
}
.switch input:checked + .track { background: #7c3aed; }
.switch input:checked + .track::after { transform: translateX(14px); }
.chat-window-expand {
  border: none; background: transparent; color: #999; width: 26px; height: 26px; border-radius: 7px;
  cursor: pointer; flex-shrink: 0; transition: background .15s ease, color .15s ease;
  display: flex; align-items: center; justify-content: center;
}
.chat-window-expand svg { width: 15px; height: 15px; }
.chat-window-expand:hover { background: #f4f3f2; color: #666; }
.chat-window-close {
  border: none; background: transparent; color: #bbb; width: 22px; height: 22px; border-radius: 50%;
  cursor: pointer; font-size: 12px; flex-shrink: 0; transition: background .15s ease, color .15s ease;
}
.chat-window-close:hover { background: #f4f3f2; color: #666; }

.chat-window-messages { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px;background: #faf8f6 radial-gradient(circle at 1px 1px, #efece7 1px, transparent 0);background-size: 20px 20px;}

.msg-row { display: flex; flex-direction: column; max-width: 82%; position: relative; }
.msg-row.client { align-self: flex-start; align-items: flex-start; padding-right: 30px; }
.msg-row.operator { align-self: flex-end; align-items: flex-end; padding-left: 30px; }
.msg-row.ai { align-self: flex-end; align-items: flex-end; }
.msg-row.system { align-self: center; align-items: center; max-width: 100%; }

.msg { padding: 9px 14px; border-radius: 18px; font-size: 12.5px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; position: relative; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.msg.client { background: #fff; border: 1px solid #eee; color: #262626; }
.msg.operator { background: linear-gradient(135deg, #b8272c, #971f23); color: #fff; }
.msg.ai { background: linear-gradient(135deg, #7c3aed, #6425c9); color: #fff; }
.msg.system { background: transparent; color: #999; font-size: 11.5px; box-shadow: none; padding: 4px 8px; }
.msg .author-label { font-size: 10px; font-weight: 700; opacity: .7; margin-bottom: 3px; text-transform: uppercase; letter-spacing: .03em; }

.msg-audio{display:block;margin-top:4px;max-width:220px}
.msg-image{display:block;max-width:220px;border-radius:8px;margin-top:4px}
.msg-file{display:inline-block;margin-top:4px;font-size:11.5px;color:inherit;text-decoration:underline}
#imgLightbox{display:none;position:fixed;inset:0;background:rgba(0,0,0,.82);z-index:9999;align-items:center;justify-content:center;cursor:zoom-out}
#imgLightbox.visible{display:flex}
#imgLightbox img{max-width:90vw;max-height:90vh;border-radius:8px;box-shadow:0 20px 60px rgba(0,0,0,.5)}

.msg-time { font-size: 10px; color: #aaa; }
.msg.deleted { opacity: .5; }
.msg-row .deleted-tag { font-size: 10.5px; font-style: italic; color: #d33; }
.msg-meta { display: flex; align-items: center; gap: 6px; margin-top: 4px; padding: 0 6px; }

.msg-row .delete-btn {
  position: absolute; top: 6px; border: none; background: #fff; color: #bbb; cursor: pointer;
  font-size: 12px; display: none; width: 22px; height: 22px; border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,.15);
  align-items: center; justify-content: center;
}
.msg-row.client .delete-btn { right: 0; }
.msg-row.operator .delete-btn { left: 0; }
.msg-row.client:hover .delete-btn,
.msg-row.operator:hover .delete-btn { display: flex; }
.msg-row .delete-btn:hover { color: #d33; }

.chat-window-replybar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; background: #fff; border-top: 1px solid #eee; flex-shrink: 0; position: relative; }
.replybar-emoji-picker { position: absolute; bottom: 52px; left: 12px; background: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.15); padding: 8px; display: none; grid-template-columns: repeat(6, 1fr); gap: 4px; z-index: 20; width: 220px; overflow: hidden; }
.replybar-emoji-picker.open { display: grid; }
.replybar-emoji-picker span { font-size: 18px; text-align: center; cursor: pointer; border-radius: 6px; padding: 4px; }
.replybar-emoji-picker span:hover { background: #f4f3f2; }
.chat-window-replybar textarea {
  flex: 1; resize: none; border: 1.5px solid #e6e2e0; border-radius: 10px; padding: 8px 10px;
  font-size: 12px; font-family: inherit; max-height: 60px; outline: none; background: #faf9f8;
  transition: border-color .15s ease, background .15s ease;
}
.chat-window-replybar textarea:focus { border-color: #b8272c; background: #fff; box-shadow: 0 0 0 3px rgba(184,39,44,.1); }
.chat-window-replybar textarea:disabled { background: #f4f3f2; color: #aaa; }
.replybar-action-btn {
  background: linear-gradient(135deg, #b8272c, #971f23); border: none; color: #fff; width: 36px; height: 36px; border-radius: 10px; cursor: pointer;
  box-shadow: 0 4px 12px rgba(184,39,44,.25); transition: transform .12s ease; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 14px; outline: none;
}
.replybar-action-btn:hover { transform: translateY(-1px); }
.replybar-action-btn:disabled { opacity: .5; cursor: default; transform: none; box-shadow: none; }

.replybar-icon-btn { border: none; outline: none; background: transparent; color: #999; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: background .15s ease, color .15s ease; }
.replybar-icon-btn:hover { background: #f4f3f2; color: #666; }
.replybar-icon-btn:disabled { opacity: .5; cursor: default; }
.replybar-icon-btn svg { width: 18px; height: 18px; display: block; }

#topbar .who-info {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.25);
  padding: 5px 12px 5px 5px;
  border-radius: 999px;
}

#contactInfoModal{display:none;position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:9999;align-items:center;justify-content:center}
#contactInfoModal.visible{display:flex}

#contactInfoCard{background:#fdfcfb;border-radius:20px;padding:36px 30px 26px;width:max-content;min-width:340px;max-width:92vw;box-shadow:0 30px 70px rgba(0,0,0,.35);position:relative;text-align:center}
#contactInfoClose{position:absolute;top:16px;right:16px;width:26px;height:26px;border-radius:50%;border:none;background:#f4f3f2;color:#888;cursor:pointer;font-size:12px;display:flex;align-items:center;justify-content:center}
#contactInfoClose:hover{background:#ece9e7;color:#666}
.contact-info-avatar{width:88px;height:88px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff;font-weight:700;font-size:34px;margin:0 auto 16px;box-shadow:0 0 0 6px #fff, 0 8px 20px rgba(0,0,0,.15)}
.contact-info-name{font-size:19px;font-weight:800;color:#1a1a1a;margin-bottom:24px}
.contact-info-rows{display:flex;flex-direction:column;text-align:left}
.contact-info-row{display:flex;align-items:center;gap:14px;padding:14px 0;border-bottom:1px solid #f0eeec}
.contact-info-row:last-child{border-bottom:none}
.contact-info-icon{width:40px;height:40px;border-radius:11px;background:#fbe4e2;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.contact-info-icon svg{width:18px;height:18px;color:#c0392b}
.contact-info-text{display:flex;flex-direction:column;gap:2px}
.contact-info-label{font-size:10.5px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:#c0392b}
.contact-info-value{font-size:14.5px;color:#262626;font-weight:500;white-space:nowrap}
.contact-info-value.empty{color:#bbb;font-style:italic;font-weight:400}

.chat-window-header .avatar-wrap{cursor:pointer}
.chat-window-header .contact{cursor:pointer}
.chat-window-header .contact:hover b{text-decoration:underline}

.chat-item.wait-waiting { border-left: 3px solid #e0a020; }
.chat-item.wait-urgent { border-left: 3px solid #d9363e; background: #fdf4f2; }
.wait-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; margin-top: 6px; width: fit-content; }
.wait-pill .wait-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.wait-pill.waiting { background: #fbe8c8; color: #8a5a12; }
.wait-pill.waiting .wait-dot { background: #e0a020; }
.wait-pill.urgent { background: #f7c1c1; color: #791f1f; }
.wait-pill.urgent .wait-dot { background: #d9363e; }
.wait-pill.answered { background: #f0f0f0; color: #777; }
.wait-pill.answered .wait-dot { background: #999; }
.unread-badge.waiting { background: #e0a020; }
.unread-badge.urgent { background: #d9363e; }

.switch.mini { gap: 0; }
.switch.mini .track { width: 24px; height: 14px; }
.switch.mini .track::after { width: 10px; height: 10px; }
.switch.mini input:checked + .track::after { transform: translateX(10px); }
.chat-item.selection-mode .ai-toggle-mini { display: none; }
.chat-item.selection-mode .ai-toggle-list { display: none; }
.chat-item .row1 { align-items: baseline; }
.chat-item .preview-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chat-item .preview-row .preview { flex: 1; min-width: 0; }
.chat-item .ai-toggle-list { color: #aaa; }

.wait-pill.hidden-pill { visibility: hidden; }