.contact-button[data-open-support] { border: 0; cursor: pointer; }

.support-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 108;
  height: 50px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 18px 0 11px;
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 17px;
  background: linear-gradient(135deg, #20cfbd, #12ac9e);
  color: #0d3935;
  box-shadow: 0 15px 38px rgba(20, 178, 163, .34);
  cursor: pointer;
  font-size: 12px;
  font-weight: 780;
  transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}
.support-launcher:hover { transform: translateY(-2px); box-shadow: 0 19px 44px rgba(20,178,163,.4); }
.support-launcher-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 11px; background: rgba(255,255,255,.3); }
.support-launcher svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.support-launcher b { position: absolute; right: -5px; top: -6px; min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 5px; border: 2px solid var(--bg); border-radius: 12px; background: #fa5c76; color: #fff; font-size: 10px; box-shadow: 0 5px 14px rgba(250,92,118,.35); }
.support-launcher[hidden], .support-launcher b[hidden] { display: none !important; }
body.support-open .support-launcher { opacity: 0; pointer-events: none; transform: translateY(8px); }

.support-panel {
  position: fixed;
  right: 24px;
  bottom: 22px;
  z-index: 109;
  width: min(390px, calc(100vw - 28px));
  height: min(650px, calc(100vh - 36px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 30px 100px rgba(17, 26, 37, .26);
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px) scale(.97);
  transform-origin: right bottom;
  transition: opacity .24s ease, transform .24s ease, visibility .24s;
}
.support-panel.open { opacity: 1; visibility: visible; transform: none; }
.support-header { min-height: 91px; display: grid; grid-template-columns: 46px minmax(0, 1fr) 34px; align-items: center; gap: 12px; padding: 15px 17px; background: radial-gradient(circle at 20% 0, rgba(42,211,192,.22), transparent 43%), linear-gradient(135deg, #121a21, #151625); color: #fff; }
.support-agent-mark { position: relative; width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid rgba(76,231,213,.24); border-radius: 15px; background: linear-gradient(145deg, rgba(39,214,194,.18), rgba(121,98,226,.16)); }
.support-agent-mark::before { content: ""; width: 17px; height: 13px; border: 2px solid #53dfd0; border-radius: 8px; }
.support-agent-mark::after { content: ""; position: absolute; width: 5px; height: 5px; right: 13px; bottom: 11px; border-left: 2px solid #53dfd0; border-bottom: 2px solid #53dfd0; transform: rotate(-18deg); }
.support-agent-mark span { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border: 3px solid #151821; border-radius: 50%; background: #38d8bd; box-shadow: 0 0 10px rgba(56,216,189,.65); }
.support-header > div:nth-child(2) > span { color: #8a959e; font-size: 9px; font-weight: 850; letter-spacing: 1.8px; }
.support-header h2 { margin: 3px 0 4px; font-size: 18px; letter-spacing: -.4px; }
.support-header p { display: flex; align-items: center; gap: 6px; margin: 0; color: #9caaae; font-size: 10px; }
.support-header p i { width: 6px; height: 6px; border-radius: 50%; background: #36d8bf; box-shadow: 0 0 9px rgba(54,216,191,.7); }
.support-header p.offline i { background: #eba94f; box-shadow: 0 0 9px rgba(235,169,79,.55); }
.support-header > button { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.09); border-radius: 11px; background: rgba(255,255,255,.055); color: #9ca5ad; cursor: pointer; font-size: 19px; }

.support-reference { min-height: 39px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 15px; border-bottom: 1px solid var(--line); background: var(--surface-2); color: #6f7882; font-size: 10px; }
.support-reference > span { font-weight: 700; }
.support-reference small { color: #8d959e; font-size: 9px; }
.support-messages { min-height: 0; overflow-y: auto; padding: 16px 14px; background: linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 72%, transparent), var(--surface)); scrollbar-width: thin; scrollbar-color: #cbd1d6 transparent; }
.support-loading { height: 100%; min-height: 180px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 9px; color: #7e8790; font-size: 11px; }
.support-loading[hidden], .support-welcome[hidden] { display: none !important; }
.support-loading i { width: 19px; height: 19px; border: 2px solid rgba(22,200,184,.15); border-top-color: var(--accent); border-radius: 50%; animation: supportSpin .8s linear infinite; }
@keyframes supportSpin { to { transform: rotate(360deg); } }
.support-welcome { margin: 4px 0 17px; padding: 17px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: 0 10px 28px rgba(24,34,45,.05); text-align: center; }
.support-welcome-mark { width: 39px; height: 39px; display: grid; place-items: center; margin: 0 auto 10px; border-radius: 13px; background: var(--accent-soft); color: var(--accent-deep); font-size: 12px; font-weight: 850; }
.support-welcome strong { font-size: 14px; }
.support-welcome > p { margin: 7px auto 14px; color: #7b848d; font-size: 11px; line-height: 1.6; }
.support-profile-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; text-align: left; }
.support-profile-fields label { min-width: 0; color: #737d87; font-size: 10px; }
.support-profile-fields input { width: 100%; height: 36px; margin-top: 5px; padding: 0 9px; border: 1px solid var(--line); border-radius: 9px; outline: none; background: var(--surface-2); color: var(--text); font-size: 12px; }
.support-profile-fields input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(22,200,184,.08); }

.support-message { max-width: 84%; margin: 0 0 12px; }
.support-message.visitor { margin-left: auto; }
.support-message.system { max-width: 100%; margin: 12px auto; text-align: center; }
.support-message-head { display: flex; justify-content: space-between; gap: 12px; margin: 0 4px 5px; color: #858e97; font-size: 9px; }
.support-message.visitor .support-message-head { flex-direction: row-reverse; }
.support-message-bubble { padding: 10px 12px; border: 1px solid var(--line); border-radius: 5px 15px 15px; background: var(--surface-solid, #fff); color: var(--text); font-size: 12px; line-height: 1.6; word-break: break-word; box-shadow: 0 6px 18px rgba(25,34,45,.045); }
.support-message.visitor .support-message-bubble { border: 0; border-radius: 15px 5px 15px 15px; background: linear-gradient(135deg, #24cdbb, #16b6a8); color: #0d3834; box-shadow: 0 7px 20px rgba(22,182,168,.16); }
.support-message.system .support-message-head { display: none; }
.support-message.system .support-message-bubble { display: inline-block; padding: 6px 10px; border: 0; border-radius: 12px; background: var(--surface-2); color: #7f8891; font-size: 10px; box-shadow: none; }
.support-message-media { overflow: hidden; margin-bottom: 6px; border-radius: 12px; background: rgba(0,0,0,.08); }
.support-message-media button { width: 100%; display: block; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.support-message-media img { width: 100%; max-height: 260px; display: block; object-fit: cover; }
.support-message-media video { width: 100%; max-height: 260px; display: block; background: #0e1116; }
.support-message-file-meta { display: flex; justify-content: space-between; gap: 10px; padding: 6px 2px 0; color: #7f8891; font-size: 9px; }
.support-message.visitor .support-message-file-meta { color: rgba(8,47,43,.64); }

.support-composer { padding: 11px 13px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.support-composer > label { position: absolute; overflow: hidden; width: 1px; height: 1px; clip: rect(0 0 0 0); }
.support-composer textarea { width: 100%; min-height: 68px; max-height: 130px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 12px; outline: none; resize: none; background: var(--surface-2); color: var(--text); font: 12px/1.55 inherit; }
.support-composer textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(22,200,184,.08); }
.support-attachment-preview { position: relative; min-height: 60px; display: grid; grid-template-columns: 52px minmax(0,1fr) 28px; align-items: center; gap: 10px; margin-top: 8px; padding: 7px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.support-attachment-preview[hidden] { display: none !important; }
.support-attachment-preview > img, .support-attachment-preview > video { width: 52px; height: 52px; display: block; border-radius: 9px; background: #11161c; object-fit: cover; }
.support-attachment-preview > span { min-width: 0; }
.support-attachment-preview strong, .support-attachment-preview small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.support-attachment-preview strong { font-size: 11px; }
.support-attachment-preview small { margin-top: 5px; color: #7f8992; font-size: 9px; }
.support-attachment-preview > button { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: #8c959e; cursor: pointer; }
.support-composer-actions { min-height: 35px; display: grid; grid-template-columns: 35px minmax(0,1fr) auto auto; align-items: center; gap: 8px; padding-top: 8px; }
.support-composer-actions > span { overflow: hidden; color: #7f8891; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.support-composer-actions small { color: #9098a0; font-size: 9px; }
.support-composer-actions small b { color: #76808a; }
.support-attach-button { width: 35px; height: 35px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: #77818b; cursor: pointer; }
.support-attach-button:hover { border-color: var(--accent); color: var(--accent-deep); }
.support-attach-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#sendSupportMessage { height: 35px; display: flex; align-items: center; gap: 13px; padding: 0 13px; border: 0; border-radius: 10px; background: var(--accent); color: #0e3834; cursor: pointer; font-size: 11px; font-weight: 760; }
#sendSupportMessage i { font-style: normal; }
#sendSupportMessage:disabled, .support-attach-button:disabled, .support-composer textarea:disabled { cursor: wait; opacity: .55; }
.support-error { color: #df6277 !important; }

.support-media-viewer { position: fixed; inset: 0; z-index: 160; display: grid; place-items: center; padding: 30px; background: rgba(7,11,16,.88); backdrop-filter: blur(9px); }
.support-media-viewer[hidden] { display: none !important; }
.support-media-viewer img { max-width: min(100%, 1100px); max-height: calc(100vh - 60px); border-radius: 16px; box-shadow: 0 30px 100px rgba(0,0,0,.5); object-fit: contain; }
.support-media-viewer > button { position: absolute; right: 22px; top: 20px; width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.16); border-radius: 13px; background: rgba(255,255,255,.08); color: #fff; cursor: pointer; font-size: 25px; }

.dark .support-panel { border-color: rgba(255,255,255,.09); }
.dark .support-message-bubble { background: #232830; }
.dark .support-welcome { box-shadow: none; }

@media (max-width: 580px) {
  .support-launcher { right: 12px; bottom: 14px; height: 48px; padding-right: 15px; border-radius: 16px; }
  .support-panel { inset: auto 0 0; width: 100%; height: min(82dvh, 700px); border-right: 0; border-bottom: 0; border-left: 0; border-radius: 23px 23px 0 0; transform-origin: center bottom; }
  body.support-open { overflow: hidden; }
  .support-header { min-height: 83px; padding: 12px 15px; }
  .support-reference { padding: 0 13px; }
  .support-reference small { display: none; }
  .support-messages { padding: 14px 12px; }
  .support-profile-fields { grid-template-columns: 1fr; }
  .support-message { max-width: 88%; }
  .support-composer { padding-bottom: max(11px, env(safe-area-inset-bottom)); }
  .support-message-media img, .support-message-media video { max-height: 220px; }
  .support-media-viewer { padding: 14px; }
  .support-media-viewer > button { right: 12px; top: 12px; }
  .back-to-top { right: auto; left: 14px; bottom: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .support-panel, .support-launcher { transition-duration: .01ms !important; }
}
