/* Wevo klik-chat – lokalt udkast. Matcher wevo.dk. */

.wevo-chat {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
  font-family: var(--font-body);
  color: var(--ink);
  pointer-events: none;
}

.wevo-chat-panel,
.wevo-chat-launch {
  pointer-events: auto;
}

.wevo-chat-launch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 3.15rem;
  padding: 0.55rem 1.15rem 0.55rem 0.8rem;
  border: 1px solid rgba(247, 246, 251, 0.12);
  border-radius: 999px;
  background: var(--dark);
  color: var(--on-dark);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  box-shadow: 0 16px 36px rgba(22, 18, 33, 0.16);
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.wevo-chat-launch:hover,
.wevo-chat-launch:focus-visible {
  background: #2a2544;
}

.wevo-chat-launch:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.wevo-chat-launch-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  flex-shrink: 0;
}

.wevo-chat-launch-icon svg {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
}

.wevo-chat-launch-close {
  display: none;
}

.wevo-chat.is-open .wevo-chat-launch {
  width: 3.15rem;
  height: 3.15rem;
  min-height: 3.15rem;
  padding: 0;
}

.wevo-chat.is-open .wevo-chat-launch-label,
.wevo-chat.is-open .wevo-chat-launch-chat {
  display: none;
}

.wevo-chat.is-open .wevo-chat-launch-close {
  display: flex;
}

.wevo-chat-panel {
  display: flex;
  flex-direction: column;
  width: min(24.75rem, calc(100vw - 2.5rem));
  height: min(39rem, calc(100dvh - 7.5rem));
  max-height: calc(100dvh - 7.5rem);
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 16px 36px rgba(22, 18, 33, 0.12);
  overflow: hidden;
}

.wevo-chat-panel[hidden] {
  display: none;
}

.wevo-chat-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
  padding: 0.95rem 0.95rem 0.95rem 1.15rem;
  background: var(--dark);
  color: var(--on-dark);
}

.wevo-chat-header-text {
  flex: 1;
  min-width: 0;
}

.wevo-chat-eyebrow {
  margin: 0 0 0.1rem;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  color: #b8b0ff;
}

.wevo-chat-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.04em;
  line-height: 1.15;
  color: var(--on-dark);
}

.wevo-chat-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border: 1px solid rgba(247, 246, 251, 0.16);
  border-radius: 999px;
  background: transparent;
  color: var(--on-dark);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.wevo-chat-close svg {
  display: block;
  width: 1.05rem;
  height: 1.05rem;
}

.wevo-chat-close:hover,
.wevo-chat-close:focus-visible {
  background: rgba(247, 246, 251, 0.1);
  border-color: rgba(247, 246, 251, 0.4);
}

.wevo-chat-close:focus-visible {
  outline: 2px solid #b8b0ff;
  outline-offset: 2px;
}

.wevo-chat-log {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.15rem 1.05rem 0.85rem;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  -webkit-overflow-scrolling: touch;
}

.wevo-chat-row {
  display: flex;
  flex-direction: column;
  max-width: 92%;
}

.wevo-chat-row-wevo {
  align-self: flex-start;
  align-items: flex-start;
}

.wevo-chat-row-user {
  align-self: flex-end;
  align-items: flex-end;
}

.wevo-chat-sender {
  margin: 0 0 0.28rem 0.15rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.wevo-chat-row-user .wevo-chat-sender {
  margin-right: 0.15rem;
  margin-left: 0;
}

.wevo-chat-bubble {
  margin: 0;
  padding: 0.8rem 0.95rem;
  border-radius: 18px;
  font-size: 0.95rem;
  line-height: 1.55;
}

.wevo-chat-bubble p {
  margin: 0 0 0.65rem;
}

.wevo-chat-bubble p:last-child {
  margin-bottom: 0;
}

.wevo-chat-bubble-wevo {
  background: var(--cream);
  border: 1px solid var(--line);
  border-bottom-left-radius: 8px;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.wevo-chat-bubble-wevo p {
  color: var(--muted);
}

.wevo-chat-bubble-user {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 8px;
}

.wevo-chat-actions {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.85rem 1.05rem 1.05rem;
  background: var(--cream);
  border-top: 1px solid var(--line);
}

.wevo-chat-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.2rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.wevo-chat-chip:hover,
.wevo-chat-chip:focus-visible {
  background: var(--ink);
  color: var(--on-dark);
  border-color: var(--ink);
}

.wevo-chat-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.wevo-chat-chip-accent {
  background: var(--accent-soft);
  border-color: rgba(74, 43, 255, 0.28);
  color: var(--accent-dark);
}

.wevo-chat-chip-accent:hover,
.wevo-chat-chip-accent:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.wevo-chat-chip-quiet {
  background: transparent;
}

@media (max-width: 799px) {
  .wevo-chat {
    right: 1rem;
    bottom: max(1rem, env(safe-area-inset-bottom, 0px));
    left: 1rem;
  }

  .wevo-chat-panel {
    width: 100%;
    height: min(43rem, calc(100dvh - 6.2rem));
    max-height: calc(100dvh - 6.2rem);
  }

  .wevo-chat-launch {
    width: 3.1rem;
    height: 3.1rem;
    min-height: 3.1rem;
    padding: 0;
  }

  .wevo-chat-launch-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .wevo-chat-panel:not([hidden]) {
    animation: wevo-chat-panel-in 0.28s ease;
    transform-origin: bottom right;
  }

  .wevo-chat-row {
    animation: wevo-chat-row-in 0.28s ease;
  }

  .wevo-chat-launch {
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, width 0.25s ease, padding 0.25s ease;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wevo-chat-panel,
  .wevo-chat-row,
  .wevo-chat-launch,
  .wevo-chat-chip,
  .wevo-chat-close {
    animation: none;
    transition: none;
  }
}

@keyframes wevo-chat-panel-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes wevo-chat-row-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
