:root {
  --pro-chat-ink: #10233c;
  --pro-chat-accent: #d69e12;
  --pro-chat-accent-strong: #b98508;
  --pro-chat-accent-soft: #f7e3a3;
  --pro-chat-surface: rgba(255, 255, 255, 0.96);
  --pro-chat-line: rgba(16, 35, 60, 0.12);
  --pro-chat-shadow: 0 28px 60px rgba(16, 35, 60, 0.22);
}

.pro-chat-launcher {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 999999;
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 999px;
  padding: 0;
  box-shadow: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 220ms ease, transform 220ms ease;
}

.pro-chat-launcher img {
  width: 64px;
  height: 64px;
  display: block;
  filter: drop-shadow(0 18px 30px rgba(16, 35, 60, 0.24));
}

.pro-chat-launcher.is-hidden {
  opacity: 0;
  transform: translateY(14px) scale(0.86);
  pointer-events: none;
}

.pro-chat-launcher:hover,
.pro-chat-launcher:focus,
.pro-chat-launcher:active {
  outline: none;
  background: transparent;
  box-shadow: none;
}

.pro-chat-launcher:focus-visible img {
  filter:
    drop-shadow(0 18px 30px rgba(16, 35, 60, 0.24))
    drop-shadow(0 0 0 rgba(255, 255, 255, 0.95));
}

.pro-chat-shell {
  position: fixed;
  right: 18px;
  bottom: 30px;
  z-index: 999998;
  width: min(390px, calc(100vw - 24px));
  max-height: min(72vh, 680px);
  border-radius: 24px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 251, 241, 0.98), rgba(255, 255, 255, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--pro-chat-shadow);
  color: var(--pro-chat-ink);
  backdrop-filter: blur(14px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(22px) scale(0.96);
  transform-origin: bottom right;
  transition:
    opacity 240ms ease,
    transform 240ms ease,
    visibility 0s linear 240ms;
}

.pro-chat-shell.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  transition:
    opacity 240ms ease,
    transform 240ms ease,
    visibility 0s linear 0s;
}

.pro-chat-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 520px;
  max-height: min(72vh, 680px);
}

.pro-chat-head {
  position: relative;
  padding: 18px 18px 14px;
  color: #fff;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.22), transparent 38%),
    linear-gradient(140deg, #8f6905, #d69e12);
}

.pro-chat-head h3 {
  margin: 0;
  padding-right: 48px;
  font-size: 22px;
  line-height: 1.15;
  color: #ffffff;
}

.pro-chat-head p {
  margin: 8px 0 0;
  padding-right: 48px;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.88);
}

.pro-chat-head p a {
  color: #ffffff;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.pro-chat-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  padding: 0;
  background: #ffffff;
  color: var(--pro-chat-accent-strong);
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(143, 105, 5, 0.16);
}

.pro-chat-shell .pro-chat-close:hover,
.pro-chat-shell .pro-chat-close:focus,
.pro-chat-shell .pro-chat-close:focus-visible {
  background: #ffffff !important;
  color: var(--pro-chat-accent-strong) !important;
  border-color: rgba(255, 255, 255, 0.92) !important;
  box-shadow: 0 10px 22px rgba(143, 105, 5, 0.16) !important;
  outline: none !important;
}

.pro-chat-log {
  overflow: auto;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(253, 247, 227, 0.9)),
    repeating-linear-gradient(
      135deg,
      rgba(214, 158, 18, 0.03) 0,
      rgba(214, 158, 18, 0.03) 14px,
      rgba(143, 105, 5, 0.05) 14px,
      rgba(143, 105, 5, 0.05) 28px
    );
}

.pro-chat-empty {
  padding: 18px;
  border: 1px dashed var(--pro-chat-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.64);
  font-size: 14px;
  line-height: 1.5;
}

.pro-chat-row {
  display: flex;
  margin-bottom: 12px;
}

.pro-chat-row--user {
  justify-content: flex-end;
}

.pro-chat-bubble {
  max-width: 84%;
  padding: 12px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.45;
  box-shadow: 0 10px 24px rgba(16, 35, 60, 0.08);
}

.pro-chat-row--support .pro-chat-bubble {
  background: rgba(255, 255, 255, 0.9);
  border-top-left-radius: 6px;
}

.pro-chat-row--user .pro-chat-bubble {
  color: #fff;
  background: linear-gradient(145deg, var(--pro-chat-accent), var(--pro-chat-accent-strong));
  border-top-right-radius: 6px;
}

.pro-chat-meta {
  margin-top: 6px;
  font-size: 11px;
  opacity: 0.72;
}

.pro-chat-error {
  margin: 0 16px 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(165, 31, 61, 0.1);
  color: #8f1636;
  font-size: 13px;
}

.pro-chat-composer {
  padding: 14px;
  border-top: 1px solid var(--pro-chat-line);
  background: rgba(255, 255, 255, 0.9);
}

.pro-chat-push {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(16, 35, 60, 0.74);
}

.pro-chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: stretch;
}

.pro-chat-input {
  margin: 0 !important;
  min-height: 56px;
  max-height: 128px;
  resize: none;
  border: 1px solid var(--pro-chat-line);
  border-radius: 16px;
  padding: 12px 14px;
  font: inherit;
  color: var(--pro-chat-ink);
  background: rgba(255, 255, 255, 0.92);
}

.pro-chat-input:focus {
  outline: 2px solid rgba(214, 158, 18, 0.28);
  border-color: rgba(214, 158, 18, 0.5);
}

.pro-chat-submit {
  align-self: stretch;
  width: 56px;
  min-width: 56px;
  height: auto;
  border: 1px solid rgba(214, 158, 18, 0.55);
  border-radius: 16px;
  background: #ffffff;
  color: var(--pro-chat-accent-strong);
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(185, 133, 8, 0.14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.pro-chat-submit[disabled] {
  cursor: wait;
  opacity: 0.72;
}

.pro-chat-submit svg {
  width: 22px;
  height: 22px;
  display: block;
}

body.tf_darkmode .pro-chat-shell {
  background:
    linear-gradient(180deg, rgba(25, 21, 13, 0.98), rgba(18, 18, 18, 0.98));
  border: 1px solid rgba(214, 158, 18, 0.18);
  color: #f4efe2;
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.45);
}

body.tf_darkmode .pro-chat-log {
  background:
    linear-gradient(180deg, rgba(32, 27, 19, 0.9), rgba(18, 18, 18, 0.94)),
    repeating-linear-gradient(
      135deg,
      rgba(214, 158, 18, 0.05) 0,
      rgba(214, 158, 18, 0.05) 14px,
      rgba(255, 255, 255, 0.02) 14px,
      rgba(255, 255, 255, 0.02) 28px
    );
}

body.tf_darkmode .pro-chat-empty,
body.tf_darkmode .pro-chat-row--support .pro-chat-bubble,
body.tf_darkmode .pro-chat-composer {
  background: rgba(31, 31, 31, 0.92);
  color: #f4efe2;
  border-color: rgba(214, 158, 18, 0.18);
}

body.tf_darkmode .pro-chat-meta,
body.tf_darkmode .pro-chat-push {
  color: rgba(244, 239, 226, 0.72);
}

body.tf_darkmode .pro-chat-input {
  background: rgba(20, 20, 20, 0.96);
  color: #f4efe2;
  border-color: rgba(214, 158, 18, 0.26);
}

body.tf_darkmode .pro-chat-input::placeholder {
  color: rgba(244, 239, 226, 0.48);
}

body.tf_darkmode .pro-chat-error {
  background: rgba(165, 31, 61, 0.16);
  color: #ffb7c8;
}

.pro-chat-shell .pro-chat-submit:hover,
.pro-chat-shell .pro-chat-submit:focus,
.pro-chat-shell .pro-chat-submit:focus-visible {
  background: linear-gradient(145deg, var(--pro-chat-accent), var(--pro-chat-accent-strong)) !important;
  color: #ffffff !important;
  border-color: rgba(214, 158, 18, 0.9) !important;
  outline: none !important;
}

@media (max-width: 640px) {
  .pro-chat-launcher {
    right: 14px;
    bottom: 14px;
    width: 58px;
    height: 58px;
  }

  .pro-chat-launcher img {
    width: 58px;
    height: 58px;
  }

  .pro-chat-shell {
    right: 12px;
    left: 12px;
    bottom: 30px;
    width: auto;
    max-height: calc(100vh - 52px);
  }

  .pro-chat-card {
    min-height: 60vh;
    max-height: calc(100vh - 52px);
  }

  .pro-chat-form {
    grid-template-columns: 1fr;
  }

  .pro-chat-submit {
    width: 100%;
  }
}
