.chat-widget {
  position: fixed;
  right: 24px;
  bottom: 8px;
  z-index: 230;
  font-family: var(--sans, Inter, sans-serif);
}

.back-to-top {
  position: fixed;
  right: 88px;
  bottom: 15px;
  z-index: 225;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border2, rgba(240, 235, 224, .18));
  border-radius: 50%;
  background: var(--bg, #0D1B2A);
  color: var(--orange, #D96A1F);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 14px 35px rgba(0, 0, 0, .18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(.96);
  transition: opacity .2s ease, transform .2s ease, border-color .2s ease, color .2s ease, background .2s ease;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.back-to-top:hover {
  border-color: var(--orange, #D96A1F);
  background: var(--orange, #D96A1F);
  color: #fff;
  transform: translateY(-2px) scale(1);
}

.back-to-top svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-open .back-to-top {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(.96);
}

.chat-toggle {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .18);
  background: var(--orange, #D96A1F);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 18px 45px rgba(0, 0, 0, .22), 0 6px 18px rgba(217, 106, 31, .26);
  transition: transform .18s, background .2s;
}

.chat-toggle:hover {
  transform: translateY(-2px);
  background: var(--orange-d, #B85A17);
}

.chat-toggle svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-toggle-dot {
  position: absolute;
  right: 8px;
  top: 7px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #6FCF97;
  border: 2px solid #fff;
  box-shadow: 0 0 0 0 rgba(111, 207, 151, .75);
  animation: chatPulse 2s infinite;
}

@keyframes chatPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(111, 207, 151, .7); }
  50% { box-shadow: 0 0 0 8px rgba(111, 207, 151, 0); }
}

.chat-panel {
  position: absolute;
  right: 0;
  bottom: 74px;
  width: min(340px, calc(100vw - 32px));
  background: var(--bg, #0D1B2A);
  border: 1px solid var(--border2, rgba(240, 235, 224, .13));
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(.98);
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}

.chat-widget.open .chat-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.chat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  background: var(--navy, #0D1B2A);
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.chat-kicker {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--orange, #D96A1F);
  margin-bottom: 5px;
}

.chat-head strong {
  display: block;
  font-family: var(--serif, Georgia, serif);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.15;
  color: #F0EBE0;
}

.chat-close {
  border: 0;
  background: transparent;
  color: rgba(240, 235, 224, .7);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.chat-close:hover { color: #fff; }

.chat-body {
  padding: 16px;
  background: var(--bg, #0D1B2A);
}

.chat-message {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text2, rgba(240, 235, 224, .7));
  margin-bottom: 14px;
}

.chat-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.chat-options button {
  border: 1px solid var(--border2, rgba(240, 235, 224, .13));
  background: var(--bg2, #112233);
  color: var(--text, #F0EBE0);
  border-radius: 8px;
  padding: 10px 11px;
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  font-family: var(--sans, Inter, sans-serif);
  transition: border-color .2s, color .2s, background .2s;
}

.chat-options button:hover {
  border-color: var(--orange, #D96A1F);
  color: var(--orange, #D96A1F);
  background: var(--card-h, rgba(217, 106, 31, .07));
}

.chat-direct {
  display: block;
  margin-top: 12px;
  background: var(--orange, #D96A1F);
  color: #fff;
  text-align: center;
  text-decoration: none;
  border-radius: 8px;
  padding: 11px 12px;
  font-size: 13px;
  font-weight: 600;
  transition: background .2s, transform .15s;
}

.chat-direct:hover {
  background: var(--orange-d, #B85A17);
  transform: translateY(-1px);
}

[data-theme="light"] .chat-panel {
  background: var(--bg, #F6F0E4);
  box-shadow: 0 24px 70px rgba(26, 37, 53, .18);
}

[data-theme="light"] .chat-head { background: var(--navy, #0D1B2A); }

@media (max-width: 600px) {
  .back-to-top {
    right: 16px;
    bottom: 84px;
    width: 42px;
    height: 42px;
  }

  .chat-widget {
    right: 16px;
    bottom: 16px;
  }

  .chat-toggle {
    width: 54px;
    height: 54px;
  }

  .chat-panel {
    right: -4px;
    bottom: 68px;
  }

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

@media (prefers-reduced-motion: reduce) {
  .chat-toggle,
  .chat-panel,
  .chat-direct,
  .back-to-top {
    transition: none;
  }

  .chat-toggle-dot { animation: none; }
}
