.support-widget {
  --chat-bg: #111f25;
  --chat-card: #1a2d35;
  --chat-ink: #eff9fa;
  --chat-muted: #b8cbd0;
  --chat-line: #3b515a;
  position: fixed;
  right: clamp(13px, 2vw, 30px);
  bottom: max(clamp(13px, 2vw, 28px), env(safe-area-inset-bottom));
  z-index: 8;
  display: grid;
  justify-items: end;
  gap: 10px;
  max-width: calc(100% - 26px);
}

.support-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.support-launcher {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 54px;
  padding: .5rem .97rem;
  color: var(--neon);
  background: var(--chat-bg);
  border: 1px solid #6ec4bd;
  border-radius: 30px;
  box-shadow: 0 8px 23px #10282c40;
  font-size: .89rem;
  font-weight: 750;
  transition: transform .2s ease, background .2s;
}
.support-launcher:hover { background: #1b373d; transform: translateY(-2px); }
.support-launcher svg { flex: none; }
.support-panel {
  width: min(100vw - 26px, 402px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: min(610px, calc(100dvh - 90px));
  color: var(--chat-ink);
  background: var(--chat-bg);
  border: 1px solid #59747b;
  border-radius: 18px;
  box-shadow: 0 18px 50px #06191e65;
  transform-origin: bottom right;
  animation: support-in .28s cubic-bezier(.2,.7,.22,1) both;
}
.support-widget :focus-visible { outline-color: var(--neon); outline-offset: 3px; }
.support-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .7rem;
  padding: .88rem 1rem;
  border-bottom: 1px solid var(--chat-line);
  background: linear-gradient(115deg, #23454b, #14262d 72%);
}
.support-emblem {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border: 1px solid #508780;
  border-radius: 50%;
  background: #193b40;
}
.support-emblem img { filter: drop-shadow(0 0 4px #61fff077); }
.support-head h2 { margin: 0; font-size: 1.17rem; line-height: 1.1; letter-spacing: -.035em; }
.support-head p { margin: 0 0 .2rem; color: #acd6d2; font-size: .66rem; font-weight: 720; letter-spacing: .09em; }
.support-close {
  align-self: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--chat-line);
  background: transparent;
  color: var(--chat-ink);
  font-size: 1.35rem;
  line-height: 1;
}
.support-close:hover { background: #29434a; }
.support-feed { min-height: 0; overflow: auto; padding: 1.05rem 1rem .8rem; scrollbar-color: #59747b var(--chat-bg); overscroll-behavior: contain; }
#support-log:empty { display: none; }
.support-welcome { display: grid; gap: .46rem; }
.support-welcome p { margin: 0; color: var(--chat-muted); font-size: .9rem; line-height: 1.4; }
.support-welcome .support-greeting { color: var(--chat-ink); font-size: 1.14rem; font-weight: 750; letter-spacing: -.025em; line-height: 1.2; }
.support-topics { display: grid; gap: .35rem; margin-top: .43rem; }
.support-topics button, .support-guide summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  min-height: 44px;
  width: 100%;
  padding: .42rem .66rem;
  text-align: left;
  font-size: .89rem;
  font-weight: 680;
}
.support-topics button {
  color: var(--chat-ink);
  background: var(--chat-card);
  border: 1px solid var(--chat-line);
  border-radius: 9px;
  transition: background .17s, border-color .17s;
}
.support-topics button::after { content: ''; flex: none; width: .41rem; height: .41rem; border: solid #7de3d2; border-width: 1.5px 1.5px 0 0; transform: rotate(45deg); margin-right: .2rem; }
.support-topics button:hover { background: #213e43; border-color: #71bdb4; }
.support-guide { border-top: 1px solid var(--chat-line); margin-top: .35rem; }
.support-guide summary { padding-inline: .08rem; color: #a4fbef; cursor: pointer; list-style: none; }
.support-guide summary::-webkit-details-marker { display: none; }
.support-guide summary::after { display: grid; place-items: center; content: '+'; font-size: 1.1rem; width: 1.4rem; }
.support-guide[open] summary::after { content: '−'; }
.support-guide p { margin: 0 0 .55rem; }
.support-request { display: inline-flex; align-items: center; min-height: 44px; color: #a4fbef; font-size: .83rem; text-underline-offset: .2em; }
.support-message {
  width: fit-content;
  max-width: 91%;
  margin: 0 0 .62rem;
  padding: .57rem .72rem;
  color: var(--chat-ink);
  background: var(--chat-card);
  border: 1px solid var(--chat-line);
  border-radius: 13px 13px 13px 3px;
  overflow-wrap: anywhere;
  font-size: .9rem;
  animation: support-message .23s ease-out both;
}
.support-message p { margin: 0; white-space: pre-wrap; }
.support-message[data-role="visitor"] { margin-left: auto; background: #19403e; border-color: #477d76; border-radius: 13px 13px 3px 13px; }
.support-message[data-role="system"] { max-width: 100%; margin-inline: auto; border: 0; background: none; color: var(--chat-muted); font-size: .8rem; text-align: center; }
.support-name { display: block; margin-bottom: .2rem; color: #a4fbef; font-size: .74rem; font-weight: 750; }
.support-status { margin: .15rem 1rem .55rem; font-size: .8rem; color: var(--chat-muted); }
.support-status:empty { display: none; }
.support-status.error { color: #ffd0dc; }
.support-links { display: flex; flex-wrap: wrap; gap: .55rem; padding: 0 1rem 1rem; }
.support-links > * { border: 1px solid #558580; border-radius: 7px; color: #a4fbef; background: #15363a; padding: .37rem .62rem; font-size: .82rem; font-weight: 650; text-decoration: none; }
.support-links > *:hover { background: #204a4d; }
.support-form { display: grid; align-items: end; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; padding: .7rem 1rem .9rem; border-top: 1px solid var(--chat-line); background: #14262d; }
.support-form textarea { min-height: 47px; max-height: 95px; resize: vertical; background: #172b33; color: var(--chat-ink); border: 1px solid #628087; border-radius: 9px; padding: .56rem .62rem; font-size: .92rem; }
.support-form textarea::placeholder { color: var(--chat-muted); }
.support-form small { grid-column: 1/-1; color: var(--chat-muted); font-size: .73rem; line-height: 1.3; }
.support-send { min-height: 44px; min-width: 4.8rem; padding: .45rem .65rem; border: 1px solid transparent; border-radius: 9px; background: var(--neon); color: var(--deep); font-size: .88rem; font-weight: 750; }
.support-send:hover { background: var(--neon-hover); }
.support-send:disabled { opacity: .6; cursor: wait; }
@keyframes support-in { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes support-message { from { opacity: .35; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@media (max-width: 450px) {
  .support-panel { max-height: min(560px, calc(100dvh - 82px)); }
  .support-launcher { min-height: 48px; }
  .support-form textarea { font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .support-panel, .support-message { animation: none; }
  .support-launcher, .support-topics button { transition: none; }
}
