.rao-floating {
  position: fixed;
  inset: auto 1.5rem 1.5rem auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
  z-index: 1050;
}

.rao-floating__launcher {
  appearance: none;
  border: none;
  border-radius: 10px;
  width: 3.25rem;
  height: 3.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #111827;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.2);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.rao-floating__launcher-icon {
  color: #ffffff;
  fill: currentColor !important;
  stroke: currentColor !important;
}

.rao-floating__launcher:hover,
.rao-floating__launcher:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 20px 36px rgba(30, 64, 175, 0.25);
  outline: none;
}

.rao-floating__launcher:focus-visible {
  outline: 2px solid rgba(99, 102, 241, 0.8);
  outline-offset: 3px;
}

.rao-floating__panel {
  position: relative;
  align-self: flex-end;
  pointer-events: auto;
  display: flex;
  justify-content: flex-end;
}

.rao-floating__panel > .rao-react {
  margin: 0 !important;
}

.rao-floating__panel .rao-react {
  margin: 0;
  backdrop-filter: blur(12px);
}

@media (max-width: 640px) {
  .rao-floating {
    inset: auto 1rem 1rem auto;
  }

  .rao-floating__launcher {
    width: 3rem;
    height: 3rem;
  }

  .rao-react:not(.rao-react--floating) .rao-react__main {
    align-items: stretch;
  }

  .rao-react:not(.rao-react--floating) .rao-react__conversation {
    padding-bottom: calc(var(--rhythm-6, 48px) + var(--rhythm-1_5, 20px));
  }

  .rao-react:not(.rao-react--floating) .rao-react__form {
    position: sticky;
    bottom: 0;
    left: 0;
    width: 100%;
    margin-top: 0;
    padding: var(--rhythm-1, 12px) 0;
    background: var(--container-background-color, #ffffff);
    border-top: 1px solid rgba(148, 163, 184, 0.24);
    box-shadow: 0 -12px 32px rgba(15, 23, 42, 0.08);
    z-index: 10;
  }
}

.rao-react--floating {
  width: min(100%, 24rem);
  min-height: 22rem;
  height: auto;
  padding: 1.5rem;
  gap: var(--rhythm-1_5);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.2);
}

.rao-react--floating .rao-react__main {
  align-items: stretch;
  gap: var(--rhythm-1_5);
  justify-content: flex-start;
  text-align: left;
}

.rao-react--floating .rao-react__greeting {
  font-size: 1.65rem;
  margin-bottom: var(--rhythm-1);
}

.rao-react--floating .rao-react__cards {
  flex-wrap: wrap;
  gap: var(--rhythm-0_5, --rhythm-0_75, --rhythm-1);
  margin-top: auto;
}

.rao-react--floating .rao-react__card {
  flex: 0 1 calc(50% - var(--rhythm-0_75));
  padding: 0.55rem 0.9rem;
  font-size: 0.85rem;
  border-radius: 999px;
  background: #f3f4f6;
  border-color: #e5e7eb;
  box-shadow: none;
}

.rao-react--floating .rao-react__card:hover,
.rao-react--floating .rao-react__card:focus-visible {
  background: #ffffff;
  border-color: #cbd5f5;
  box-shadow: 0 10px 26px rgba(99, 102, 241, 0.16);
}

.rao-react--floating .rao-react__conversation {
  max-height: 16rem;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.rao-react--floating .rao-react__message-bubble {
  max-width: 100%;
}

.rao-react__form--floating {
  position: relative;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.rao-react__form--floating .rao-react__square-button {
  display: none;
}

.rao-react__form--floating .rao-react__query {
  width: 100%;
  height: 2.75rem;
  padding: 0 3.25rem 0 1rem;
  border-radius: 999px;
  border-color: #d1d5db;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.rao-react__form--floating .rao-react__ghost-button {
  right: 1rem;
}

.rao-react--floating .rao-react__ghost-button {
  right: 1rem;
}

.rao-react--floating-expanded .rao-react__form {
  align-items: center;
  gap: 0.75rem;
}

.rao-react--floating-expanded .rao-react__query {
  border-radius: 999px;
  padding: 0 1rem;
  height: 2.8rem;
  border-color: #d1d5db;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.rao-react--floating.rao-react--floating-expanded {
  width: min(100%, 32rem);
  min-height: 26rem;
  padding: 2rem;
  gap: var(--rhythm-3);
}

.rao-react--floating.rao-react--floating-expanded .rao-react__main {
  gap: var(--rhythm-3);
}

.rao-react--floating .rao-react__ghost-button--recording {
  color: #ef4444;
}
