.support-widget {
  position: fixed;
  z-index: 110;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  color: #20251c;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.support-launch {
  display: grid;
  width: 58px;
  height: 58px;
  margin-left: auto;
  place-items: center;
  border: 1px solid #53653a;
  border-radius: 50%;
  background: #71834e;
  color: #fff;
  box-shadow: 0 5px 20px rgba(25, 30, 20, .22);
  cursor: pointer;
}

.support-launch:hover, .support-launch:focus-visible { background: #53653a; }
.support-launch svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.support-launch svg path:last-child { fill: currentColor; stroke: none; }

.support-panel {
  position: absolute;
  right: 0;
  bottom: 72px;
  display: grid;
  grid-template-rows: auto minmax(120px, 1fr) auto auto auto;
  width: min(370px, calc(100vw - 32px));
  height: min(540px, calc(100dvh - 112px));
  min-height: 360px;
  overflow: hidden;
  border: 1px solid #d2d4cb;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 48px rgba(25, 30, 20, .2);
}

.support-panel[hidden] { display: none; }
.support-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid #e5e6e0; background: #fafaf7; }
.support-panel-head > div:first-child { display: grid; gap: 3px; }
.support-panel-head strong { font-size: 14px; }
.support-panel-head span { color: #64685f; font-size: 11px; }
.support-panel-actions { display: flex; gap: 5px; }
.support-panel-actions button, .support-form button { display: grid; width: 34px; height: 34px; padding: 0; place-items: center; border: 1px solid transparent; border-radius: 5px; background: transparent; color: #444940; cursor: pointer; }
.support-panel-actions button:hover, .support-panel-actions button:focus-visible { border-color: #d4d6cd; background: #fff; }
.support-panel-actions svg, .support-form svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.support-messages { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; padding: 16px; }
.support-message { max-width: 92%; padding: 10px 12px; border: 1px solid #e4e5df; border-radius: 8px; background: #f7f7f3; color: #282c25; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.support-message--user { align-self: flex-end; border-color: #d9dfcc; background: #eef1e8; }
.support-answer-link { display: inline-block; margin-top: 5px; color: #465833; font-size: 12px; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.support-topics { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 10px; }
.support-topics button { min-height: 30px; padding: 0 10px; border: 1px solid #d2d4cb; border-radius: 16px; background: #fff; color: #41463d; font-size: 11px; cursor: pointer; }
.support-topics button:hover, .support-topics button:focus-visible { border-color: #71834e; }
.support-form { display: flex; gap: 7px; padding: 10px 12px; border-top: 1px solid #e5e6e0; }
.support-form input { width: 100%; min-width: 0; height: 40px; padding: 0 11px; border: 1px solid #cfd1c8; border-radius: 5px; background: #fff; color: #20251c; font: inherit; font-size: 13px; }
.support-form input:focus-visible { outline: 2px solid #71834e; outline-offset: 1px; }
.support-form button { flex: 0 0 40px; width: 40px; height: 40px; background: #71834e; color: #fff; }
.support-form button:hover, .support-form button:focus-visible { background: #53653a; }
.support-form button:disabled { cursor: wait; opacity: .55; }
.support-panel-foot { padding: 0 14px 12px; color: #64685f; font-size: 10px; line-height: 1.5; }
.support-panel-foot a { color: #465833; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 480px) {
  .support-widget { right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); }
  .support-launch { width: 54px; height: 54px; }
  .support-panel { bottom: 64px; width: calc(100vw - 24px); height: min(560px, calc(100dvh - 94px)); min-height: 300px; }
}

@media (prefers-reduced-motion: no-preference) {
  .support-panel:not([hidden]) { animation: support-enter .16s ease-out; }
  @keyframes support-enter { from { opacity: .7; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
}
