.cw-shell {
  --cw-page: #f7f8fa; --cw-panel: #fff; --cw-soft: #f1f3f6; --cw-hover: #e9edf3;
  --cw-border: #e0e4ea; --cw-text: #222936; --cw-muted: #697382; --cw-accent: #256fce;
  --cw-out: #dcecff; --cw-in: #fff; --cw-compose: #fff;
  display: grid; grid-template-columns: 320px minmax(0, 1fr); height: max(630px, calc(100dvh - 125px));
  max-height: 1100px; min-width: 0; overflow: hidden; border: 1px solid var(--cw-border); border-radius: 10px;
  color: var(--cw-text); background: var(--cw-page); box-shadow: 0 10px 35px #0000000a;
}
html.dark .cw-shell { --cw-page: #101113; --cw-panel: #151619; --cw-soft: #202126; --cw-hover: #282b33; --cw-border: #303238; --cw-text: #e6e7eb; --cw-muted: #a1a4ad; --cw-accent: #80b7ff; --cw-out: #15365f; --cw-in: #27292d; --cw-compose: #18191d; }
.cw-shell *, .cw-shell *::before, .cw-shell *::after { box-sizing: border-box; }
.cw-shell button, .cw-shell a { transition: background-color .15s, color .15s; }
.cw-shell button:focus-visible, .cw-shell a:focus-visible, .cw-shell input:focus-visible, .cw-shell textarea:focus-visible, .cw-shell select:focus-visible { outline: 2px solid var(--cw-accent); outline-offset: 2px; }
.cw-shell .material-symbols-outlined { font-size: 19px; line-height: 1; }
.cw-list-pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--cw-panel); border-right: 1px solid var(--cw-border); }
.cw-list-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 17px 12px; }
.cw-list-header h2 { font-size: 20px; line-height: 1.25; font-weight: 700; letter-spacing: -.02em; }
.cw-list-header p { margin-top: 3px; color: var(--cw-muted); font-size: 12px; }
.cw-icon-button { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 34px; height: 34px; border: 0; border-radius: 7px; color: var(--cw-muted); background: transparent; }
.cw-icon-button:hover { color: var(--cw-text); background: var(--cw-hover); }
.cw-search { display: flex; align-items: center; gap: 8px; margin: 3px 12px 12px; padding: 0 10px; border: 1px solid var(--cw-border); border-radius: 7px; background: var(--cw-page); color: var(--cw-muted); }
.cw-search input, html.dark .cw-search input { width: 100%; height: 36px; padding: 0; border: 0; outline: 0; box-shadow: none; background: transparent; color: var(--cw-text); font-size: 13px; }
.cw-search input:focus { outline: 0; box-shadow: none; }
.cw-tabs { display: flex; overflow-x: auto; scrollbar-width: thin; padding: 0 10px; border-bottom: 1px solid var(--cw-border); }
.cw-tabs button { flex: none; padding: 10px 8px 9px; border-bottom: 2px solid transparent; white-space: nowrap; color: var(--cw-muted); font-size: 12px; font-weight: 600; }
.cw-tabs button[aria-pressed="true"] { border-color: var(--cw-accent); color: var(--cw-accent); }
.cw-list-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.cw-thread { display: flex; gap: 11px; align-items: flex-start; width: 100%; padding: 15px 13px; border-bottom: 1px solid var(--cw-border); text-align: left; color: var(--cw-text); }
.cw-thread:hover, .cw-thread.is-active { background: var(--cw-hover); }
.cw-thread.is-active { box-shadow: inset 3px 0 var(--cw-accent); }
.cw-avatar { position: relative; display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 42px; height: 42px; overflow: hidden; border-radius: 50%; background: #324859; color: #dbedff; font-size: 13px; font-weight: 700; }
.cw-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cw-avatar-header { width: 38px; height: 38px; }
.cw-avatar-large { width: 60px; height: 60px; font-size: 19px; }
.cw-thread-content { flex: 1; min-width: 0; }
.cw-thread-top, .cw-thread-bottom { display: flex; align-items: center; gap: 8px; }
.cw-thread-top strong { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 650; }
.cw-thread-top time { flex: none; color: var(--cw-muted); font-size: 10px; }
.cw-thread-channel { display: block; overflow: hidden; margin-top: 3px; color: var(--cw-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.cw-thread-channel .material-symbols-outlined { font-size: 13px; vertical-align: -2px; }
.cw-thread-bottom { margin-top: 5px; }
.cw-thread-preview { flex: 1; overflow: hidden; color: var(--cw-muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.cw-unread { display: inline-flex; min-width: 19px; height: 19px; align-items: center; justify-content: center; padding: 0 5px; border-radius: 99px; background: #3485e8; color: white; font-size: 10px; font-weight: 700; }
.cw-list-empty { padding: 36px 20px; color: var(--cw-muted); text-align: center; font-size: 13px; line-height: 1.6; }
.cw-list-empty button, .cw-load-more { color: var(--cw-accent); font-size: 12px; font-weight: 600; }
.cw-load-more { padding: 12px; border-top: 1px solid var(--cw-border); }
.cw-workspace { position: relative; min-width: 0; min-height: 0; }
.cw-empty { display: flex; height: 100%; align-items: center; justify-content: center; flex-direction: column; gap: 8px; padding: 24px; text-align: center; color: var(--cw-muted); }
.cw-empty > .material-symbols-outlined { margin-bottom: 6px; font-size: 38px; color: var(--cw-accent); }
.cw-empty h3 { color: var(--cw-text); font-size: 17px; font-weight: 650; }
.cw-empty p { max-width: 320px; font-size: 13px; line-height: 1.6; }
.cw-empty button { color: var(--cw-accent); font-size: 13px; }
.cw-spin { animation: cw-spin 1.2s linear infinite; } @keyframes cw-spin { to { transform: rotate(360deg); } }
.cw-conversation { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 255px; height: 100%; min-width: 0; min-height: 0; }
.cw-conversation.cw-details-hidden { grid-template-columns: minmax(0, 1fr); }
.cw-conversation.cw-details-hidden .cw-details { display: none; }
.cw-chat-column { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.cw-chat-header { display: flex; align-items: center; gap: 10px; min-height: 69px; padding: 12px 16px; border-bottom: 1px solid var(--cw-border); background: var(--cw-panel); }
.cw-chat-identity { flex: 1; min-width: 0; }
.cw-chat-identity h2 { overflow: hidden; font-size: 15px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.cw-chat-identity p { margin-top: 3px; overflow: hidden; color: var(--cw-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.cw-header-actions { display: flex; gap: 3px; }
.cw-mobile-back { display: none; }
.cw-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 5px 16px; color: var(--cw-muted); font-size: 10px; }
.cw-status [data-chat-connection]::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: #40bd8b; vertical-align: 1px; }
.cw-offline .cw-status [data-chat-connection] { color: #e27d78; }
.cw-offline .cw-status [data-chat-connection]::before { background: #e27d78; }
.cw-status [data-chat-warning]:not(:empty) { color: #e27d78; }
.cw-status button { margin-left: auto; color: var(--cw-accent); font-weight: 600; }
.cw-feed { display: flex; flex: 1; flex-direction: column; gap: 8px; min-height: 0; overflow-y: auto; padding: 18px 18px 22px; }
.cw-message { display: flex; }
.cw-message.is-outgoing { justify-content: flex-end; }
.cw-bubble { position: relative; min-width: 100px; max-width: min(82%, 570px); padding: 10px 13px 9px; border: 1px solid var(--cw-border); border-radius: 12px 12px 12px 3px; background: var(--cw-in); color: var(--cw-text); box-shadow: 0 1px 2px #0000000a; }
.cw-message.is-outgoing .cw-bubble { border-color: transparent; border-radius: 12px 12px 3px 12px; background: var(--cw-out); }
.cw-message-body { overflow-wrap: anywhere; white-space: pre-wrap; font-size: 14px; line-height: 1.55; }
.cw-message-meta { margin-top: 5px; color: var(--cw-muted); font-size: 10px; text-align: right; }
.cw-message-source, .cw-media-label { display: block; margin-bottom: 5px; color: var(--cw-muted); font-size: 11px; font-weight: 600; }
.cw-quote, .cw-reply-preview { padding: 7px 10px; border-left: 3px solid var(--cw-accent); border-radius: 4px; background: #8080801c; color: var(--cw-muted); font-size: 12px; }
.cw-quote { margin-bottom: 8px; }
.cw-message-reply { position: absolute; z-index: 1; top: 2px; right: 5px; display: inline-block; min-height: 28px !important; padding: 4px 8px !important; border-radius: 5px; background: var(--cw-soft); color: var(--cw-accent); font-size: 11px; font-weight: 600; opacity: 0; }
.cw-message:hover .cw-message-reply, .cw-message:focus-within .cw-message-reply { opacity: 1; }
.cw-media-button { margin: 4px 0 8px; padding: 8px 10px; border: 1px solid var(--cw-border); border-radius: 6px; color: var(--cw-accent); font-size: 12px; }
.cw-media-image { display: block; max-width: 100%; max-height: 300px; margin: 4px 0 8px; border-radius: 7px; }
.cw-composer { flex: 0 0 auto; margin: 0 13px 13px; padding: 10px 12px; border: 1px solid var(--cw-border); border-radius: 10px; background: var(--cw-compose); }
.cw-composer-top { color: var(--cw-muted); font-size: 12px; }
.cw-composer-top select, html.dark .cw-composer-top select { width: auto; padding: 5px 26px 5px 8px; border: 0; border-radius: 6px; background-color: var(--cw-soft); color: var(--cw-text); font-size: 12px; }
.cw-textarea-label { display: block; }
.cw-textarea-label textarea, html.dark .cw-textarea-label textarea { display: block; width: 100%; min-height: 64px; max-height: 150px; resize: vertical; padding: 10px 2px; border: 0; outline: 0; box-shadow: none; background: transparent; color: var(--cw-text); font-size: 13px; }
.cw-textarea-label textarea:focus { outline: 0; box-shadow: none; }
.cw-composer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--cw-muted); font-size: 11px; }
.cw-composer-bottom button { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 6px; background: #256dbe; color: white; font-size: 12px; font-weight: 650; }
.cw-composer-bottom button:hover { background: #1d60ae; }
.cw-composer-bottom button:disabled { opacity: .45; cursor: not-allowed; }
.cw-reply-preview { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.cw-reply-preview button { color: var(--cw-accent); }
.cw-attachment, .cw-upload { display: block; margin-top: 7px; color: var(--cw-muted); font-size: 11px; }
.cw-attachment input { max-width: 220px; }
.cw-contact-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; font-size: 11px; }
.cw-contact-fields input, html.dark .cw-contact-fields input { display: block; width: 100%; margin-top: 4px; padding: 6px; border: 1px solid var(--cw-border); border-radius: 4px; background: var(--cw-page); color: var(--cw-text); }
.cw-shell .hidden { display: none !important; }
.cw-details { min-width: 0; overflow-y: auto; padding: 12px; border-left: 1px solid var(--cw-border); background: var(--cw-panel); }
.cw-details-title { padding: 8px 12px; border-radius: 6px; background: var(--cw-hover); color: var(--cw-accent); text-align: center; font-size: 12px; font-weight: 600; }
.cw-details-profile { padding: 22px 5px 12px; }
.cw-details-profile h3 { margin-top: 12px; overflow-wrap: anywhere; font-size: 16px; font-weight: 700; }
.cw-details-profile p { margin-top: 4px; color: var(--cw-muted); font-size: 12px; }
.cw-detail-list { display: grid; gap: 12px; padding: 8px 5px 18px; }
.cw-detail-list > div { display: flex; align-items: flex-start; gap: 9px; min-width: 0; color: var(--cw-muted); font-size: 12px; }
.cw-detail-list > div[hidden] { display: none; }
.cw-detail-list dd { min-width: 0; overflow-wrap: anywhere; }
.cw-detail-list .material-symbols-outlined { font-size: 16px; }
.cw-detail-actions { display: grid; gap: 6px; padding-top: 12px; border-top: 1px solid var(--cw-border); }
.cw-detail-actions a, .cw-detail-actions button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px; border-radius: 6px; color: var(--cw-text); text-align: left; font-size: 12px; }
.cw-detail-actions a:hover, .cw-detail-actions button:hover { background: var(--cw-hover); }
.cw-details-note { margin: 18px 5px 0; color: var(--cw-muted); font-size: 11px; line-height: 1.5; }
@media (max-width: 1250px) { .cw-conversation { grid-template-columns: minmax(0, 1fr); } .cw-details { position: absolute; z-index: 3; top: 69px; right: 0; bottom: 0; width: min(280px, 85%); box-shadow: -10px 0 25px #0003; } }
@media (max-width: 780px) { .cw-shell { display: block; height: calc(100dvh - 145px); min-height: 420px; } .cw-list-pane, .cw-workspace { height: 100%; } .cw-workspace { display: none; } .cw-show-conversation .cw-list-pane { display: none; } .cw-show-conversation .cw-workspace { display: block; } .cw-mobile-back { display: inline-flex; } .cw-bubble { max-width: 90%; } }
@media (max-width: 420px) { .cw-chat-header { padding: 10px 8px; } .cw-header-actions { gap: 0; } .cw-composer { margin: 0 8px 8px; } .cw-composer-bottom span { max-width: 160px; } }
@media (hover: none) { .cw-message-reply { opacity: 1; } .cw-bubble.cw-has-reply { padding-top: 32px; } }
.lead-overview, .lead-results { overflow: hidden; border-radius: 9px; }
.lead-summary > * { min-width: 0; }
.lead-summary .material-symbols-outlined { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px; background: rgb(var(--sm-secondary) / .09); }
.lead-identity { display: flex; align-items: center; gap: 11px; width: 100%; }
.lead-initials { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; background: rgb(var(--sm-secondary) / .13); color: rgb(var(--sm-secondary)); font-size: 11px; font-weight: 700; }
