.wof-chat { font: 14px/1.45 Roboto, Arial, sans-serif; color: #1c2933; letter-spacing: 0; text-align: left; }
.wof-chat *, .wof-chat *::before, .wof-chat *::after { box-sizing: border-box; letter-spacing: 0; }
.wof-chat [hidden], [data-chat-unread][hidden] { display: none !important; }
.wof-chat button, .wof-chat input, .wof-chat textarea { font: inherit; letter-spacing: 0; }
.wof-chat button { cursor: pointer; border-radius: 6px; transition: background-color .15s; }
.wof-chat button:disabled { cursor: default; opacity: .55; }
.wof-chat button:focus-visible, .wof-chat input:focus-visible, .wof-chat textarea:focus-visible { outline: 3px solid #317cbc; outline-offset: 2px; }
.wof-chat .chat-launcher { position: fixed; right: max(24px, env(safe-area-inset-right)); bottom: calc(max(24px, env(safe-area-inset-bottom)) + 72px); z-index: 1050; width: 56px; height: 56px; padding: 0; border-radius: 50%; background: #087a58; color: #fff; border: 1px solid #fff; box-shadow: 0 4px 18px #0003; font-size: 24px; display: grid; place-items: center; }
.chat-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 21px; height: 21px; border-radius: 12px; padding: 0 5px; background: #b12b36; color: #fff; font: 700 11px/1 Arial, sans-serif; }
.chat-launcher .chat-badge { position: absolute; right: -4px; top: -4px; }
.wof-chat .chat-panel { position: fixed; right: max(24px, env(safe-area-inset-right)); bottom: calc(max(24px, env(safe-area-inset-bottom)) + 140px); width: min(390px, calc(100vw - 32px)); height: min(550px, calc(100dvh - 192px)); z-index: 1051; display: flex; flex-direction: column; background: #f4f7f6; border: 1px solid #bdccc6; border-radius: 8px; box-shadow: 0 8px 32px #0003; overflow: hidden; }
.wof-chat .chat-header { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-shrink: 0; padding: 15px 16px; min-height: 70px; border-bottom: 1px solid #dce5e0; background: #fff; color: #1c2933; }
.wof-chat .chat-header > div { min-width: 0; flex: 1; }
.wof-chat .chat-header strong, .wof-chat .chat-header h2 { display: block; margin: 0; font: 700 16px/1.3 Roboto, Arial, sans-serif; color: #163d30; overflow-wrap: anywhere; }
.wof-chat .chat-header span, .wof-chat [data-chat-connection] { font-size: 12px; color: #53675d; }
.wof-chat .chat-icon { display: inline-grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; border: 1px solid #d4dfd8; background: #fff; color: #355447; padding: 0; font-size: 15px; }
.wof-chat .chat-icon:hover { background: #eaf3ed; }
.wof-chat .chat-log { flex: 1; min-height: 0; padding: 16px; overflow-y: auto; overscroll-behavior: contain; background: #f4f7f6; }
.wof-chat .chat-message { width: fit-content; max-width: 88%; margin: 0 0 12px; border: 1px solid #d9e3dd; border-radius: 6px; padding: 10px 12px; background: #fff; overflow-wrap: anywhere; }
.wof-chat .chat-message.mine { margin-left: auto; background: #d9f2e6; border-color: #bedfce; }
.wof-chat .chat-message p { color: #1c2933; margin: 0; font: 14px/1.5 Roboto, Arial, sans-serif; white-space: pre-wrap; overflow-wrap: anywhere; }
.wof-chat .chat-message small { display: block; margin-top: 5px; font-size: 11px; color: #55675d; }
.wof-chat .chat-composer { display: flex; flex-shrink: 0; align-items: flex-end; gap: 10px; margin: 0; padding: 12px; background: #fff; border-top: 1px solid #dce5e0; }
.wof-chat textarea { resize: none; width: 100%; min-width: 0; min-height: 48px; max-height: 120px; padding: 10px; border: 1px solid #a8bdb0; border-radius: 6px; background: #fff; color: #1c2933; line-height: 1.4; }
.wof-chat textarea::placeholder { color: #64756b; }
.wof-chat .chat-send { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; padding: 0; border: 0; background: #087a58; color: #fff; }
.wof-chat .chat-send:hover { background: #066548; }
.wof-chat .chat-empty { margin: 24px 0; text-align: center; color: #5d7064; font-size: 14px; }
.wof-chat .chat-error { padding: 10px 14px; margin: 0; color: #922d24; background: #fff0ed; font-size: 13px; }
.wof-chat .chat-older, .wof-chat .chat-new { flex-shrink: 0; background: #e8f3ed; color: #205c40; font-size: 12px; border: 0; border-radius: 0; min-height: 32px; }
.wof-chat .chat-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.wof-chat.chat-workspace { display: grid; grid-template-columns: 280px minmax(0, 1fr); height: max(520px, calc(100dvh - 155px)); max-height: 900px; border: 1px solid #c5d4ca; background: #fff; overflow: hidden; }
.wof-chat .chat-inbox { display: flex; flex-direction: column; min-height: 0; min-width: 0; border-right: 1px solid #d8e2db; }
.wof-chat .chat-inbox > header { padding: 18px 16px 12px; }
.wof-chat h1 { margin: 0; font: 700 22px/1.2 Roboto, Arial, sans-serif; color: #163d30; }
.wof-chat .chat-search { display: flex; gap: 10px; align-items: center; margin: 0 12px 12px; padding: 0 10px; border: 1px solid #b9cbbf; border-radius: 4px; color: #52685c; }
.wof-chat .chat-search input { width: 100%; min-width: 0; background: #fff; color: #1c2933; border: 0; height: 40px; padding: 4px 0; }
.wof-chat .chat-customer-list { flex: 1; overflow-y: auto; min-height: 0; }
.wof-chat .chat-customer { display: block; width: 100%; padding: 12px 16px; text-align: left; border: 0; border-bottom: 1px solid #e4ebe6; border-radius: 0; color: #1c2933; background: #fff; }
.wof-chat .chat-customer:hover, .wof-chat .chat-customer.active { background: #e7f3ec; }
.wof-chat .chat-customer > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wof-chat .chat-customer strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.wof-chat .chat-customer small { display: block; color: #52675a; font-size: 12px; }
.wof-chat .chat-customer p { color: #52675a; font: 12px/1.4 Roboto, Arial, sans-serif; margin: 4px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wof-chat .chat-conversation { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.wof-chat .chat-paging { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-top: 1px solid #d8e2db; }
.wof-chat .chat-toggle { display: flex; align-items: center; gap: 8px; flex-shrink: 0; max-width: 130px; cursor: pointer; }
.wof-chat .chat-toggle input { accent-color: #087a58; height: 20px; width: 20px; flex-shrink: 0; cursor: pointer; }
.wof-chat .chat-toggle span { font-size: 12px; color: #264c39; }
.wof-chat .chat-back { display: none; }
.wof-chat .chat-brand-mark { flex: 0 0 40px; width: 40px; height: 40px; object-fit: contain; }
.wof-chat .chat-brand-wordmark { flex-basis: 82px; width: 82px; }
body.brand-artemtrade .wof-chat { --chat-button: #245da9; --chat-tint: #e7effb; }
body.brand-bimbtrade .wof-chat { --chat-button: #075039; --chat-tint: #e7f2e7; }
body.brand-valburytrade .wof-chat { --chat-button: #b9182b; --chat-tint: #fbeaec; }
body.brand-dooinvestment .wof-chat { --chat-button: #b51c21; --chat-tint: #fbecea; }
.wof-chat .chat-launcher, .wof-chat .chat-send, .wof-chat .chat-save { background: var(--chat-button, #087a58); }
.wof-chat .chat-message.mine { background: var(--chat-tint, #d9f2e6); }
.wof-chat .chat-customer.active, .wof-chat .chat-customer:hover { background: var(--chat-tint, #e7f3ec); }
.wof-chat .chat-inbox-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.wof-chat .chat-bulk-actions { padding: 0 12px 12px; flex-shrink: 0; }
.wof-chat .chat-bulk-actions .chat-save { width: 100%; justify-content: center; }
.wof-chat .chat-bulk-status { margin: 8px 0 0; font-size: 12px; color: #355447; overflow-wrap: anywhere; }
.wof-chat .chat-bulk-status.is-error { color: #922d24; }
/* Keep the light inbox readable inside the branded dark admin shell. */
#wof-admin-chat h1, #wof-admin-chat h2 { color: #163d30; }
#wof-admin-chat strong { color: #1c2933; }
#wof-admin-chat small { color: #52675a !important; }
#wof-admin-chat label { color: #355447 !important; }
.wof-chat .chat-settings { width: min(460px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); border: 1px solid #c5d4ca; padding: 0; border-radius: 8px; color: #1c2933; background: #fff; overflow-y: auto; }
.wof-chat .chat-settings::backdrop { background: #152b24a6; }
.wof-chat .chat-settings h2 { margin: 0; font-size: 18px; }
.wof-chat .chat-settings-body { padding: 18px; display: grid; gap: 12px; }
.wof-chat .chat-setting-toggle { display: flex; gap: 12px; justify-content: space-between; align-items: center; padding: 6px 0; }
.wof-chat .chat-setting-toggle input { width: 20px; height: 20px; accent-color: #087a58; }
.wof-chat .chat-settings select { font: inherit; width: 100%; height: 42px; background: #fff; color: #1c2933; border: 1px solid #a8bdb0; border-radius: 6px; padding: 8px; }
.wof-chat .chat-settings textarea { min-height: 130px; max-height: 210px; resize: vertical; }
.wof-chat .chat-settings footer { display: flex; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid #dce5e0; }
.wof-chat .chat-save { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 18px; border: 0; color: #fff; background: #087a58; }
.wof-chat .chat-save { background: var(--chat-button, #087a58); }
body:not(.brand-woftrade) .wof-chat .chat-send:hover { background: var(--chat-button, #066548); filter: brightness(.95); }
@media (max-width: 900px) { .wof-chat.chat-workspace { grid-template-columns: 220px minmax(0, 1fr); } }
@media (max-width: 600px) {
    .wof-chat .chat-launcher { right: 16px; bottom: calc(max(16px, env(safe-area-inset-bottom)) + 144px); }
    .wof-chat .chat-panel { right: 12px; width: calc(100vw - 24px); bottom: calc(max(16px, env(safe-area-inset-bottom)) + 208px); height: min(520px, calc(100dvh - 252px)); }
    .wof-chat.chat-workspace { grid-template-columns: minmax(0, 1fr); height: calc(100dvh - 130px); min-height: 420px; max-height: none; }
    .wof-chat.chat-workspace .chat-conversation { display: none; }
    .wof-chat.chat-workspace.conversation-open .chat-inbox { display: none; }
    .wof-chat.chat-workspace.conversation-open .chat-conversation { display: flex; }
    .wof-chat .chat-inbox { border: 0; }
    .wof-chat .chat-back { display: inline-grid; }
    .wof-chat .chat-header { gap: 8px; padding: 12px; }
    .wof-chat .chat-toggle { max-width: 100px; }
}
