.support-chat {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  height: calc(100dvh - 220px);
  min-height: 260px;
  border: 1px solid #dce4ee;
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
}
.support-chat[data-owner="false"] { grid-template-columns: minmax(0, 1fr); }
.support-chat-inbox { border-right: 1px solid #e2e8f0; overflow: auto; padding: 16px; }
.support-chat-inbox h2 { font-size: 1rem; margin: 0 0 12px; }
.support-chat-inbox button { display: block; width: 100%; border: 0; border-radius: 10px; background: transparent; text-align: left; padding: 11px; cursor: pointer; color: #1f2937; }
.support-chat-inbox button:hover, .support-chat-inbox button.active { background: #eef4ff; }
.support-chat-inbox strong, .support-chat-inbox small { display: block; }
.support-chat-inbox small { color: #64748b; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.support-chat-unread { float: right; background: #1d4ed8; color: white; border-radius: 12px; padding: 1px 7px; }
.support-chat-room { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.support-chat-room > header { flex: none; border-bottom: 1px solid #e2e8f0; padding: 16px 20px; }
.support-chat-room h2 { font-size: 1.08rem; margin: 0; }
.support-chat-room header small { color: #64748b; }
.support-chat-messages { flex: 1 1 0; min-height: 0; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.support-chat-empty { margin: auto; color: #64748b; }
.support-chat-bubble { max-width: min(75%, 620px); align-self: flex-start; background: #eef2f7; border-radius: 14px; padding: 9px 13px; overflow-wrap: anywhere; }
.support-chat-bubble.mine { align-self: flex-end; background: #dbeafe; }
.support-chat-bubble p { white-space: pre-wrap; margin: 3px 0 6px; }
.support-chat-bubble small { display: block; color: #526275; font-size: .72rem; }
.support-chat-bubble img, .support-chat-bubble video { display: block; max-width: 100%; max-height: 340px; border-radius: 8px; }
.support-chat-image-button { display: block; max-width: 100%; padding: 0; margin: 5px 0; border: 0; border-radius: 8px; background: transparent; cursor: zoom-in; }
.support-chat-image-button:focus-visible { outline: 3px solid #2563eb; outline-offset: 3px; }
.support-chat-image-viewer { width: calc(100vw - 32px); max-width: 1500px; max-height: calc(100dvh - 32px); padding: 0; border: 1px solid #334155; border-radius: 14px; background: #0f172a; color: #fff; overflow: auto; }
.support-chat-image-viewer::backdrop { background: rgb(2 6 23 / 85%); }
.support-chat-image-viewer > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-bottom: 1px solid #334155; }
.support-chat-image-viewer > header strong { min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.support-chat-image-viewer > header div { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.support-chat-image-viewer a { color: #bfdbfe; font-size: 13px; text-decoration: underline; }
.support-chat-image-viewer button { width: 36px; height: 36px; padding: 0; border: 1px solid #64748b; border-radius: 8px; background: #1e293b; color: #fff; font-size: 26px; cursor: pointer; }
.support-chat-image-viewer > img { display: block; width: 100%; height: auto; max-height: calc(100dvh - 112px); object-fit: contain; margin: 0 auto; }
.support-chat-older { flex: none; align-self: center; margin: 0 auto 8px; }
.support-chat-compose { flex: none; border-top: 1px solid #e2e8f0; padding: 12px 16px; background: #fff; }
.support-chat-compose textarea { width: 100%; resize: vertical; box-sizing: border-box; }
.support-chat-compose-hint { display: block; margin-top: 5px; color: #64748b; font-size: 11px; line-height: 1.6; }
.support-chat-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.support-chat-actions > span { flex: 1; font-size: .8rem; color: #526275; }
.support-chat-actions label { cursor: pointer; }
.support-chat[data-owner="true"] .support-chat-compose:has(textarea:disabled) { opacity: .55; }
@media (max-width: 700px) {
  main#main-content:has(> .support-chat) { display: flex; flex-direction: column; min-height: calc(100dvh - 64px); }
  .support-chat { flex: 1 1 0; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 25%) minmax(0, 1fr); height: auto; min-height: 300px; max-height: none; }
  .support-chat[data-owner="false"] { grid-template-rows: minmax(0, 1fr); }
  .support-chat-inbox { max-height: none; border-right: 0; border-bottom: 1px solid #e2e8f0; }
  .support-chat-messages { padding: 10px; }
  .support-chat-compose { padding: 8px 10px; }
  .support-chat-compose textarea { height: 54px; min-height: 42px; resize: none; }
  .support-chat-actions { gap: 6px; margin-top: 5px; }
  .support-chat-bubble { max-width: 90%; }
}
@media (max-width: 700px) and (max-height: 550px) {
  .support-chat-compose textarea { height: 42px; }
}
.support-chat, .workspace-modern-shell .support-chat { flex: none; height: var(--support-chat-height, calc(100dvh - 285px)); min-height: 240px; }
.support-chat-actions, .workspace-modern-shell .support-chat-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 10px; }
.support-chat-actions > label { margin: 0; justify-self: start; }
.support-chat-actions > button { grid-column: 2; grid-row: 1; }
.support-chat-actions > span { grid-column: 1 / -1; grid-row: 2; min-width: 0; overflow-wrap: anywhere; }
.support-chat-actions > span:empty { display: none; }
@media (max-height: 600px) {
  main#main-content:has(> .support-chat) > .page-heading { display: none; }
  .support-chat-room > header, .workspace-modern-shell .support-chat-room > header { padding: 8px 12px; }
  .support-chat-compose { padding: 8px 10px; }
  .support-chat-compose textarea { height: 44px; min-height: 44px; resize: none; }
  .support-chat-messages { padding: 6px 10px; }
}
.support-chat-back { display: none; }
.support-chat-widget { position: fixed; z-index: 65; right: max(24px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); color: #243753; }
.support-chat-launcher { position: relative; display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 54px; padding: 0 21px; border: 1px solid #6675dd; border-radius: 999px; color: #fff; background: #4e5dca; box-shadow: 0 8px 25px #34468c40; font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; }
.support-chat-launcher:hover { background: #4050b7; }
.support-chat-launcher .icon { width: 23px; height: 23px; }
.support-chat-launcher-badge { position: absolute; top: -6px; right: -5px; min-width: 22px; padding: 2px 5px; border: 2px solid #fff; border-radius: 99px; background: #d83b57; color: #fff; font-size: 11px; line-height: 16px; }
.support-chat-window { position: absolute; right: 0; bottom: 68px; display: flex; flex-direction: column; width: min(410px, calc(100vw - 32px)); height: min(610px, calc(var(--support-widget-viewport, 100dvh) - 110px)); min-height: 0; max-height: calc(var(--support-widget-viewport, 100dvh) - 110px); overflow: hidden; border: 1px solid #dce3ee; border-radius: 18px; background: #fff; box-shadow: 0 16px 60px #17284733; }
.support-chat-window:has([data-owner="true"]) { width: min(740px, calc(100vw - 32px)); }
.support-chat-window[hidden], .support-chat-launcher-badge[hidden] { display: none; }
.support-chat-window-heading { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; background: #4e5dca; color: #fff; }
.support-chat-window-heading > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.support-chat-window-heading strong { font-size: 15px; }
.support-chat-window-heading small { color: #e0e5ff; font-size: 12px; }
.support-chat-online { width: 8px; height: 8px; border-radius: 50%; background: #a2e7c4; }
.support-chat-window-heading > button { flex: none; display: grid; place-items: center; width: 34px; height: 34px; padding: 6px; border: 1px solid #ffffff38; border-radius: 9px; background: #ffffff10; color: #fff; cursor: pointer; }
.support-chat-widget button:focus-visible { outline: 3px solid #7db9ff; outline-offset: 3px; }
.support-chat-window .support-chat { flex: 1 1 0; height: auto; min-height: 0; border: 0; border-radius: 0; grid-template-columns: minmax(185px, 225px) minmax(0, 1fr); }
.support-chat-window .support-chat[data-owner="false"] { grid-template-columns: minmax(0, 1fr); }
.support-chat-window .support-chat-room > header { display: flex; align-items: center; gap: 9px; padding: 10px 14px; }
.support-chat-window .support-chat-room h2 { font-size: 14px; }
.support-chat-window .support-chat-room header small { font-size: 11px; }
.support-chat-window .support-chat-messages { padding: 14px; overscroll-behavior: contain; }
.support-chat-window .support-chat-bubble { max-width: 90%; flex-shrink: 0; font-size: 13px; }
.support-chat-window .support-chat-bubble img, .support-chat-window .support-chat-bubble video { max-height: 210px; }
.support-chat-window .support-chat-compose { padding: 10px 12px; }
.support-chat-window .support-chat-compose textarea { min-height: 48px; height: 54px; max-height: 100px; resize: none; font-size: 16px; }
.support-chat-window .support-chat-compose-hint { font-size: 10px; }
.support-chat-window .support-chat-actions { gap: 4px 8px; }
.support-chat-window .support-chat-actions .button { min-height: 34px; padding: 7px 10px; font-size: 12px; }
.support-chat-window .support-chat-inbox { padding: 12px; overscroll-behavior: contain; }
.support-chat-window .support-chat-inbox h2 { font-size: 14px; }
.support-chat-window .support-chat-inbox input { width: 100%; min-width: 0; font-size: 16px; }
.support-chat-widget[data-compact="true"] .support-chat-window-heading { padding: 7px 12px; }
.support-chat-widget[data-compact="true"] .support-chat-room > header { padding: 5px 12px; }
.support-chat-widget[data-compact="true"] .support-chat-compose { padding: 6px 10px; }
.support-chat-widget[data-compact="true"] .support-chat-compose textarea { min-height: 38px; height: 38px; }
.support-chat-widget[data-compact="true"] .support-chat-compose-hint { display: none; }
@media (max-width: 700px) {
 .support-chat-widget { right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); }
 .support-chat-launcher { min-height: 50px; padding: 0 16px; }
 .support-chat-window, .support-chat-window:has([data-owner="true"]) { width: calc(100vw - 24px); bottom: calc(62px + var(--support-widget-offset, 0px)); height: min(610px, calc(var(--support-widget-viewport, 100dvh) - 92px)); max-height: calc(var(--support-widget-viewport, 100dvh) - 92px); border-radius: 15px; }
 .support-chat-window .support-chat { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
 .support-chat-window [data-owner="true"] .support-chat-room { display: none; }
 .support-chat-window [data-owner="true"][data-thread-open="true"] .support-chat-room { display: flex; }
 .support-chat-window [data-owner="true"][data-thread-open="true"] .support-chat-inbox { display: none; }
 .support-chat-window .support-chat-inbox { border-bottom: 0; }
 .support-chat-window .support-chat-back { display: block; width: 32px; height: 32px; border: 1px solid #dce3ee; border-radius: 8px; background: #f2f5fb; color: #4054aa; font-size: 25px; line-height: 1; cursor: pointer; }
}
@media (max-height: 550px) {
 .support-chat-window-heading { padding: 7px 12px; }
 .support-chat-window .support-chat-room > header { padding: 5px 12px; }
 .support-chat-window .support-chat-compose { padding: 6px 10px; }
 .support-chat-window .support-chat-compose textarea { min-height: 38px; height: 38px; }
 .support-chat-window .support-chat-compose-hint { display: none; }
}
.support-chat-launcher-text{display:flex;flex-direction:column;align-items:flex-start;line-height:1.5}
.support-chat-launcher-text>small{font-size:11px;font-weight:600;color:#ffe5ae}
.support-chat-launcher-text>small[hidden]{display:none}
.support-chat-widget:has([data-owner="true"])[data-has-unread="true"] .support-chat-launcher{background:#293d8f;border-color:#f0b657;box-shadow:0 0 0 3px #ffc96c40,0 8px 25px #24357035}
.support-chat-widget:has([data-owner="true"])[data-has-unread="true"] .support-chat-launcher-badge{background:#c22c47;min-width:26px;font-size:12px;font-weight:750;line-height:19px}
.support-chat-inbox .support-chat-inbox-filters{display:grid;grid-template-columns:1fr 1.3fr;gap:4px;background:#f0f3f9;padding:4px;border-radius:9px;margin-top:10px}
.support-chat-inbox .support-chat-inbox-filters>button{padding:7px 5px;min-width:0;border-radius:6px;font-size:11px;text-align:center;color:#70819b;background:transparent;line-height:1.6}
.support-chat-inbox .support-chat-inbox-filters>button[aria-pressed="true"]{color:#30478f;background:#fff;box-shadow:0 1px 4px #1e315b15;font-weight:700}
.support-chat-inbox .support-chat-inbox-hint{font-size:10px;color:#7e8ca3;line-height:1.7;margin:8px 0 4px}
.support-chat-inbox .support-chat-inbox-group{font-size:11px;font-weight:700;color:#7e8ca3;letter-spacing:0;margin:15px 0 7px;line-height:1.7}
.support-chat-inbox .support-chat-inbox-group[data-support-chat-group="unread"]{color:#aa3450}
.support-chat-inbox .support-chat-thread{padding:11px 10px;margin:0 0 6px;border:1px solid transparent;border-left:3px solid transparent;border-radius:10px;min-width:0;transition:background .15s,border-color .15s}
.support-chat-inbox .support-chat-thread.has-unread{background:#fff1f3;border-color:#f4d5dc;border-left-color:#d94463}
.support-chat-inbox .support-chat-thread.has-unread:hover{background:#ffe8ed}
.support-chat-inbox .support-chat-thread.active{border-color:#7f93d5;border-left-color:#5063b5;background:#edf1ff}
.support-chat-thread-heading{display:flex;gap:7px;align-items:flex-start;min-width:0}
.support-chat-thread-heading>strong{flex:1;min-width:0;font-size:12px;font-weight:600;line-height:1.6;overflow-wrap:anywhere}
.support-chat-thread.has-unread .support-chat-thread-heading>strong{font-weight:800;color:#712b41}
.support-chat-thread-heading>time{flex:none;max-width:75px;font-size:9px;color:#8a97ab;text-align:right;line-height:1.7}
.support-chat-inbox .support-chat-thread-preview{font-size:11px;line-height:1.7;margin-top:5px;color:#8793a5}
.support-chat-inbox .support-chat-thread.has-unread .support-chat-thread-preview{color:#663949;font-weight:600}
.support-chat-thread-meta{display:flex;align-items:center;justify-content:space-between;gap:7px;margin-top:7px;min-height:19px}
.support-chat-thread-user{font-size:10px;color:#8b96a8;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.support-chat-thread-meta .support-chat-unread{float:none;flex:none;background:#c53253;color:#fff;border-radius:6px;padding:2px 6px;font-size:10px;font-weight:700;line-height:1.5}
.support-chat-thread-meta .support-chat-unread[hidden]{display:none}
.support-chat-inbox .support-chat-inbox-empty{font-size:12px;line-height:1.8;padding:20px 8px;text-align:center;color:#75849b}
@media(max-width:700px){.support-chat-window .support-chat-inbox{padding:14px}.support-chat-thread-heading>time{max-width:none}.support-chat-inbox .support-chat-thread{padding:12px}.support-chat-thread-heading>strong{font-size:13px}.support-chat-widget:has([data-owner="true"])[data-has-unread="true"] .support-chat-launcher{min-height:58px}.support-chat-inbox .support-chat-inbox-filters>button{padding:8px;font-size:12px}}
@media(prefers-reduced-motion:reduce){.support-chat-inbox .support-chat-thread{transition:none}}
