:root {
  --trust-blue: #0500ff;
  --trust-green: #48ff91;
  --trust-black: #252525;
  --base-white: #f4f4f7;
  --border-gray: #dbdce5;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: "Wix Madefor Display", Inter, system-ui, sans-serif;
  color: var(--trust-black);
  overflow-x: hidden;
  max-width: 100%;
}

img,
svg {
  max-width: 100%;
}

.container {
  width: 100% !important;
  max-width: min(80rem, 100%) !important;
}

.topic-card {
  box-shadow: 0 1px 4px rgba(17, 17, 24, 0.06);
}

.topic-card:hover {
  border-color: var(--trust-blue);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--trust-blue);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.topic-page {
  max-width: 760px;
  padding-bottom: 80px;
}

.topic-kicker {
  color: var(--trust-blue);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.topic-page h1 {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.25rem;
  color: var(--trust-black);
}

.topic-intro {
  font-size: 1.1rem;
  color: #4b5563;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.article-body h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
}

.article-body h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 1.4rem 0 0.5rem;
}

.article-body p,
.article-body li {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #333;
}

.article-body p { margin-bottom: 1rem; }
.article-body ol,
.article-body ul { margin: 0 0 1.1rem 1.2rem; }
.article-body li { margin-bottom: 0.45rem; }

.callout {
  background: #f4f4f7;
  border-left: 4px solid var(--trust-blue);
  padding: 14px 16px;
  border-radius: 12px;
  margin: 1.1rem 0;
  line-height: 1.6;
}

.callout.warn {
  border-left-color: #e11d48;
  background: #fff5f6;
}

.table-wrap {
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.article-body th,
.article-body td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #ececf2;
}

.article-body th { font-weight: 700; background: #f7f7fb; }

.related {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.related a,
.collection-item {
  color: var(--trust-blue);
  font-weight: 600;
  text-decoration: none;
}

.related a:hover,
.collection-item:hover { text-decoration: underline; }

.collection-heading {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 2rem 0 0.25rem;
}

.collection-list {
  display: flex;
  flex-direction: column;
}

.collection-item {
  display: block;
  padding: 16px 0;
  border-bottom: 1px solid #ececf2;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Wix Madefor Display", Inter, sans-serif;
}

.search-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border-gray);
  border-radius: 20px;
  box-shadow: 0 18px 50px rgba(5, 0, 255, 0.08), 0 4px 16px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  z-index: 120;
  max-height: 360px;
  overflow-y: auto;
}

.search-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 14px 20px;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease;
}

.search-item:hover,
.search-item.active {
  background: #f6f6fb;
}

.search-item + .search-item {
  border-top: 1px solid #f0f0f4;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 24, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.captcha-card {
  width: 280px;
  max-width: calc(100vw - 32px);
  background: #fff;
  border-radius: 20px;
  padding: 20px 18px 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
  animation: pop-in 0.22s ease;
}

.captcha-card #captchaTitle {
  font-size: 1.05rem !important;
}

.captcha-grid {
  display: grid;
  grid-template-columns: repeat(3, 56px);
  justify-content: center;
  gap: 8px;
  margin: 14px 0 16px;
}

.captcha-cell {
  width: 56px;
  height: 56px;
  border: 1px solid #e6e6ee;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.captcha-cell:hover {
  border-color: #c9c9d6;
}

.captcha-cell.selected {
  border-color: var(--trust-blue);
  box-shadow: 0 0 0 2px rgba(5, 0, 255, 0.25);
  background: #f4f3ff;
}

.shape-square {
  width: 22px;
  height: 22px;
  background: #c8c8d0;
  border-radius: 3px;
}

.shape-circle {
  width: 22px;
  height: 22px;
  background: #c8c8d0;
  border-radius: 50%;
}

.shape-triangle {
  width: 0;
  height: 0;
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-bottom: 22px solid #c8c8d0;
}

.captcha-card.shake {
  animation: shake 0.4s ease;
}

.chat-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 0;
  background: var(--trust-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06), 0 8px 28px rgba(5, 0, 255, 0.28);
  transition: transform 0.2s ease;
}

.chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  box-shadow: 0 0 0 2px #fff;
}

.reply-toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 92px;
  z-index: 95;
  max-width: 400px;
  margin: 0 auto;
  background: #111827;
  color: #fff;
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.reply-toast strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.reply-toast span {
  display: block;
  font-size: 13px;
  line-height: 1.4;
  color: #e5e7eb;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-launcher:hover {
  transform: scale(1.08);
}

.messenger {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 10010;
  width: min(400px, calc(100vw - 24px));
  height: min(704px, calc(100vh - 40px));
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform-origin: bottom right;
  animation: messenger-in 0.25s cubic-bezier(0, 1, 1, 1);
}

.msg-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 12px;
}

.bubble {
  max-width: 88%;
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.bubble-bot {
  background: #f3f4f6;
  color: #1f2937;
}

.bubble-user {
  background: var(--trust-blue);
  color: #fff;
  margin-left: auto;
}

.composer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 16px 16px;
  padding: 8px 10px 8px 14px;
  border: 1.5px solid var(--trust-blue);
  border-radius: 16px;
  background: #fff;
}

.composer input {
  flex: 1;
  border: 0;
  outline: none;
  font-size: 14px;
  background: transparent;
  min-width: 0;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: #6b7280;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
}

.icon-btn:hover {
  background: #f3f4f6;
}

.send-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #d1d5db;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

.send-btn.ready {
  background: var(--trust-blue);
  cursor: pointer;
}

.tab-btn.active {
  color: var(--trust-blue);
}

.article-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: -4px 0 12px;
}

.article-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #0500ff;
  text-decoration: none;
  font-weight: 600;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.article-link:hover {
  text-decoration: underline;
}

.typing {
  display: inline-flex;
  gap: 4px;
}

.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9ca3af;
  animation: typing 1s infinite ease-in-out;
}

.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

@keyframes pop-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@keyframes messenger-in {
  0% { opacity: 0; transform: scale(0.92); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

@media (max-width: 767px) {
  .container {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  #support-header {
    margin-bottom: 8px !important;
  }

  #support-header .h-20 {
    height: 56px;
  }

  #support-header img {
    height: 32px;
  }

  .topic-page {
    max-width: 100%;
    padding-bottom: 40px;
  }

  .topic-page h1 {
    font-size: 1.45rem;
  }

  .topic-card {
    padding: 16px !important;
  }

  .topic-card img {
    height: 88px !important;
    margin-bottom: 12px !important;
  }

  footer {
    padding: 20px 16px !important;
    margin-top: 24px !important;
    border-radius: 20px !important;
  }

  footer .grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 20px !important;
  }

  footer a {
    word-break: break-word;
  }

  .chat-launcher {
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .reply-toast {
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  }

  .messenger {
    inset: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    height: 100svh !important;
    border-radius: 0 !important;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .composer {
    margin: 0 12px calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .composer input {
    font-size: 16px;
  }

  .composer .icon-btn[aria-label="Attach"],
  .composer .icon-btn[aria-label="Emoji"] {
    display: none;
  }

  .captcha-card {
    width: 280px;
    max-width: calc(100vw - 24px);
    padding: 18px 16px 14px;
  }

  .overlay {
    padding: 16px;
    align-items: center;
  }

  #faqSearch {
    font-size: 16px;
  }
}

@media (max-width: 479px) {
  footer .grid {
    grid-template-columns: 1fr !important;
  }
}
