/* Shared chat appearance is scoped here; page layouts and React theme stay independent. */
.jyl-support {
  --support-action: #275eff;
  --support-ink: #172b51;
  --support-muted: #606e86;
  --support-border: #dfe7f5;
  --support-background: #fff;
  --support-canvas: #f5f7fb;
  --support-visitor: #e7efff;
  --support-focus: #275eff;
  position: fixed;
  right: calc(28px + 100% - 100vw);
  bottom: 40px;
  z-index: 3100;
  color: var(--support-ink);
  font: 14px/1.7 "PingFang SC", "Microsoft YaHei", sans-serif;
  text-align: left;
}
.jyl-support, .jyl-support * { box-sizing: border-box; }
.jyl-support button, .jyl-support textarea { font: inherit; }
.jyl-support button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.jyl-support button:disabled { cursor: not-allowed; opacity: .55; }
.jyl-support svg { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.jyl-support button:focus-visible, .jyl-support textarea:focus-visible, .jyl-support a:focus-visible { outline: 3px solid var(--support-focus); outline-offset: 3px; }
.jyl-support[hidden], .jyl-support [hidden] { display: none !important; }
.jyl-support .jyl-support-launcher { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 23px; border: 1px solid transparent; border-radius: 28px; background: var(--support-action); color: #fff; text-decoration: none; font-size: 16px; font-weight: 600; box-shadow: 0 8px 28px #215cff30; }
.jyl-support .jyl-support-panel { position: absolute; right: 0; bottom: 68px; width: min(400px, calc(100vw - 32px)); height: min(620px, calc(100dvh - 150px)); min-height: 260px; display: flex; flex-direction: column; margin: 0; padding: 0; overflow: hidden; border: 1px solid var(--support-border); border-radius: 16px; background: var(--support-background); box-shadow: 0 16px 55px #102a6026; }
.jyl-support .jyl-support-heading { display: flex; align-items: center; gap: 12px; flex: none; padding: 17px 18px; background: linear-gradient(110deg, var(--support-action), #426dff); color: #fff; }
.jyl-support .jyl-support-heading h2 { margin: 0; flex: 1; font-size: 18px; line-height: 1.5; font-weight: 600; letter-spacing: 0; color: inherit; }
.jyl-support .jyl-support-avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #ffffff25; }
.jyl-support .jyl-support-close { display: grid; place-items: center; flex: none; width: 30px; height: 30px; margin: 0; padding: 0; border: 0; border-radius: 6px; color: #fff; background: transparent; }
.jyl-support .jyl-support-close:hover { background: #ffffff25; }
.jyl-support .jyl-support-close:focus-visible { outline-color: #fff; }
.jyl-support .jyl-support-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px; background: var(--support-canvas); }
.jyl-support .jyl-support-session { margin: 0 0 18px; text-align: center; color: var(--support-muted); font-size: 12px; }
.jyl-support .jyl-support-author { display: block; margin: 0 0 6px; color: var(--support-muted); font-size: 12px; }
.jyl-support .jyl-support-welcome p, .jyl-support .jyl-support-message p { margin: 0; padding: 12px 14px; border: 1px solid var(--support-border); border-radius: 10px; color: var(--support-ink); background: var(--support-background); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; }
.jyl-support .jyl-support-questions { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.jyl-support .jyl-support-questions :is(button, a) { padding: 6px 9px; border: 1px solid var(--support-border); border-radius: 6px; background: var(--support-background); color: var(--support-action); font-size: 12px; text-decoration: none; }
.jyl-support .jyl-support-questions :is(button, a):hover:not(:disabled) { border-color: var(--support-action); }
.jyl-support .jyl-support-message { margin: 0 0 16px; max-width: 92%; }
.jyl-support .jyl-support-message.is-visitor { margin-left: auto; }
.jyl-support .is-visitor .jyl-support-author { text-align: right; }
.jyl-support .is-visitor p { background: var(--support-visitor); }
.jyl-support .jyl-support-connection { display: flex; justify-content: space-between; align-items: center; flex: none; gap: 8px; padding: 7px 16px; border-top: 1px solid var(--support-border); font-size: 12px; color: var(--support-muted); }
.jyl-support .jyl-support-reconnect { flex: none; border: 0; padding: 2px; background: transparent; color: var(--support-action); }
.jyl-support .jyl-support-compose { flex: none; margin: 0; padding: 8px 16px 14px; }
.jyl-support .jyl-support-input-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.jyl-support .jyl-support-input { display: block; resize: none; width: 100%; height: 75px; min-height: 0; padding: 4px; border: 0; border-radius: 4px; background: var(--support-background); color: var(--support-ink); font-size: 14px; line-height: 1.7; }
.jyl-support .jyl-support-input::placeholder { color: var(--support-muted); }
.jyl-support #jyl-support-wecom { width: min(360px, calc(100vw - 32px)); }
.jyl-support #jyl-support-wecom .jyl-support-heading { padding: 10px 16px; }
.jyl-support #jyl-support-wecom .jyl-support-heading h2 { font-size: 15px; }
.jyl-support #jyl-support-wecom .jyl-support-body { --message-offset: 39px; padding: 19px 16px; scrollbar-width: thin; }
.jyl-support .jyl-support-wecom-welcome { display: flex; gap: 9px; align-items: flex-start; }
.jyl-support .jyl-support-wecom-avatar { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%; color: var(--support-focus); background: var(--support-visitor); }
.jyl-support .jyl-support-wecom-avatar svg { width: 18px; height: 18px; }
.jyl-support #jyl-support-wecom .jyl-support-questions { margin: 12px 0 8px var(--message-offset); }
.jyl-support .jyl-support-qr { width: 206px; max-width: calc(100% - var(--message-offset)); margin: 12px 0 4px var(--message-offset); padding: 10px; border: 1px solid var(--support-border); border-radius: 10px; background: var(--support-background); text-align: center; }
.jyl-support .jyl-support-qr h3 { margin: 0 0 2px; color: var(--support-ink); font-size: 14px; font-weight: 600; }
.jyl-support .jyl-support-qr p { margin: 0 0 6px; color: var(--support-muted); font-size: 12px; }
.jyl-support .jyl-support-qr img { display: block; width: 100%; height: auto; }
.jyl-support #jyl-support-wecom .jyl-support-compose { padding-top: 12px; border-top: 1px solid var(--support-border); }
.jyl-support #jyl-support-wecom .jyl-support-input { height: 64px; }
.jyl-support #jyl-support-wecom .jyl-support-compose-footer { justify-content: flex-end; }
.jyl-support .jyl-support-compose-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 8px; }
.jyl-support .jyl-support-count { color: var(--support-muted); font-size: 12px; }
.jyl-support .jyl-support-send { min-width: 70px; min-height: 34px; padding: 4px 18px; border: 1px solid transparent; border-radius: 6px; background: var(--support-action); color: #fff; font-weight: 600; }
html[data-scheme="dark"] .jyl-support {
  --support-action: #275eff;
  --support-ink: #edf3ff;
  --support-muted: #afbdd6;
  --support-border: #334568;
  --support-background: #15243e;
  --support-canvas: #101c31;
  --support-visitor: #233c68;
  --support-focus: #9db7ff;
}
html[data-scheme="dark"] .jyl-support .jyl-support-questions :is(button, a),
html[data-scheme="dark"] .jyl-support .jyl-support-reconnect { color: #a9c1ff; }
@media (max-width: 620px) {
  .jyl-support { right: calc(16px + 100% - 100vw); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
  .jyl-support .jyl-support-launcher { min-height: 48px; padding: 0 18px; }
  .jyl-support .jyl-support-panel { bottom: 60px; height: min(620px, calc(100dvh - 112px - env(safe-area-inset-bottom, 0px))); }
  .jyl-support .jyl-support-heading { padding: 14px; }
  .jyl-support .jyl-support-heading h2 { font-size: 17px; }
  .jyl-support .jyl-support-body { padding: 16px; }
}
