/* Live handoff overlay (alternativ B) – samma hörn som Aminos-bubblan */

body.ped-handoff-active iframe[src*="pedesign.se/w/"],
body.ped-handoff-active iframe[src*="aminos"],
body.ped-handoff-active [id*="simplebot"],
body.ped-handoff-active [class*="chat-widget"] {
  visibility: hidden !important;
  pointer-events: none !important;
}

.ped-handoff {
  position: fixed;
  z-index: 2147483000;
  right: 24px;
  bottom: 24px;
  width: min(380px, calc(100vw - 32px));
  font-family: var(--font-text, system-ui, sans-serif);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.ped-handoff--hidden {
  display: none;
}

.ped-handoff__panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(70vh, 520px);
  padding: 14px 16px 16px;
  border-radius: 22px;
  background: #fff;
  color: #0b1020;
  box-shadow: 0 24px 60px -20px rgba(11, 16, 32, 0.45);
  border: 1px solid rgba(24, 119, 171, 0.2);
}

.ped-handoff__head {
  font-weight: 700;
  color: #1877ab;
}

.ped-handoff__transcript {
  max-height: 120px;
  overflow: auto;
  padding: 10px;
  border-radius: 12px;
  background: #f4f6f8;
  font-size: 0.8125rem;
  white-space: pre-wrap;
}

.ped-handoff__messages {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 60px;
}

.ped-handoff__msg {
  margin: 0;
  padding: 8px 12px;
  border-radius: 14px;
}

.ped-handoff__msg--agent {
  background: #e8f4fb;
  align-self: flex-start;
}

.ped-handoff__msg--visitor {
  background: #eef2f8;
  align-self: flex-end;
}

.ped-handoff__status {
  margin: 0;
  font-size: 0.875rem;
  color: #5a6275;
}

.ped-handoff__form textarea {
  width: 100%;
  resize: vertical;
  border-radius: 12px;
  border: 1px solid #d5dbe6;
  padding: 8px 10px;
  font: inherit;
}

.ped-handoff__form button {
  margin-top: 8px;
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: #1877ab;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.ped-handoff--waiting .ped-handoff__panel {
  border-color: rgba(255, 210, 63, 0.65);
}

@media (max-width: 760px) {
  .ped-handoff {
    right: 16px;
    bottom: 16px;
    width: calc(100vw - 32px);
  }
}