.owa-service {
  --owa-ink: #171716;
  --owa-whatsapp: #25d366;
  display: contents;
}

.owa-sheet[hidden] {
  display: none !important;
}

.owa-sheet__panel:focus {
  outline: none;
}

@media (max-width: 767.98px) {
  .owa-sheet:not([hidden]) {
    align-items: flex-end;
    display: flex;
    inset: 0;
    justify-content: center;
    pointer-events: none;
    position: fixed;
    z-index: 2147482500;
  }

  .owa-sheet__backdrop {
    -webkit-tap-highlight-color: transparent;
    appearance: none;
    background: rgba(22, 20, 18, .2);
    border: 0;
    inset: 0;
    opacity: 0;
    padding: 0;
    pointer-events: auto;
    position: absolute;
    transition: opacity .24s ease;
  }

  .owa-sheet__panel {
    --owa-drag-y: 0px;
    background: #f8f5ef;
    border: 1px solid rgba(39, 34, 29, .1);
    border-bottom: 0;
    border-radius: 30px 30px 0 0;
    box-shadow: 0 -24px 70px rgba(0, 0, 0, .25);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    max-height: 76vh;
    max-height: 76dvh;
    overflow: hidden;
    padding: 0 18px max(24px, env(safe-area-inset-bottom, 0px));
    pointer-events: auto;
    position: relative;
    transform: translate3d(0, calc(100% + 24px), 0);
    transition: transform .35s cubic-bezier(.16, .84, .24, 1);
    width: min(100%, 420px);
    will-change: transform;
  }

  .owa-sheet[data-state="opening"] .owa-sheet__backdrop,
  .owa-sheet[data-state="open"] .owa-sheet__backdrop { opacity: 1; }

  .owa-sheet[data-state="opening"] .owa-sheet__panel,
  .owa-sheet[data-state="open"] .owa-sheet__panel {
    transform: translate3d(0, var(--owa-drag-y), 0);
  }

  .owa-sheet[data-state="dragging"] .owa-sheet__panel {
    transform: translate3d(0, var(--owa-drag-y), 0);
    transition: none;
  }

  .owa-sheet[data-state="closing"] .owa-sheet__backdrop { opacity: 0; }
  .owa-sheet[data-state="closing"] .owa-sheet__panel { transform: translate3d(0, calc(100% + 24px), 0); }
}

.owa-sheet__drag {
  cursor: grab;
  display: flex;
  flex: 0 0 21px;
  justify-content: center;
  padding-top: 10px;
  touch-action: none;
}

.owa-sheet__handle {
  background: #cbc7bd;
  border-radius: 999px;
  height: 4px;
  width: 38px;
}

.owa-sheet__close {
  appearance: none;
  background: #fff;
  border: 1px solid #e2ddd6;
  border-radius: 50%;
  box-shadow: 0 4px 13px rgba(42, 36, 30, .09);
  height: 44px;
  min-height: 44px;
  min-width: 44px;
  position: absolute;
  right: 18px;
  top: 28px;
  width: 44px;
  z-index: 2;
}

.owa-sheet__close span::before,
.owa-sheet__close span::after {
  background: #403d39;
  content: "";
  height: 1.7px;
  left: 50%;
  position: absolute;
  top: 50%;
  width: 16px;
}

.owa-sheet__close span::before { transform: translate(-50%, -50%) rotate(45deg); }
.owa-sheet__close span::after { transform: translate(-50%, -50%) rotate(-45deg); }

.owa-sheet__list {
  -webkit-overflow-scrolling: touch;
  display: grid;
  flex: 1 1 auto;
  gap: 9px;
  min-height: 0;
  overscroll-behavior: contain;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 52px 1px 7px;
  scroll-padding-bottom: 12px;
  touch-action: pan-y;
}

.owa-card {
  align-items: center;
  background: rgba(255, 255, 255, .94);
  border: 1px solid #e4e0d7;
  border-radius: 18px;
  box-shadow: 0 6px 18px rgba(48, 40, 32, .06);
  color: var(--owa-ink);
  display: grid;
  gap: 13px;
  grid-template-columns: 54px minmax(0, 1fr) 38px;
  min-height: 78px;
  padding: 10px 11px;
  text-decoration: none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.owa-card:hover,
.owa-card:focus,
.owa-card:visited {
  color: var(--owa-ink);
  text-decoration: none;
}

.owa-card:active {
  border-color: rgba(37, 211, 102, .42);
  box-shadow: 0 3px 10px rgba(48, 40, 32, .06);
  transform: translate3d(0, 1px, 0) scale(.988);
}

.owa-card:focus-visible,
.owa-sheet__close:focus-visible {
  outline: 3px solid var(--owa-whatsapp);
  outline-offset: 2px;
}

.owa-card__avatar {
  align-items: center;
  background: linear-gradient(145deg, #f5efe9, #fffaf5);
  border: 1px solid #e2dcd4;
  border-radius: 50%;
  display: flex;
  height: 54px;
  justify-content: center;
  position: relative;
  width: 54px;
}

.owa-card__avatar img {
  border-radius: inherit;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.owa-card__avatar b {
  font-family: Georgia, serif;
  font-size: 20px;
  font-weight: 500;
}

.owa-card__avatar i {
  background: var(--owa-whatsapp);
  border: 2px solid #fff;
  border-radius: 50%;
  bottom: 0;
  box-shadow: 0 1px 3px rgba(31, 27, 23, .18);
  height: 10px;
  position: absolute;
  right: 0;
  width: 10px;
}

.owa-card--away .owa-card__avatar i { background: #ffb000; }
.owa-card--offline .owa-card__avatar i { background: #a6a19b; }
.owa-card--offline { opacity: .72; }

.owa-card__content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.owa-card__content strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 580;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.owa-card__content > span,
.owa-card__content small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.owa-card__content > span {
  color: #66615b;
  font-size: 11px;
  line-height: 1.45;
  margin-top: 3px;
}

.owa-card__content small {
  color: #938c84;
  font-size: 9px;
  letter-spacing: .045em;
  margin-top: 2px;
  text-transform: uppercase;
}

.owa-card__whatsapp {
  align-items: center;
  background: #dcf7df;
  border-radius: 50%;
  color: #20b34e;
  display: flex;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.owa-card__whatsapp svg {
  fill: currentColor;
  height: 22px;
  width: 22px;
}

.owa-sheet__empty {
  background: rgba(255, 255, 255, .72);
  border: 1px dashed #ddd6cd;
  border-radius: 16px;
  color: #746d65;
  font-size: 12px;
  margin: 4px 0 18px;
  padding: 22px 14px;
  text-align: center;
}

@media (min-width: 768px) {
  .owa-sheet:not([hidden]) {
    display: block;
    inset: 0;
    pointer-events: none;
    position: fixed;
    z-index: 2147482500;
  }

  .owa-sheet__backdrop {
    appearance: none;
    background: rgba(22, 20, 18, .1);
    border: 0;
    inset: 0;
    opacity: 0;
    padding: 0;
    pointer-events: auto;
    position: absolute;
    transition: opacity .22s ease;
  }

  .owa-sheet__panel {
    --owa-desktop-bottom: 28px;
    --owa-desktop-right: 24px;
    background: #f8f5ef;
    border: 1px solid rgba(39, 34, 29, .1);
    border-radius: 25px;
    bottom: calc(var(--owa-desktop-bottom) + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 22px 60px rgba(31, 24, 14, .22);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    max-height: min(470px, calc(100vh - 40px));
    opacity: 0;
    overflow: hidden;
    padding: 51px 14px 14px;
    pointer-events: auto;
    position: fixed;
    right: calc(var(--owa-desktop-right) + env(safe-area-inset-right, 0px));
    transform: translate3d(22px, 0, 0) scale(.97);
    transform-origin: right bottom;
    transition: opacity .22s ease, transform .27s cubic-bezier(.16, .84, .24, 1);
    width: min(365px, calc(100vw - 32px));
    will-change: opacity, transform;
  }

  .owa-sheet[data-state="opening"] .owa-sheet__backdrop,
  .owa-sheet[data-state="open"] .owa-sheet__backdrop { opacity: 1; }

  .owa-sheet[data-state="opening"] .owa-sheet__panel,
  .owa-sheet[data-state="open"] .owa-sheet__panel {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }

  .owa-sheet[data-state="closing"] .owa-sheet__backdrop { opacity: 0; }
  .owa-sheet__drag { display: none; }
  .owa-sheet__close { cursor: pointer; right: 12px; top: 10px; }
  .owa-sheet__list { gap: 8px; padding: 0; }
  .owa-card:hover {
    border-color: rgba(37, 211, 102, .34);
    box-shadow: 0 9px 24px rgba(48, 40, 32, .09);
    transform: translateY(-1px);
  }
  .owa-sheet__empty { margin: 0; }
}

@media (max-height: 620px) and (max-width: 767.98px) {
  .owa-sheet__panel {
    max-height: 90vh;
    max-height: 90dvh;
  }
}

@media print {
  .owa-service,
  .owa-sheet { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .owa-sheet *,
  .owa-sheet *::before,
  .owa-sheet *::after {
    animation: none !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
