.ra-ayuna-ask {
  --ra-ask-red: #e10600;
  --ra-ask-ink: #1a1a1a;
  width: 100%;
  padding-top: 10px;
  box-sizing: border-box;
}

.ra-ayuna-ask__form {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin: 0;
  padding: 4px;
  background: var(--ra-field-bg, transparent);
  border: var(--ra-field-bw, 1px) solid var(--ra-field-bc, rgba(26, 26, 26, 0.12));
  border-radius: var(--ra-field-r, 999px);
  box-sizing: border-box;
}

.ra-ayuna-ask__mic,
.ra-ayuna-ask__go {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0 !important;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 0;
  box-sizing: border-box;
}

.ra-ayuna-ask__mic {
  border: 1px solid rgba(26, 26, 26, 0.16);
  background: #fff;
  color: var(--ra-ask-ink);
}

.ra-ayuna-ask__mic:hover,
.ra-ayuna-ask__mic:focus-visible {
  color: var(--ra-ask-ink) !important;
  background: #fff;
}

.ra-ayuna-ask__mic.is-recording {
  background: var(--ra-ask-red);
  border-color: var(--ra-ask-red);
  color: #fff;
}

.ra-ayuna-ask__mic.is-recording:hover,
.ra-ayuna-ask__mic.is-recording:focus-visible {
  color: #fff !important;
  background: var(--ra-ask-red);
}

.ra-ayuna-ask__go {
  border: 0;
  background: var(--ra-ask-red);
  color: #fff;
}

.ra-ayuna-ask__go:hover,
.ra-ayuna-ask__go:focus-visible {
  color: #fff !important;
  background: #c10500;
}

.ra-ayuna-ask__mic svg,
.ra-ayuna-ask__go svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: currentColor;
}

.ra-ayuna-ask__input {
  flex: 1 1 auto;
  width: auto !important;
  min-width: 0;
  height: 36px !important;
  min-height: 0 !important;
  max-height: 36px;
  margin: 0 !important;
  padding: 0 4px !important;
  border: 0;
  background: transparent;
  color: var(--ra-ask-ink);
  font-size: 13px;
  line-height: 36px !important;
  outline: none;
  box-shadow: none;
  align-self: center;
}

.ra-ayuna-ask__input::placeholder {
  color: rgba(26, 26, 26, 0.45);
}

.ra-ayuna-ask__note {
  margin: 6px 8px 0;
  font-size: 12px;
  line-height: 1.3;
  color: var(--ra-ask-red);
}

.ra-ayuna-ask__dialog {
  width: min(440px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

/* Closed dialog must stay out of the hit layer. Mobile rules below set
   display:flex for the open state; without this they keep covering the strip. */
.ra-ayuna-ask__dialog:not([open]) {
  display: none !important;
  pointer-events: none;
}

.ra-ayuna-ask__dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.ra-ayuna-ask__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 30;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0 !important;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #111 !important;
  box-shadow: 0 0 0 2px #111;
  font-size: 24px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.ra-ayuna-ask__dialog .cmw-widget__header {
  padding-right: 56px;
  background: #e10600;
  color: #fff;
}

.ra-ayuna-ask__dialog .cmw-widget__header .cmw-widget__title,
.ra-ayuna-ask__dialog .cmw-widget__header .cmw-widget__visit {
  color: #fff;
  opacity: 1;
}

.ra-ayuna-ask__mount .cmw-widget__card {
  height: min(72vh, 640px);
}

.ra-ayuna-ask__mount .cmw-widget__input {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ra-ayuna-ask__mount .cmw-widget__input textarea {
  flex: 1 1 auto;
  width: 1% !important;
  min-width: 0;
  height: 42px !important;
  min-height: 42px !important;
  max-height: 42px !important;
  margin: 0 !important;
  padding: 8px 12px !important;
  line-height: 24px !important;
  align-self: center;
  resize: none;
}

.ra-ayuna-ask__mount .cmw-widget__media-btn,
.ra-ayuna-ask__mount .cmw-widget__send {
  align-self: center;
  margin: 0 !important;
}

@media (max-width: 780px) {
  .ra-ayuna-ask__dialog[open] {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
    overflow: hidden;
    pointer-events: auto;
  }

  .ra-ayuna-ask__mount {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    flex: 1 1 auto;
  }

  .ra-ayuna-ask__mount .cmw-widget-host,
  .ra-ayuna-ask__mount .cmw-widget {
    width: 100%;
    max-width: none;
    min-width: 0;
    flex: 1 1 auto;
    height: 100%;
  }

  .ra-ayuna-ask__mount .cmw-widget__card {
    width: 100%;
    max-width: none;
    min-width: 0;
    height: 100%;
    max-height: none;
    border-radius: 0;
  }

  .ra-ayuna-ask__close {
    top: max(10px, env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
  }
}

@media (min-width: 781px) {
  .ra-ayuna-ask__dialog[open] {
    inset: auto;
    left: var(--ra-dialog-left, 0px);
    top: 50%;
    right: auto;
    bottom: auto;
    margin: 0;
    transform: translateY(-50%);
    width: 528px;
    max-width: 528px;
    height: auto;
    max-height: min(79.2vh, 704px);
    pointer-events: auto;
  }

  .ra-ayuna-ask__dialog .cmw-widget {
    width: 100%;
    max-width: none;
  }

  .ra-ayuna-ask__dialog .cmw-widget__card {
    height: min(79.2vh, 704px);
  }
}
