/* Shared Målgruppe assistent partial */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.audience-assistant {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1200;
  font-family: var(--font-main, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
  color: #17243a;
}

.audience-launcher {
  position: relative;
  min-height: 58px;
  padding: 11px 18px 11px 12px;
  border: 1px solid var(--brand, #3f6df6);
  border-radius: 999px;
  background: var(--brand, #3f6df6);
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  box-shadow: 0 10px 22px rgba(63, 109, 246, 0.18);
  cursor: pointer;
  isolation: isolate;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.audience-launcher:hover {
  transform: translateY(-2px);
  background: var(--brand-dark, #2f5ce6);
  border-color: var(--brand-dark, #2f5ce6);
  box-shadow: 0 14px 34px rgba(63, 109, 246, 0.22);
}

.audience-launcher-glow {
  position: absolute;
  inset: -8px;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 50%, rgba(63, 109, 246, 0.22), transparent 62%);
  z-index: -1;
  opacity: 0;
}

.audience-assistant.is-attention .audience-launcher-glow {
  animation: audiencePulse 1.8s ease-in-out 4;
}

@keyframes audiencePulse {
  0%, 100% { opacity: 0; transform: scale(.96); }
  45% { opacity: 1; transform: scale(1.08); }
}

.audience-launcher-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.17);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.audience-launcher-icon svg {
  width: 27px;
  height: 27px;
  display: block;
}

.audience-launcher-text {
  font-size: 14px;
  font-weight: 750;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.audience-nudge {
  position: absolute;
  right: 0;
  bottom: 74px;
  width: 248px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid #dfe6f0;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 50px rgba(25, 44, 74, 0.16);
  opacity: 0;
  transform: translateY(8px) scale(.98);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.audience-nudge.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.audience-nudge strong,
.audience-nudge span {
  display: block;
}

.audience-nudge strong {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #17243a;
}

.audience-nudge span {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.35;
  color: #60718d;
}

.audience-panel {
  position: absolute;
  right: 0;
  bottom: 76px;
  width: min(398px, calc(100vw - 32px));
  height: clamp(390px, 56vh, 500px);
  max-height: calc(100vh - 170px);
  border-radius: 26px;
  border: 1px solid #dfe6f0;
  background: #fff;
  box-shadow: 0 32px 90px rgba(25, 44, 74, 0.22);
  overflow: hidden;
  opacity: 0;
  transform: translateY(14px) scale(.97);
  pointer-events: none;
  transition: opacity 190ms ease, transform 190ms ease;
  display: flex;
  flex-direction: column;
}

.audience-assistant.is-open .audience-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.audience-panel-header {
  min-height: 74px;
  padding: 17px 18px 15px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #e8eef6;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
  flex: 0 0 auto;
}

.audience-panel-header h3 {
  margin: 0;
  font-size: 21px;
  line-height: 1.05;
  letter-spacing: -0.045em;
  color: #17243a;
}

.audience-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #dfe6f0;
  background: #fff;
  color: #17243a;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}

.audience-chat {
  flex: 1 1 auto;
  min-height: 0;
  padding: 16px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  background: #fff;
}

.audience-message {
  max-width: 84%;
  border-radius: 18px;
  padding: 11px 13px;
  font-size: 14px;
  line-height: 1.42;
  letter-spacing: -0.01em;
  animation: audienceMessageIn 160ms ease both;
}

@keyframes audienceMessageIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.audience-message p {
  margin: 0;
}

.audience-message.bot {
  align-self: flex-start;
  background: #f3f7ff;
  color: #334765;
  border-bottom-left-radius: 7px;
}

.audience-message.user {
  align-self: flex-end;
  background: linear-gradient(180deg, #3f6df6 0%, #2f5ce6 100%);
  color: #fff;
  border-bottom-right-radius: 7px;
}

.audience-message.system {
  align-self: center;
  max-width: 92%;
  background: #f8fbff;
  border: 1px solid #e0e8f3;
  color: #334765;
}

.audience-message.typing {
  width: 58px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.audience-message.typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8aa0ba;
  animation: audienceTyping 900ms ease-in-out infinite;
}

.audience-message.typing i:nth-child(2) { animation-delay: 120ms; }
.audience-message.typing i:nth-child(3) { animation-delay: 240ms; }

@keyframes audienceTyping {
  0%, 100% { opacity: .35; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-2px); }
}

.audience-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
  align-self: flex-start;
}

.audience-action {
  border: 1px solid #dfe6f0;
  background: #fff;
  color: #334765;
  border-radius: 999px;
  padding: 9px 11px;
  font-size: 12.5px;
  font-weight: 750;
  cursor: pointer;
}

.audience-action.primary {
  border-color: var(--brand, #3f6df6);
  color: #fff;
  background: var(--brand, #3f6df6);
  box-shadow: 0 10px 22px rgba(63, 109, 246, 0.18);
}

.audience-input {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px 14px 14px;
  border-top: 1px solid #e8eef6;
  background: #fff;
  align-items: end;
}

.audience-input textarea {
  width: 100%;
  min-height: 44px;
  max-height: 112px;
  resize: none;
  border: 1px solid #dfe6f0;
  border-radius: 16px;
  padding: 13px 14px;
  font: inherit;
  font-size: 14px;
  line-height: 1.35;
  color: #17243a;
  outline: none;
  background: #fbfdff;
}

.audience-input textarea:focus,
.audience-lead-form input:focus {
  border-color: rgba(63, 109, 246, 0.55);
  box-shadow: 0 0 0 4px rgba(63, 109, 246, 0.11);
}

.audience-send,
.audience-confirm {
  border: 1px solid var(--brand, #3f6df6);
  border-radius: 14px;
  background: var(--brand, #3f6df6);
  color: #fff;
  min-height: 44px;
  padding: 0 15px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 16px 30px rgba(63, 109, 246, 0.18);
}

.audience-lead-form {
  flex: 1 1 auto;
  min-height: 0;
  padding: 14px;
  border-top: 1px solid #e8eef6;
  background: #fff;
  overflow: auto;
}

.audience-lead-form[hidden],
.audience-chat[hidden],
.audience-input[hidden] {
  display: none !important;
}

.audience-assistant.is-collecting-details .audience-panel {
  height: clamp(430px, 58vh, 520px);
  max-height: calc(100vh - 170px);
}

.audience-lead-copy {
  padding: 12px;
  border-radius: 16px;
  background: #f3f7ff;
  border: 1px solid #dfe6f0;
  margin-bottom: 10px;
}

.audience-lead-copy strong,
.audience-lead-copy span {
  display: block;
}

.audience-lead-copy strong {
  color: #17243a;
  font-size: 14px;
  line-height: 1.25;
}

.audience-lead-copy span {
  margin-top: 4px;
  color: #60718d;
  font-size: 12.5px;
  line-height: 1.35;
}

.audience-lead-form label {
  display: block;
  margin-top: 8px;
}

.audience-lead-form label span {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 750;
  color: #60718d;
}

.audience-lead-form input {
  width: 100%;
  height: 40px;
  border: 1px solid #dfe6f0;
  border-radius: 14px;
  padding: 0 13px;
  font: inherit;
  background: #fbfdff;
  outline: none;
}

.audience-confirm {
  width: 100%;
  margin-top: 10px;
}

.audience-lead-form p {
  margin: 9px 2px 0;
  color: #7a8aa2;
  font-size: 11px;
  line-height: 1.4;
}

@media (max-width: 640px) {
  .audience-assistant {
    right: 14px;
    bottom: 14px;
  }

  .audience-launcher-text {
    display: none;
  }

  .audience-launcher {
    width: 60px;
    height: 60px;
    min-height: 60px;
    padding: 0;
    justify-content: center;
  }

  .audience-panel {
    right: -2px;
    width: calc(100vw - 24px);
    height: min(500px, calc(100vh - 140px));
    bottom: 74px;
    border-radius: 22px;
  }

  .audience-nudge {
    right: 0;
    width: 226px;
  }

  .audience-input {
    grid-template-columns: 1fr;
  }

  .audience-send {
    width: 100%;
  }
}

:is(
  .audience-launcher,
  .audience-action,
  .audience-send,
  .audience-confirm
) {
  font-size: clamp(13.5px, 0.92vw, 14.5px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.012em;
}

