/* Shared by the website and both registration pages. */
.contact-dock {
  --dock-inset: 24px;
  position: fixed;
  right: var(--dock-inset);
  bottom: 112px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: #252a32;
  color-scheme: light;
  font-family: inherit;
  transition: transform 180ms ease;
}

.contact-dock--collapsed { transform: translateX(calc(100% + var(--dock-inset))); }
.contact-dock--collapsed .contact-dock__button { visibility: hidden; transition: visibility 0s 180ms; }
.contact-dock__toggle {
  position: absolute;
  top: -36px;
  right: 0;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #e7e9ed;
  border-radius: 50%;
  background: #fff;
  color: #7b8390;
  box-shadow: 0 3px 10px rgb(31 41 55 / 8%);
  cursor: pointer;
}
.contact-dock__toggle:hover { color: #3685e8; border-color: #3685e8; }
.contact-dock__toggle svg { width: 18px; height: 18px; }
.contact-dock--collapsed .contact-dock__toggle {
  top: calc(50% - 22px);
  right: 100%;
  width: 24px;
  height: 44px;
  border-radius: 12px 0 0 12px;
}
.contact-dock--collapsed .contact-dock__toggle svg { transform: rotate(180deg); }

.contact-dock__button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 72px;
  height: 78px;
  padding: 10px;
  border: 1px solid #e7e9ed;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 5px 14px rgb(31 41 55 / 9%);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: box-shadow 160ms ease, border-color 160ms ease;
}

.contact-dock__button--wechat { color: #13b85a; }
.contact-dock__button--online { color: #3685e8; }
.contact-dock__button--online span { color: #303743; }
.contact-dock__button svg { display: block; width: 32px; height: 32px; }
.contact-dock__button:hover,
.contact-dock__button[aria-expanded='true'] {
  border-color: currentColor;
  box-shadow: 0 7px 20px rgb(31 41 55 / 13%);
}
.contact-dock button:focus-visible {
  outline: 2px solid #3685e8;
  outline-offset: 3px;
}

.contact-dock__wechat {
  position: absolute;
  right: calc(100% + 18px);
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 28px;
  width: 424px;
  max-width: calc(100vw - 132px);
  box-sizing: border-box;
  padding: 32px 26px 18px;
  border: 1px solid #e7e9ed;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 14px 40px rgb(31 41 55 / 14%);
}
.contact-dock__wechat[hidden] { display: none; }
.contact-dock__code { min-width: 0; margin: 0; text-align: center; }
.contact-dock__code img { display: block; width: 100%; height: auto; background: #fff; }
.contact-dock__code figcaption { margin-top: 14px; color: #252a32; font-size: 16px; font-weight: 600; line-height: 1.5; }
.contact-dock__hint { grid-column: 1 / -1; margin: 0; color: #7b8390; font-size: 12px; line-height: 1.5; text-align: center; }
.contact-dock__close {
  position: absolute;
  top: 5px;
  right: 7px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #7b8390;
  background: transparent;
  font: inherit;
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
}
.contact-dock__close:hover { color: #252a32; background: #f3f4f6; }

@media (max-width: 860px) {
  .contact-dock { --dock-inset: 12px; bottom: calc(24px + env(safe-area-inset-bottom)); gap: 8px; }
  .contact-dock--chat-open { visibility: hidden; }
  .contact-dock__button { width: 56px; height: 62px; border-radius: 13px; font-size: 13px; }
  .contact-dock__button svg { width: 27px; height: 27px; }
  .contact-dock__wechat {
    right: 0;
    bottom: calc(100% + 48px);
    width: min(380px, calc(100vw - 24px));
    max-width: none;
    gap: 12px 16px;
    padding: 28px 18px 16px;
    border-radius: 18px;
    max-height: calc(100dvh - 226px);
    overflow-y: auto;
  }
  .contact-dock__code figcaption { margin-top: 10px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .contact-dock, .contact-dock__button, .contact-dock--collapsed .contact-dock__button { transition: none; }
}

.support-panel {
  position: fixed; right: 114px; bottom: 54px; z-index: 121;
  width: min(380px, calc(100vw - 28px)); height: min(560px, calc(100vh - 120px));
  display: none; grid-template-rows: auto minmax(0,1fr) auto auto auto; color: #252a32; color-scheme: light;
  background: #fff; border: 1px solid #e7e9ed; border-radius: 20px;
  box-shadow: 0 28px 64px rgba(11,11,12,.18); overflow: hidden;
}
.support-panel.open { display: grid; }
.support-panel__header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 16px 14px; border-bottom: 1px solid #edf0f3;
  background: linear-gradient(180deg, #FBFBFF 0%, #fff 100%);
}
.support-panel__agent { display: flex; align-items: center; gap: 11px; }
.support-panel__avatar {
  position: relative; width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, #3685e8, #506ef0); color: #fff; display: grid; place-items: center; font-size: 16px; font-weight: 800;
}
.support-panel__online {
  position: absolute; right: -2px; bottom: -2px; width: 10px; height: 10px; border-radius: 50%;
  background: #22C55E; border: 2px solid #fff;
}
.support-panel__header h2 { margin: 0; font-size: 15px; font-weight: 800; }
.support-panel__header p { margin: 3px 0 0; font-size: 11.5px; color: #7b8390; }
.support-panel__close {
  width: 32px; height: 32px; border-radius: 10px; border: 1px solid #e7e9ed;
  background: #f8fafc; color: #535d6d; cursor: pointer; font-size: 14px;
}
.support-panel__close:hover { border-color: #b5d5fb; color: #256ac4; }
.support-panel__messages {
  display: flex; flex-direction: column; gap: 12px; min-height: 0;
  padding: 16px; overflow-y: auto; background: #f8fafc;
}
.support-panel__welcome {
  flex: 0 0 auto; min-width: 0;
}
.support-panel__greeting { margin: 0 0 12px; color: #687384; font-size: 12px; line-height: 1.6; }
.support-offer {
  padding: 16px; border: 1px solid #dce7fb; border-radius: 14px;
  background: linear-gradient(145deg, #eef4ff, #fff 70%);
}
.support-offer p { margin: 0; }
.support-offer__tags {
  display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 12px; margin-bottom: 12px;
  border-bottom: 1px dashed #cbdcf5;
}
.support-offer__tags span {
  padding: 4px 8px; border-radius: 6px; background: #e2ecff; color: #315b9f;
  font-size: 11px; font-weight: 600; line-height: 1.5;
}
.support-offer__intro { color: #39465a; font-size: 12px; line-height: 1.6; }
.support-offer__credits { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; color: #2867cc; line-height: 1.3; }
.support-offer__credits strong { font-size: 40px; font-weight: 800; letter-spacing: -1.5px; }
.support-offer__credits span { font-size: 14px; font-weight: 600; }
.support-offer__validity { color: #687384; font-size: 11px; line-height: 1.6; }
.support-offer__gift { margin-top: 12px; padding-top: 12px; border-top: 1px solid #e5ebf3; color: #687384; font-size: 12px; line-height: 1.8; }
.support-offer__gift strong { color: #39465a; font-weight: 700; }
.support-offer__wechat {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 40px; margin-top: 12px; padding: 9px 12px;
  border: 1px solid transparent; border-radius: 9px; background: #2867cc; color: #fff;
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.support-offer__wechat:hover { background: #2057af; }
.support-panel__state { display: flex; align-items: center; gap: 8px; color: #7b8390; font-size: 13px; padding: 18px 4px; }
.support-panel__loader {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid #b5d5fb; border-top-color: #3685e8;
  animation: supportSpin .8s linear infinite;
}
@keyframes supportSpin { to { transform: rotate(360deg); } }
.support-message { display: flex; flex-direction: column; max-width: 86%; }
.support-message--visitor { align-self: flex-end; align-items: flex-end; }
.support-message--agent, .support-message--system { align-self: flex-start; align-items: flex-start; }
.support-message__sender { font-size: 11px; color: #7b8390; margin-bottom: 4px; }
.support-message p {
  margin: 0; padding: 10px 12px; border-radius: 14px; font-size: 13.5px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
}
.support-message--visitor p { background: #3685e8; color: #fff; border-bottom-right-radius: 6px; }
.support-message--agent p, .support-message--system p { background: #fff; border: 1px solid #edf0f3; color: #252a32; border-bottom-left-radius: 6px; }
.support-message a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.support-message time { margin-top: 4px; font-size: 10.5px; color: #7b8390; }
.support-panel__session { margin: 4px 0 0; font-size: 11.5px; color: #7b8390; text-align: center; }
.support-panel__error { margin: 0; padding: 8px 16px 0; font-size: 12.5px; color: #B42318; }
.support-panel__composer {
  display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end;
  padding: 12px 14px 8px; border-top: 1px solid #edf0f3; background: #fff;
}
.support-panel__composer textarea {
  width: 100%; min-height: 44px; max-height: 110px; resize: none;
  border: 1px solid #e7e9ed; border-radius: 12px; padding: 10px 12px;
  font: inherit; font-size: 13.5px; outline: none; background: #f8fafc;
}
.support-panel__composer textarea:focus { border-color: #b5d5fb; background: #fff; }
.support-panel__composer button {
  width: 44px; height: 44px; border-radius: 12px; border: none; cursor: pointer;
  background: linear-gradient(135deg, #3685e8, #506ef0); color: #fff; font-size: 16px; font-weight: 700;
}
.support-panel__composer button:disabled { opacity: .45; cursor: not-allowed; }
.support-panel__hint { margin: 0; padding: 0 16px 12px; font-size: 11px; color: #7b8390; background: #fff; }
@media (max-width: 860px) {
  .support-panel { right: 10px; left: 10px; bottom: calc(24px + env(safe-area-inset-bottom)); width: auto; height: min(560px, calc(100dvh - 48px)); }
}

@media (max-width: 860px) and (max-height: 700px) {
  .support-panel__messages { padding: 12px; }
  .support-panel__greeting { margin-bottom: 8px; font-size: 11px; }
  .support-offer { padding: 12px; }
  .support-offer__tags { padding-bottom: 8px; margin-bottom: 8px; }
  .support-offer__credits strong { font-size: 34px; }
  .support-offer__gift { margin-top: 8px; padding-top: 8px; line-height: 1.6; }
  .support-offer__wechat { margin-top: 10px; }
}


.support-panel *, .contact-dock * { box-sizing: border-box; }
.support-panel button:focus-visible { outline: 2px solid #3685e8; outline-offset: 2px; }
.support-panel__error[hidden] { display: none; }
.support-panel__header h2 { color: #252a32; }
.support-panel__composer textarea { color: #252a32; }
@media (prefers-reduced-motion: reduce) { .support-panel__loader { animation: none; } }
