.floating-chat-toggle {
  position: fixed;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 80;
  display: inline-flex;
  min-height: 58px;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  color: #080808;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: #fbb004;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38), 0 8px 24px rgba(251, 176, 4, 0.2);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.floating-chat-toggle:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.44), 0 10px 28px rgba(251, 176, 4, 0.28);
}

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

.floating-chat-backdrop {
  position: fixed;
  inset: 0;
  z-index: 88;
  background: rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(3px);
  animation: floating-chat-fade 180ms ease both;
}

.floating-chat-panel {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 90;
  display: grid;
  width: min(460px, calc(100vw - 36px));
  height: min(820px, calc(100svh - 36px));
  max-height: min(820px, calc(100svh - 36px));
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  color: #fff;
  border: 1px solid rgba(251, 176, 4, 0.35);
  border-radius: 28px;
  background:
    radial-gradient(circle at 90% 0, rgba(251, 176, 4, 0.14), transparent 16rem),
    #0b0b0b;
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.62);
  animation: floating-chat-in 240ms cubic-bezier(0.2, 0.82, 0.2, 1) both;
}

.floating-chat-header {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.floating-chat-brand {
  display: flex;
  min-width: 0;
  gap: 12px;
  align-items: center;
}

.floating-chat-brand img {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  object-fit: contain;
}

.floating-chat-brand span,
.floating-chat-brand strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.floating-chat-brand span {
  margin-bottom: 2px;
  color: #fbb004;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.floating-chat-brand strong {
  font-size: 0.98rem;
}

.floating-chat-close {
  display: grid;
  width: 39px;
  height: 39px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0 0 3px;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 1.7rem;
  font-weight: 300;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}

.floating-chat-tabs {
  display: flex;
  gap: 8px;
  padding: 10px 18px;
  overflow-x: auto;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  scrollbar-width: none;
}

.floating-chat-tabs::-webkit-scrollbar {
  display: none;
}

.floating-chat-tabs button {
  min-height: 35px;
  flex: 0 0 auto;
  padding: 0 14px;
  color: rgba(255, 255, 255, 0.56);
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
}

.floating-chat-tabs button.is-active {
  color: #080808;
  border-color: #fbb004;
  background: #fbb004;
}

body.floating-chat-open {
  overflow: hidden;
}

.floating-chat-body {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(251, 176, 4, 0.5) transparent;
}

.floating-chat-intro {
  padding: 22px 22px 17px;
}

.floating-chat-intro h2 {
  margin: 8px 0 9px;
  color: #fff;
  font-size: clamp(1.45rem, 5vw, 2rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.floating-chat-intro p {
  margin: 0;
  color: rgba(255, 255, 255, 0.57);
  font-size: 0.79rem;
  line-height: 1.6;
}

.floating-chat-gate {
  margin: 4px 18px 22px;
  padding: 28px 22px;
  text-align: center;
  border: 1px solid rgba(251, 176, 4, 0.22);
  border-radius: 21px;
  background: linear-gradient(145deg, rgba(251, 176, 4, 0.09), rgba(255, 255, 255, 0.025));
}

.floating-chat-gate-icon {
  display: grid;
  width: 55px;
  height: 55px;
  margin: 0 auto 14px;
  place-items: center;
  color: #080808;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  border-radius: 18px;
  background: #fbb004;
}

.floating-chat-gate h3 {
  margin: 0 0 8px;
  font-size: 1.12rem;
}

.floating-chat-gate p {
  margin: 0 auto 18px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.78rem;
  line-height: 1.55;
}

.floating-chat-gate button {
  min-height: 44px;
  padding: 0 20px;
  color: #080808;
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  border: 0;
  border-radius: 999px;
  background: #fbb004;
}

.floating-report-workspace {
  display: block;
  width: auto;
  margin: 0;
  padding: 0 18px 22px;
}

.floating-chat-panel .floating-report-form {
  padding: 22px;
  border-radius: 22px;
  box-shadow: none;
}

.floating-chat-panel .report-form-heading {
  display: block;
  margin-bottom: 22px;
}

.floating-chat-panel .report-form-heading h2 {
  margin-top: 7px;
  font-size: 1.45rem;
}

.floating-chat-panel .report-user {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-top: 12px;
  padding: 7px 11px;
  font-size: 0.66rem;
}

.floating-chat-panel .report-type-options label > span {
  min-height: 79px;
  padding: 14px;
  border-radius: 16px;
}

.floating-chat-panel .report-type-options strong {
  font-size: 0.86rem;
}

.floating-chat-panel .report-type-options small {
  font-size: 0.69rem;
}

.floating-chat-panel .report-message-field textarea {
  min-height: 125px;
  padding: 15px;
  border-radius: 16px;
  font-size: 0.84rem;
}

.floating-chat-panel .report-upload-card {
  margin-top: 20px;
  padding: 15px;
  border-radius: 17px;
}

.floating-chat-panel .report-upload-heading strong {
  font-size: 0.79rem;
}

.floating-chat-panel .report-upload-heading small {
  font-size: 0.69rem;
}

.floating-chat-panel .report-dropzone {
  min-height: 112px;
  margin-top: 12px;
  padding: 16px;
  border-radius: 14px;
}

.floating-chat-panel .report-dropzone-icon {
  width: 34px;
  height: 34px;
  margin-bottom: 7px;
  font-size: 1.35rem;
}

.floating-chat-panel .report-dropzone strong {
  font-size: 0.76rem;
}

.floating-chat-panel .report-anonymous-option {
  margin-top: 18px;
  padding: 14px;
  border-radius: 15px;
}

.floating-chat-panel .report-form-footer {
  align-items: stretch;
  flex-direction: column;
  margin-top: 20px;
}

.floating-chat-panel .report-submit {
  width: 100%;
  padding: 14px 20px;
}

.floating-report-success {
  width: auto;
  margin: 0 18px 22px;
  padding: 34px 22px;
  border-radius: 22px;
}

.floating-report-success > img {
  width: 62px;
  height: 62px;
}

.floating-report-success h2 {
  font-size: 1.65rem;
}

@keyframes floating-chat-in {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes floating-chat-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 620px) {
  .floating-chat-toggle {
    right: max(14px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
    min-height: 52px;
    padding: 0 18px;
  }

  .floating-chat-panel {
    inset: 0;
    width: 100%;
    height: 100svh;
    max-height: 100svh;
    border: 0;
    border-radius: 0;
  }

  .floating-chat-header {
    padding-top: max(14px, env(safe-area-inset-top));
  }

  .floating-chat-body {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .floating-chat-intro {
    padding-inline: 18px;
  }

  .floating-chat-panel .report-type-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .floating-chat-panel,
  .floating-chat-backdrop {
    animation: none;
  }
}
