.ht-support {
  --ht-support-bg: #fff;
  --ht-support-card: #f8faf9;
  --ht-support-text: #24332f;
  --ht-support-muted: #7b8783;
  --ht-support-line: #e6ebe8;
  --ht-support-accent: #28765b;
  --ht-support-soft: #eaf3ed;
  --ht-support-track: #f0f3f1;
  --ht-support-shadow: 0 18px 70px #182c2526, 0 2px 10px #182c2508;
  position: relative;
  z-index: 45;
  color: var(--ht-support-text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
}

.dark .ht-support {
  --ht-support-bg: #232726;
  --ht-support-card: #2a2f2d;
  --ht-support-text: #edf2ee;
  --ht-support-muted: #a0ada6;
  --ht-support-line: #3a423e;
  --ht-support-accent: #9acbb1;
  --ht-support-soft: #33463b;
  --ht-support-track: #1b201e;
  --ht-support-shadow: 0 18px 70px #0005, 0 2px 10px #0002;
  color-scheme: dark;
}

.ht-support *, .ht-support *::before, .ht-support *::after { box-sizing: border-box; }
.ht-support[data-open="true"] { z-index: 60; }
.ht-support [hidden] { display: none !important; }
.ht-support :is(h2, h3, p) { margin: 0; font-size: inherit; line-height: inherit; }
.ht-support :is(button, a) { font: inherit; color: inherit; letter-spacing: 0; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.ht-support button { cursor: pointer; }
.ht-support svg { display: block; width: 20px; height: 20px; flex: 0 0 auto; }
.ht-support :is(button, a, [tabindex]):focus-visible { outline: 2px solid var(--ht-support-accent); outline-offset: 3px; }

.ht-support-launcher {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;
  width: 46px;
  padding: 17px 0 13px;
  border: 1px solid var(--ht-support-line);
  border-left: 0;
  border-radius: 0 16px 16px 0;
  background: var(--ht-support-bg);
  box-shadow: 0 4px 24px #203b2412;
  transition: background 180ms, box-shadow 180ms;
}
.ht-support-launcher > span { writing-mode: vertical-rl; letter-spacing: 3px; font-size: 13px; font-weight: 600; }
.ht-support-launcher > svg:first-child { color: var(--ht-support-accent); width: 21px; height: 21px; }
.ht-support-launcher > svg:last-child { width: 13px; height: 13px; color: var(--ht-support-muted); transition: transform 240ms; }
/* The host's global button:active scale must not replace our vertical positioning. */
.ht-support .ht-support-launcher:active { transform: translateY(-50%); }
.ht-support-launcher:hover, .ht-support[data-open="true"] .ht-support-launcher { background: var(--ht-support-soft); box-shadow: 0 4px 24px #203b2420; }
.ht-support[data-open="true"] .ht-support-launcher > svg:last-child { transform: rotate(180deg); }

.ht-support-panel {
  position: fixed;
  left: 62px;
  top: 50%;
  display: flex;
  flex-direction: column;
  width: 342px;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow: hidden;
  border: 1px solid var(--ht-support-line);
  border-radius: 22px;
  background: var(--ht-support-bg);
  box-shadow: var(--ht-support-shadow);
  opacity: 0;
  visibility: hidden;
  transform: translate(-14px, -50%);
  transition: opacity 220ms, transform 260ms cubic-bezier(.2,.7,.2,1), visibility 220ms;
}
.ht-support[data-open="true"] .ht-support-panel { opacity: 1; visibility: visible; transform: translate(0, -50%); }
.ht-support-header { flex: 0 0 auto; position: relative; padding: 22px 20px 16px; }
.ht-support-brand { display: flex; align-items: center; gap: 11px; padding-right: 24px; }
.ht-support-avatar { display: block; width: 43px; height: 43px; object-fit: cover; border-radius: 14px; border: 1px solid var(--ht-support-line); }
.ht-support .ht-support-eyebrow { color: var(--ht-support-muted); font-size: 10px; letter-spacing: .8px; margin-bottom: 4px; }
.ht-support-header h2 { color: var(--ht-support-text); font-size: 18px; font-weight: 650; letter-spacing: -.3px; }
.ht-support .ht-support-intro { margin-top: 14px; color: var(--ht-support-muted); font-size: 12px; letter-spacing: .7px; }
.ht-support-close { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ht-support-muted) !important; }
.ht-support-header > .ht-support-close { position: absolute; right: 13px; top: 17px; }
.ht-support-close span { display: none; }
.ht-support-close svg { width: 17px; height: 17px; }
.ht-support-close:hover { background: var(--ht-support-track); }

.ht-support-tabs { position: relative; flex: 0 0 auto; display: grid; grid-template-columns: 1fr 1fr; margin: 0 20px 16px; padding: 4px; border-radius: 12px; background: var(--ht-support-track); }
.ht-support-tab-indicator { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 9px; background: var(--ht-support-bg); box-shadow: 0 2px 6px #0000000d; transition: transform 240ms cubic-bezier(.2,.7,.2,1); }
.ht-support[data-channel="qq"] .ht-support-tab-indicator { transform: translateX(100%); }
.ht-support-tab { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 6px 10px; background: none; border: 0; border-radius: 9px; font-weight: 600 !important; color: var(--ht-support-muted) !important; transition: color 180ms; }
.ht-support-tab[aria-selected="true"] { color: var(--ht-support-accent) !important; }
.ht-support-tab svg { width: 19px; height: 19px; }
.ht-support-content { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--ht-support-line) transparent; padding: 0 20px 2px; }
.ht-support-card { border: 1px solid var(--ht-support-line); border-radius: 15px; padding: 14px 15px 11px; background: var(--ht-support-card); }
.ht-support-card + .ht-support-card { margin-top: 12px; }
.ht-support-card-meta { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 9px; }
.ht-support-section-label { color: var(--ht-support-muted); font-size: 10px; letter-spacing: .7px; }
.ht-support-tag { padding: 2px 7px; border-radius: 5px; background: var(--ht-support-soft); color: var(--ht-support-accent); font-size: 9px; }
.ht-support-card h3 { color: var(--ht-support-text); font-size: 15px; font-weight: 600; }
.ht-support .ht-support-card-description { margin-top: 2px; color: var(--ht-support-muted); font-size: 11px; }
.ht-support-qr-button { position: relative; display: block; width: 184px; height: 184px; max-width: 100%; margin: 12px auto 8px; padding: 0; border: 1px solid #e9edea; border-radius: 10px; overflow: hidden; background: white; cursor: zoom-in !important; }
.ht-support-qr { display: block; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.ht-support .ht-support-scan-tip { color: var(--ht-support-muted); font-size: 10px; text-align: center; }
.ht-support .ht-support-expiry { margin-top: 3px; color: var(--ht-support-muted); font-size: 10px; text-align: center; }
.ht-support-action { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 30px; padding: 4px 8px; border: 1px solid var(--ht-support-line); border-radius: 7px; background: var(--ht-support-bg); font-size: 10px !important; white-space: nowrap; cursor: pointer; }
.ht-support-action:hover { color: var(--ht-support-accent); border-color: var(--ht-support-accent); }
.ht-support-action svg { width: 12px; height: 12px; }
.ht-support-account { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--ht-support-line); font-size: 12px; font-variant-numeric: tabular-nums; }
.ht-support-account > span { user-select: text; }
.ht-support-account button { border: 0; padding: 2px 6px; background: transparent; color: var(--ht-support-accent); }
.ht-support-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 174px; margin-top: 12px; border: 1px dashed var(--ht-support-line); border-radius: 10px; color: var(--ht-support-muted); }
.ht-support-empty > svg { width: 30px; height: 30px; opacity: .65; margin-bottom: 2px; }
.ht-support-empty strong { font-size: 14px; font-weight: 500; letter-spacing: 2px; }
.ht-support-empty p { font-size: 10px; }
.ht-support .ht-support-footer { flex: 0 0 auto; padding: 12px 16px; text-align: center; color: var(--ht-support-muted); font-size: 10px; }
.ht-support-status:empty { display: none; }
.ht-support .ht-support-status { flex: 0 0 auto; padding: 0 16px 12px; color: var(--ht-support-accent); font-size: 12px; text-align: center; }
.ht-support-copy-input { position: fixed; left: -9999px; top: 0; }
.ht-support .ht-support-asset-error { padding: 20px 0; color: var(--ht-support-muted); font-size: 12px; }

.ht-support-lightbox { position: fixed; inset: 0; width: min(420px, calc(100vw - 32px)); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); margin: auto; padding: 20px; overflow-y: auto; border: 1px solid var(--ht-support-line); border-radius: 20px; background: var(--ht-support-bg); color: var(--ht-support-text); box-shadow: var(--ht-support-shadow); }
.ht-support-lightbox::backdrop { background: #101916a6; backdrop-filter: blur(4px); }
.ht-support-lightbox-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.ht-support-lightbox h3 { font-size: 17px; font-weight: 600; }
.ht-support-large-qr { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 12px; background: white; }
.ht-support-lightbox > .ht-support-scan-tip { margin: 14px 0 12px; font-size: 12px; }
.ht-support-lightbox-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.ht-support-lightbox-actions > .ht-support-action { flex: 1 1 130px; min-height: 40px; font-size: 12px !important; }

@media (max-width: 600px) {
  .ht-support-launcher { width: 38px; gap: 11px; padding: 13px 0 11px; border-radius: 0 13px 13px 0; }
  .ht-support-launcher > span { font-size: 12px; letter-spacing: 2px; }
  .ht-support-panel { left: 48px; width: min(342px, calc(100vw - 60px)); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); border-radius: 18px; }
  .ht-support-header { padding: 18px 14px 14px; }
  .ht-support-header h2 { font-size: 16px; }
  .ht-support-avatar { width: 36px; height: 36px; border-radius: 11px; }
  .ht-support-brand { gap: 8px; }
  .ht-support-tabs { margin: 0 14px 12px; }
  .ht-support-content { padding: 0 14px 2px; }
  .ht-support-card { padding: 12px 12px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .ht-support *, .ht-support *::before, .ht-support *::after { transition: none !important; animation: none !important; }
}
