.jcw-floating-ui {
  position: fixed;
  right: 16px;
  bottom: 20px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  pointer-events: none;
}

.jcw-back-to-top,
.jcw-clippy-tab,
.jcw-clippy-panel {
  pointer-events: auto;
}

.jcw-back-to-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #0f172a;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
  padding: 10px 14px;
  font-size: 0.875rem;
  font-weight: 700;
  opacity: 0;
  transform: translateY(12px);
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease, background 0.2s ease;
}

.jcw-back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.jcw-back-to-top:hover,
.jcw-back-to-top:focus-visible {
  background: #eff6ff;
  outline: none;
}

.jcw-clippy-shell {
  position: relative;
}

.jcw-clippy-tab {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-right: 0;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(180deg, #0f172a 0%, #312e81 100%);
  color: #fff;
  padding: 14px 10px;
  min-height: 128px;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
}

.jcw-clippy-tab:hover,
.jcw-clippy-tab:focus-visible {
  filter: brightness(1.06);
  outline: none;
}

.jcw-clippy-panel {
  position: absolute;
  right: calc(100% + 10px);
  bottom: 0;
  width: min(320px, calc(100vw - 84px));
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.22);
  overflow: hidden;
}

.jcw-clippy-panel__inner {
  padding: 18px;
}

.jcw-clippy-panel__eyebrow {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #4f46e5;
}

.jcw-clippy-panel__title {
  margin: 0 0 8px;
  font-size: 1.1rem;
  line-height: 1.2;
  font-weight: 800;
  color: #0f172a;
}

.jcw-clippy-panel__body {
  margin: 0 0 14px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #475569;
}

.jcw-clippy-panel__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 999px;
  background: #f8fafc;
  color: #0f172a;
  padding: 8px 14px;
  font-size: 0.875rem;
  font-weight: 700;
}

.jcw-clippy-panel__close:hover,
.jcw-clippy-panel__close:focus-visible {
  background: #eef2ff;
  outline: none;
}

@media (max-width: 640px) {
  .jcw-floating-ui {
    right: 12px;
    bottom: 14px;
    gap: 10px;
  }

  .jcw-back-to-top {
    padding: 10px 12px;
  }

  .jcw-clippy-tab {
    min-height: 112px;
    padding: 12px 8px;
    font-size: 0.78rem;
  }

  .jcw-clippy-panel {
    width: min(280px, calc(100vw - 72px));
  }
}
