/*
   Patient-Thread Interactive: Dograh voice widget + phone preview.
   This layer overrides the static patient-thread section without changing
   the underlying Dograh callbacks.
*/

section.ch-patient-thread {
  --thread-console: #2d2d2f;
  --thread-console-deep: #232326;
  --thread-console-soft: rgba(247, 246, 241, 0.72);
  --thread-muted: #676b63;
  --thread-paper-soft: #ece9e1;
  --thread-paper-warm: #f6f5f3;
  --thread-blue: #dce9ff;
  --thread-mint: #b6efae;
  --thread-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --thread-morph-ease: cubic-bezier(0.65, 0, 0.35, 1);
}

section.ch-patient-thread .ch-patient-thread__shell {
  width: min(100%, 54rem) !important;
  transition: width 620ms var(--thread-morph-ease);
}

section.ch-patient-thread div.ch-patient-thread__frame {
  grid-template-columns: minmax(0, 1fr) minmax(17rem, 19.5rem) !important;
  column-gap: clamp(0.55rem, 1.35vw, 1rem) !important;
  height: 33.5rem !important;
  max-height: 33.5rem !important;
  align-items: center !important;
  overflow: visible !important;
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}

section.ch-patient-thread section.ch-patient-thread__conversation {
  display: flex !important;
  position: relative !important;
  z-index: 1 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: 100% !important;
  justify-content: center !important;
  gap: 1.45rem !important;
  overflow: visible !important;
  flex-direction: column !important;
  border: 2px solid transparent !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--thread-console) !important;
  transform: translateX(0.75rem) !important;
  transition:
    height 620ms var(--thread-morph-ease),
    border-color 620ms var(--thread-morph-ease),
    border-radius 620ms var(--thread-morph-ease),
    background-color 620ms var(--thread-morph-ease),
    box-shadow 620ms var(--thread-morph-ease),
    transform 620ms var(--thread-morph-ease);
}

section.ch-patient-thread.is-connecting .ch-patient-thread__shell,
section.ch-patient-thread.is-live .ch-patient-thread__shell,
section.ch-patient-thread.is-ended .ch-patient-thread__shell,
section.ch-patient-thread.is-error .ch-patient-thread__shell {
  width: min(100%, 62rem) !important;
}

section.ch-patient-thread.is-connecting section.ch-patient-thread__conversation,
section.ch-patient-thread.is-live section.ch-patient-thread__conversation,
section.ch-patient-thread.is-ended section.ch-patient-thread__conversation,
section.ch-patient-thread.is-error section.ch-patient-thread__conversation {
  height: 33.5rem !important;
  max-height: 33.5rem !important;
  transform: translateY(0.8rem) !important;
  justify-content: stretch !important;
  gap: 0 !important;
  overflow: hidden !important;
  border-color: #2d2d2f !important;
  border-radius: 1.35rem !important;
  background: rgba(255, 255, 255, 0.72) !important;
  box-shadow:
    0 1.1rem 2.8rem rgba(45, 45, 47, 0.09),
    0 0.08rem 0.18rem rgba(45, 45, 47, 0.05) !important;
}

section.ch-patient-thread .ch-patient-thread__bar {
  display: none !important;
}

section.ch-patient-thread .ch-patient-thread__journey {
  gap: 0.58rem !important;
}

section.ch-patient-thread .ch-patient-thread__journey span:first-child {
  color: #f7f6f1 !important;
}

section.ch-patient-thread .ch-patient-thread__journey span:last-child {
  color: var(--thread-mint) !important;
}

section.ch-patient-thread div.ch-patient-thread__messages {
  display: flex !important;
  flex: 0 1 auto !important;
  min-height: 0 !important;
  max-height: 100% !important;
  flex-direction: column !important;
  gap: 0.72rem !important;
  overflow: visible !important;
  padding: 0 !important;
}

section.ch-patient-thread.is-connecting div.ch-patient-thread__messages,
section.ch-patient-thread.is-live div.ch-patient-thread__messages,
section.ch-patient-thread.is-ended div.ch-patient-thread__messages,
section.ch-patient-thread.is-error div.ch-patient-thread__messages {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  padding: clamp(1.15rem, 2.2vw, 1.6rem) !important;
  gap: 1.3rem !important;
}

section.ch-patient-thread div.ch-patient-thread__confirmed {
  display: flex !important;
  flex: 0 0 auto !important;
  width: 100% !important;
  align-items: center !important;
  justify-content: flex-start !important;
  padding: 0 !important;
  border-top: 1px solid transparent !important;
  background: transparent !important;
  transition:
    padding 620ms var(--thread-morph-ease),
    border-color 620ms var(--thread-morph-ease),
    background-color 620ms var(--thread-morph-ease);
}

section.ch-patient-thread.is-connecting div.ch-patient-thread__confirmed,
section.ch-patient-thread.is-live div.ch-patient-thread__confirmed,
section.ch-patient-thread.is-ended div.ch-patient-thread__confirmed,
section.ch-patient-thread.is-error div.ch-patient-thread__confirmed {
  padding: 0.72rem !important;
  border-color: rgba(45, 45, 47, 0.1) !important;
  background: rgba(247, 246, 241, 0.62) !important;
}

/* The final chat layout resolves immediately; its contents fade in only after
   the outer surface has begun morphing from the idle composition. */
section.ch-patient-thread.is-morphing div.ch-patient-thread__messages {
  opacity: 0;
  transition: none;
}

section.ch-patient-thread.is-morphing.is-morphing--reveal div.ch-patient-thread__messages {
  opacity: 1;
  transition: opacity 180ms ease 150ms;
}

.ch-patient-thread__morph-ghost {
  position: fixed;
  z-index: 20;
  pointer-events: none;
  transform-origin: top left;
  transition: opacity 120ms ease;
}

.ch-patient-thread__morph-ghost.is-fading {
  opacity: 0;
}

.ch-chat-ambient-state {
  display: grid !important;
  height: auto !important;
  max-width: 36rem !important;
  align-content: center !important;
  gap: 1rem !important;
  padding: 0 !important;
  text-align: left !important;
}

.ch-call-console__status {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 0.46rem;
  padding: 0.4rem 0.58rem 0.42rem;
  border: 1px solid rgba(45, 45, 47, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
  color: rgba(45, 45, 47, 0.78);
  font-size: 0.62rem;
  font-weight: 760;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}

.ch-call-console__live {
  display: inline-block;
  width: 0.52rem;
  height: 0.52rem;
  border-radius: 50%;
  background: var(--thread-mint);
  box-shadow: 0 0 0 0.24rem rgba(182, 239, 174, 0.13);
}

.ch-patient-thread__cta-dot {
  position: relative;
  display: inline-grid;
  width: 1.72rem;
  height: 1.72rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--thread-mint);
  color: var(--thread-console);
}

.ch-chat-ambient-state h2 {
  max-width: 15ch;
  margin: 0.1rem 0 0 !important;
  color: var(--thread-console) !important;
  font-size: clamp(2.55rem, 4.8vw, 4.35rem) !important;
  font-weight: 900 !important;
  letter-spacing: -0.055em !important;
  line-height: 0.92 !important;
  text-wrap: balance;
}

.ch-call-console__lead {
  max-width: 31rem !important;
  margin: 0 !important;
  color: rgba(45, 45, 47, 0.68) !important;
  font-size: clamp(1.02rem, 1.35vw, 1.18rem) !important;
  font-weight: 520 !important;
  line-height: 1.5 !important;
  text-wrap: pretty;
}

.ch-call-console__steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.64rem;
  margin: 0.25rem 0 0;
  padding: 0;
  list-style: none;
}

.ch-call-console__steps li {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  min-width: 0;
  padding: 0;
  border: 0;
  color: rgba(45, 45, 47, 0.45);
}

.ch-call-console__steps li span {
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 50%;
  background: rgba(45, 45, 47, 0.22);
}

.ch-call-console__steps li.is-active {
  color: var(--thread-console);
}

.ch-call-console__steps li.is-active span {
  background: var(--thread-mint);
}

.ch-call-console__steps strong {
  overflow-wrap: anywhere;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.15;
  text-transform: uppercase;
}

.ch-call-console__steps small {
  color: rgba(247, 246, 241, 0.48);
  font-size: 0.67rem;
  font-weight: 560;
  line-height: 1.25;
}

section.ch-patient-thread aside.ch-patient-thread__context {
  display: flex !important;
  position: relative !important;
  z-index: 2 !important;
  align-items: stretch !important;
  justify-content: center !important;
  overflow: visible !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.ch-phone-stage {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  padding: clamp(0.7rem, 1.7vw, 1.25rem);
}

.ch-phone-dock {
  position: relative;
  display: grid;
  width: min(100%, 18.8rem);
  justify-items: center;
  gap: 0.7rem;
  transform: none;
}

.ch-phone-caption {
  width: min(100%, 18rem);
  justify-self: center;
  color: #676b63;
  font-size: 0.69rem;
  font-weight: 760;
  letter-spacing: 0.12em;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
}

.ch-phone-shell {
  position: relative;
  width: min(100%, 17.6rem);
  aspect-ratio: 375 / 735;
  padding: 0.38rem;
  border: 1px solid rgba(247, 246, 241, 0.1);
  border-radius: 2.28rem;
  background: linear-gradient(145deg, #2a3033 0%, #151a1d 46%, #0c0f11 100%);
  box-shadow:
    0 1.5rem 4rem rgba(45, 45, 47, 0.22),
    0 0.22rem 0.55rem rgba(45, 45, 47, 0.14),
    inset 0 0 0 0.12rem rgba(255, 255, 255, 0.045),
    inset 0 -0.12rem 0.32rem rgba(0, 0, 0, 0.42);
}

.ch-phone-shell::before {
  position: absolute;
  inset: 0.2rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 2.02rem;
  content: '';
  pointer-events: none;
}

.ch-phone-button {
  position: absolute;
  z-index: -1;
  width: 0.18rem;
  border-radius: 999px;
  background: #171b1d;
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.08);
}

.ch-phone-button--left {
  top: 5.4rem;
  left: -0.12rem;
  height: 3.2rem;
}

.ch-phone-button--right {
  top: 6.7rem;
  right: -0.12rem;
  height: 4.35rem;
}

.ch-phone-screen {
  display: flex;
  height: 100%;
  overflow: hidden;
  flex-direction: column;
  border-radius: 1.9rem;
  background: #071315;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.wa-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.46rem;
  min-height: 3.14rem;
  padding: 0.46rem 0.72rem 0.58rem;
  background: #19272c;
  color: #e9edef;
}

.wa-back {
  color: #a8b3ba;
  font-size: 1.38rem;
  font-weight: 620;
  line-height: 1;
}

.wa-avatar {
  display: inline-grid;
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(182, 239, 174, 0.95), rgba(220, 233, 255, 0.9));
  color: #1d2427;
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.32);
}

.wa-contact {
  display: flex;
  align-items: flex-start;
  gap: 0.16rem;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.wa-name {
  overflow: hidden;
  color: #e9edef;
  font-size: 1rem;
  font-weight: 820;
  letter-spacing: 0;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wa-status {
  color: #9fd2e9;
  font-size: 0.62rem;
  font-weight: 720;
  line-height: 1;
  white-space: nowrap;
}

.wa-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.62rem;
  color: #a8b3ba;
}

.wa-action {
  display: inline-grid;
  width: 1rem;
  height: 1rem;
  place-items: center;
}

.wa-action svg {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
}

.wa-feed {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  gap: 0.46rem;
  overflow-y: auto;
  padding: 0.86rem 0.62rem 1.16rem;
  background:
    radial-gradient(circle at 18% 14%, rgba(255, 255, 255, 0.055) 0 0.06rem, transparent 0.07rem),
    radial-gradient(circle at 82% 22%, rgba(255, 255, 255, 0.045) 0 0.08rem, transparent 0.09rem),
    radial-gradient(circle at 28% 72%, rgba(255, 255, 255, 0.04) 0 0.07rem, transparent 0.08rem),
    linear-gradient(135deg, rgba(255, 255, 255, 0.018) 25%, transparent 25%) 0 0 / 1.8rem 1.8rem,
    #071315;
  scrollbar-width: none;
}

.wa-feed::-webkit-scrollbar {
  display: none;
}

.wa-empty {
  display: grid;
  max-width: 12.2rem;
  gap: 0.42rem;
  margin: auto;
  color: #8696a0;
  text-align: center;
}

.wa-empty strong {
  color: #d9e1e6;
  font-size: 0.86rem;
  font-weight: 820;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.wa-empty span {
  font-size: 0.72rem;
  font-weight: 620;
  line-height: 1.35;
}

.wa-bubble {
  position: relative;
  display: flex;
  max-width: min(13.65rem, 78%);
  align-self: flex-end;
  flex-direction: column;
  padding: 0.47rem 0.56rem 0.34rem 0.62rem;
  border-radius: 0.72rem 0.72rem 0.18rem 0.72rem;
  background: #b6efae;
  color: #24213a;
  font-size: 0.73rem;
  font-weight: 590;
  letter-spacing: -0.006em;
  line-height: 1.25;
  opacity: 0;
  transform: translateY(0.35rem);
  white-space: pre-wrap;
  animation: wa-fade-in 0.42s var(--thread-ease) forwards;
  box-shadow:
    0 0.05rem 0.12rem rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.wa-bubble--details {
  gap: 0.22rem;
  max-width: min(13.9rem, 80%);
  padding: 0.52rem 0.58rem 0.34rem 0.64rem;
  font-size: 0.68rem;
  font-weight: 610;
  line-height: 1.18;
  white-space: normal;
}

.wa-bubble-line {
  display: block;
  min-width: 0;
}

.wa-bubble-line--title {
  max-width: 16ch;
  margin-bottom: 0.14rem;
  font-size: 0.76rem;
  font-weight: 760;
  letter-spacing: -0.014em;
  line-height: 1.18;
}

.wa-bubble-line--field {
  overflow: hidden;
  font-size: 0.66rem;
  font-weight: 680;
  letter-spacing: -0.012em;
  line-height: 1.16;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wa-bubble::after {
  position: absolute;
  right: -0.2rem;
  bottom: 0;
  width: 0.44rem;
  height: 0.44rem;
  background: #b6efae;
  clip-path: polygon(0 14%, 100% 100%, 0 100%);
  content: '';
}

.wa-bubble-meta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.16rem;
  align-self: flex-end;
  margin-top: 0.18rem;
  color: rgba(36, 33, 58, 0.48);
  font-size: 0.54rem;
  font-weight: 660;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
}

.wa-bubble-ticks {
  position: relative;
  display: inline-block;
  width: 0.48rem;
  height: 0.28rem;
  color: #1ea7ff;
}

.wa-bubble-ticks::before,
.wa-bubble-ticks::after {
  position: absolute;
  width: 0.24rem;
  height: 0.12rem;
  border: solid currentColor;
  border-width: 0 0 0.08rem 0.08rem;
  content: '';
  transform: rotate(-45deg);
}

.wa-bubble-ticks::before {
  top: 0.08rem;
  left: 0.02rem;
}

.wa-bubble-ticks::after {
  top: 0.08rem;
  left: 0.18rem;
}

@keyframes wa-fade-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.wa-input {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.66rem 0.56rem 0.62rem;
  background: #19272c;
}

.wa-home-indicator {
  flex: 0 0 auto;
  height: 1rem;
  background: #19272c;
}

.wa-home-indicator::before {
  display: block;
  width: 6.45rem;
  height: 0.24rem;
  margin: 0 auto;
  border-radius: 999px;
  background: rgba(247, 246, 241, 0.9);
  content: '';
}

.wa-input-addon,
.wa-input-mic {
  flex: 0 0 auto;
  color: #a8b3ba;
}

.wa-input-addon {
  display: inline-grid;
  width: 1rem;
  height: 1rem;
  place-items: center;
  font-size: 1.22rem;
  font-weight: 420;
  letter-spacing: 0.02em;
  line-height: 1;
}

.wa-input-text {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  padding: 0.48rem 0.7rem;
  border-radius: 999px;
  background: #263942;
  color: #aab5ba;
  font-size: 0.63rem;
  font-weight: 690;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wa-input-mic {
  display: inline-grid;
  width: 1.12rem;
  height: 1.12rem;
  place-items: center;
}

.wa-input-mic svg {
  width: 1.12rem;
  height: 1.12rem;
  stroke: currentColor;
}

.ch-call-control {
  display: grid;
  width: fit-content;
  max-width: 100%;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: flex-start;
  gap: 0.74rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: left;
  transition:
    background-color 620ms var(--thread-morph-ease),
    border-color 620ms var(--thread-morph-ease);
}

.ch-call-control__agent {
  display: block;
  grid-column: 2;
  min-width: 0;
  padding: 0 0.08rem;
}

.ch-call-control__agent-copy {
  display: block;
  min-width: 0;
}

.ch-call-control__agent-copy strong {
  color: var(--thread-console);
  font-size: 0.82rem;
  font-weight: 820;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
}

.ch-call-control__orb {
  display: none !important;
}

.ch-call-control__icon {
  position: relative;
  display: inline-grid;
  width: 2.1rem;
  height: 2.1rem;
  place-items: center;
  border: 1px solid rgba(45, 45, 47, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: rgba(45, 45, 47, 0.56);
  cursor: default;
  font: inherit;
}

.ch-call-control__icon--mic:not(:disabled) {
  cursor: pointer;
}

.ch-call-control__icon--mic:not(:disabled):hover {
  border-color: rgba(45, 45, 47, 0.16);
  color: rgba(45, 45, 47, 0.78);
}

.ch-call-control__icon--mic.is-active {
  border-color: rgba(159, 230, 158, 0.46);
  background: rgba(159, 230, 158, 0.16);
  color: #2d2d2f;
}

.ch-call-control__icon--mic.is-muted,
.ch-call-control__icon--mic.is-blocked {
  border-color: rgba(45, 45, 47, 0.12);
  background: rgba(45, 45, 47, 0.06);
  color: rgba(45, 45, 47, 0.46);
}

.ch-call-control__icon--mic.is-muted::after,
.ch-call-control__icon--mic.is-blocked::after {
  content: "";
  position: absolute;
  width: 1.16rem;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(-45deg);
}

.ch-call-control__icon:nth-of-type(1) {
  grid-column: 3;
  grid-row: 1;
}

.ch-call-control__icon:nth-of-type(2) {
  grid-column: 4;
  grid-row: 1;
}

.ch-call-control__icon svg {
  width: 0.9rem;
  height: 0.9rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.85;
}

section.ch-patient-thread.is-connecting .ch-call-control,
section.ch-patient-thread.is-live .ch-call-control,
section.ch-patient-thread.is-ended .ch-call-control,
section.ch-patient-thread.is-error .ch-call-control {
  width: 100%;
  grid-template-columns: auto minmax(5rem, 1fr) auto auto;
  align-items: center;
  gap: 0.46rem;
  padding: 0.36rem 0.5rem 0.36rem 0.36rem;
  border-color: rgba(45, 45, 47, 0.1);
  border-style: solid;
  border-width: 1px;
  border-radius: 1.12rem;
  background: #fff;
  box-shadow:
    0 0.72rem 1.65rem rgba(45, 45, 47, 0.085),
    0 0.08rem 0.18rem rgba(45, 45, 47, 0.06);
}

section.ch-patient-thread.is-connecting .ch-call-control__agent,
section.ch-patient-thread.is-live .ch-call-control__agent {
  display: none;
}

.ch-patient-thread__cta {
  display: inline-flex;
  grid-column: 1;
  grid-row: 1;
  align-items: center;
  justify-content: flex-start;
  gap: 0.58rem;
  width: 8.6rem;
  min-width: 8.6rem;
  height: 2.55rem;
  padding: 0.48rem 1rem 0.48rem 0.56rem;
  border: 1px solid rgba(45, 45, 47, 0.18);
  border-radius: 999px;
  background: var(--thread-console);
  color: #f7f6f1;
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
  transition:
    background-color 180ms var(--thread-ease),
    border-color 180ms var(--thread-ease),
    color 180ms var(--thread-ease),
    transform 180ms var(--thread-ease);
}

.ch-patient-thread__cta--connected .ch-patient-thread__cta-dot {
  display: inline-grid;
  width: 1.72rem;
  height: 1.72rem;
  place-items: center;
  border-radius: 999px;
  background: rgba(182, 239, 174, 0.96);
}

.ch-patient-thread__cta-dot {
  box-shadow:
    inset 0 0 0 1px rgba(45, 45, 47, 0.1),
    0 0 0 0.28rem rgba(182, 239, 174, 0.16);
}

section.ch-patient-thread .ch-patient-thread__confirmed .ch-patient-thread__cta--connecting .ch-patient-thread__cta-dot {
  background: #f3c85b;
  box-shadow:
    inset 0 0 0 1px rgba(45, 45, 47, 0.12),
    0 0 0 0.28rem rgba(243, 200, 91, 0.18);
}

section.ch-patient-thread .ch-patient-thread__confirmed .ch-patient-thread__cta--connected .ch-patient-thread__cta-dot {
  background: rgba(182, 239, 174, 0.96);
  box-shadow:
    inset 0 0 0 1px rgba(45, 45, 47, 0.1),
    0 0 0 0.28rem rgba(182, 239, 174, 0.16);
}

section.ch-patient-thread .ch-patient-thread__confirmed .ch-patient-thread__cta--failed .ch-patient-thread__cta-dot {
  background: #f06a5f;
  box-shadow:
    inset 0 0 0 1px rgba(45, 45, 47, 0.12),
    0 0 0 0.28rem rgba(240, 106, 95, 0.18);
}

.ch-audio-control {
  display: none;
  position: relative;
  grid-column: 3;
  grid-row: 1;
  align-items: center;
  justify-self: center;
  width: 2.25rem;
  height: 2.25rem;
  min-width: 2.25rem;
  margin-left: 0;
  color: rgba(45, 45, 47, 0.62);
}

section.ch-patient-thread.is-connecting .ch-audio-control,
section.ch-patient-thread.is-live .ch-audio-control {
  display: flex;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

section.ch-patient-thread.is-live:not(.is-control-morphing) .ch-audio-control {
  opacity: 1;
  pointer-events: auto;
}

.ch-audio-control__button {
  display: none;
  width: 2.28rem;
  min-width: 0;
  max-width: none;
  height: 2.28rem;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(45, 45, 47, 0.11);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: rgba(45, 45, 47, 0.58);
  cursor: default;
  font: inherit;
  text-align: center;
}

.ch-audio-control__select-icon {
  display: inline-grid;
  position: absolute;
  inset: 0;
  place-items: center;
  pointer-events: none;
}

.ch-audio-control__select-icon svg {
  width: 1.08rem;
  height: 1.08rem;
  stroke: currentColor;
}

.ch-call-control__waveform {
  display: none;
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  min-width: 0;
  max-width: 21rem;
  height: 2.25rem;
  align-items: center;
  justify-content: center;
  gap: 0.135rem;
  padding: 0 0.42rem;
  color: rgba(45, 45, 47, 0.34);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}

section.ch-patient-thread.is-connecting .ch-call-control__waveform,
section.ch-patient-thread.is-live .ch-call-control__waveform {
  display: flex;
}

.ch-call-control__waveform i {
  display: block;
  width: 0.145rem;
  height: 0.34rem;
  flex: 0 0 auto;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.72;
  transform-origin: center;
  transition:
    opacity 80ms linear,
    transform 80ms linear;
}

.ch-call-control__waveform i:nth-child(4n + 1) { height: 0.44rem; }
.ch-call-control__waveform i:nth-child(4n + 2) { height: 0.7rem; }
.ch-call-control__waveform i:nth-child(4n + 3) { height: 1rem; }
.ch-call-control__waveform i:nth-child(8n + 4) { height: 1.22rem; }

.ch-call-control__waveform.is-muted i {
  opacity: 0.26;
}

.ch-call-control__utility {
  display: none;
  grid-column: 4;
  grid-row: 1;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border-radius: 999px;
  color: rgba(45, 45, 47, 0.56);
}

section.ch-patient-thread.is-connecting .ch-call-control__utility,
section.ch-patient-thread.is-live .ch-call-control__utility {
  display: inline-grid;
}

.ch-call-control__utility svg {
  width: 1.08rem;
  height: 1.08rem;
  stroke: currentColor;
}

.ch-audio-control__button:not(:disabled) {
  cursor: pointer;
}

.ch-audio-control__button:not(:disabled):hover {
  border-color: rgba(45, 45, 47, 0.16);
  background: rgba(45, 45, 47, 0.06);
}

.ch-audio-control__button.is-active {
  border-color: rgba(159, 230, 158, 0.62);
  background: rgba(159, 230, 158, 0.18);
  color: #17946e;
}

.ch-audio-control__button.is-muted,
.ch-audio-control__button.is-blocked {
  border-color: rgba(45, 45, 47, 0.12);
  background: rgba(45, 45, 47, 0.06);
  color: rgba(45, 45, 47, 0.5);
}

.ch-audio-control__icon {
  position: relative;
  display: inline-grid;
  width: 1.36rem;
  height: 1.36rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  background: transparent;
  color: currentColor;
}

.ch-audio-control__button.is-active .ch-audio-control__icon {
  background: transparent;
}

.ch-audio-control__button.is-muted .ch-audio-control__icon::after,
.ch-audio-control__button.is-blocked .ch-audio-control__icon::after {
  content: "";
  position: absolute;
  width: 1.1rem;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(-45deg);
}

.ch-audio-control__icon svg {
  width: 0.82rem;
  height: 0.82rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.ch-audio-control__copy {
  display: none;
  align-items: center;
  min-width: 0;
  gap: 0.28rem;
}

.ch-audio-control__copy strong,
.ch-audio-control__copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ch-audio-control__copy strong {
  color: currentColor;
  font-size: 0.68rem;
  font-weight: 820;
  line-height: 1;
}

.ch-audio-control__copy span {
  display: none;
  color: rgba(45, 45, 47, 0.52);
  font-size: 0.56rem;
  font-weight: 720;
  line-height: 1;
}

.ch-audio-control__meter {
  display: none;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.12rem;
  margin-left: auto;
  color: rgba(45, 45, 47, 0.32);
}

.ch-audio-control__meter i {
  display: block;
  width: 0.12rem;
  height: 0.42rem;
  border-radius: 999px;
  background: currentColor;
  transform-origin: center;
}

.ch-audio-control__button.is-active .ch-audio-control__meter {
  color: #17946e;
}

.ch-audio-control__select {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  min-width: 0;
  max-width: none;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: transparent;
  opacity: 0;
  font: inherit;
  font-size: 0.62rem;
  font-weight: 760;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.ch-audio-control__select:disabled {
  cursor: default;
}

section.ch-patient-thread.is-live .ch-audio-control__select:not(:disabled) {
  display: block;
  opacity: 0;
}

.ch-patient-thread__cta:hover {
  background: #1f1f21;
  transform: translateY(-1px);
}

.ch-patient-thread__cta:active {
  transform: translateY(0) scale(0.985);
}

.ch-patient-thread__cta:focus-visible {
  outline: 2px solid rgba(45, 45, 47, 0.34);
  outline-offset: 0.22rem;
}

.ch-patient-thread__cta--connecting {
  width: 10.25rem;
  min-width: 10.25rem;
  border-color: rgba(45, 45, 47, 0.16);
  background: var(--thread-console);
  color: #f7f6f1;
  cursor: wait;
  pointer-events: none;
}

.ch-patient-thread__cta--connecting .ch-patient-thread__cta-dot {
  background: #f3c85b;
  box-shadow:
    inset 0 0 0 1px rgba(45, 45, 47, 0.12),
    0 0 0 0.28rem rgba(243, 200, 91, 0.18);
}

.ch-patient-thread__cta--connected {
  border-color: rgba(45, 45, 47, 0.16);
  background: var(--thread-console);
  color: #f7f6f1;
}

.ch-patient-thread__cta--connected .ch-patient-thread__cta-dot {
  background: rgba(182, 239, 174, 0.96);
  box-shadow:
    inset 0 0 0 1px rgba(45, 45, 47, 0.1),
    0 0 0 0.28rem rgba(182, 239, 174, 0.16);
}

.ch-patient-thread__cta--connected:hover {
  background: #1f1f21;
}

.ch-patient-thread__cta--failed {
  border-color: rgba(240, 106, 95, 0.28);
  background: var(--thread-console);
  color: #f7f6f1;
}

.ch-patient-thread__cta--failed .ch-patient-thread__cta-dot {
  background: #f06a5f;
  box-shadow:
    inset 0 0 0 1px rgba(45, 45, 47, 0.12),
    0 0 0 0.28rem rgba(240, 106, 95, 0.18);
}

.ch-patient-thread__cta--failed:hover {
  background: #1f1f21;
}

.ch-patient-thread__cta-error {
  grid-column: 2;
  grid-row: 1;
  display: none;
  max-width: none;
  margin: 0;
  padding: 0 0.1rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(45, 45, 47, 0.58);
  font-size: 0.78rem;
  font-weight: 760;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ch-patient-thread__cta-error--visible {
  display: block;
}

.ch-patient-thread__cta-note {
  display: none;
}

section.ch-patient-thread.is-connecting .ch-patient-thread__cta-note,
section.ch-patient-thread.is-live .ch-patient-thread__cta-note,
section.ch-patient-thread.is-ended .ch-patient-thread__cta-note,
section.ch-patient-thread.is-error .ch-patient-thread__cta-note {
  display: none;
}

section.ch-patient-thread.is-error .ch-patient-thread__cta-error {
  display: block;
}

section.ch-patient-thread.is-error .ch-call-control__agent {
  display: none;
}

section.ch-patient-thread.is-ended .ch-call-control {
  display: grid;
  align-items: center;
  justify-content: flex-start;
  padding: 0.32rem;
}

section.ch-patient-thread.is-ended .ch-call-control__agent,
section.ch-patient-thread.is-ended .ch-audio-control,
section.ch-patient-thread.is-ended .ch-call-control__icon,
section.ch-patient-thread.is-ended .ch-patient-thread__cta-error {
  display: none;
}

section.ch-patient-thread.is-ended .ch-patient-thread__cta {
  width: 8.6rem;
  min-width: 8.6rem;
  min-height: 0;
  padding: 0.48rem 1rem 0.48rem 0.56rem;
}

section.ch-patient-thread.is-ended div.ch-patient-thread__messages {
  overflow: hidden !important;
}

/* End-of-call handoff: retire the transcript before the early-access panel enters. */
section.ch-patient-thread div.ch-patient-thread__messages.is-ending-handoff > * {
  opacity: 0;
  transform: translateY(-0.45rem);
  pointer-events: none;
  transition:
    opacity 140ms ease,
    transform 140ms var(--thread-ease);
}

.ch-call-ended-panel {
  display: grid;
  width: 100%;
  height: 100%;
  min-width: 0;
  grid-template-columns: minmax(0, 0.82fr) minmax(17.5rem, 0.9fr);
  align-items: stretch;
  gap: clamp(1.05rem, 2vw, 1.35rem);
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 280ms ease,
    transform 280ms var(--thread-ease);
}

.ch-call-ended-panel.is-entering {
  opacity: 0;
  transform: translateY(0.65rem);
}

.ch-call-ended-panel__prompt,
.ch-call-ended-panel__form {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.ch-call-ended-panel__prompt {
  justify-content: center;
  gap: 0.68rem;
  padding: clamp(0.5rem, 1.2vw, 0.9rem) 0;
}

.ch-call-ended-panel__prompt > span,
.ch-call-ended-panel__form-head span {
  color: var(--thread-muted);
  font-size: 0.66rem;
  font-weight: 820;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
}

.ch-call-ended-panel__prompt > span {
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.ch-call-ended-panel__prompt h3 {
  max-width: 10.7ch;
  margin: 0 0 0.42rem;
  color: var(--thread-console);
  font-size: clamp(2.08rem, 3.35vw, 2.68rem);
  font-weight: 880;
  letter-spacing: -0.055em;
  line-height: 0.88;
}

.ch-call-ended-panel__headline-line {
  display: block;
  max-width: 100%;
}

.ch-call-ended-panel__headline-line--bring {
  font-size: 1em;
}

.ch-call-ended-panel__headline-line--clinic {
  font-size: 1em;
}

.ch-call-ended-panel__prompt p {
  max-width: 24ch;
  margin: 0;
  padding-top: 0.68rem;
  color: var(--thread-muted);
  font-size: clamp(1.02rem, 1.42vw, 1.16rem);
  font-weight: 660;
  line-height: 1.34;
  text-wrap: pretty;
}

.ch-call-ended-panel__form {
  display: grid;
  align-self: center;
  gap: 0.64rem;
  padding: clamp(1rem, 2vw, 1.2rem);
  border: 1px solid rgba(45, 45, 47, 0.12);
  border-radius: 1rem;
  background: rgba(247, 246, 241, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.ch-call-ended-panel__form-head {
  display: grid;
  gap: 0.22rem;
  margin-bottom: 0.16rem;
}

.ch-call-ended-panel__form-head strong {
  color: var(--thread-console);
  font-size: clamp(1.12rem, 1.7vw, 1.28rem);
  font-weight: 850;
  letter-spacing: -0.035em;
  line-height: 1.04;
}

.ch-call-ended-panel__form label {
  display: grid;
  min-width: 0;
  gap: 0.26rem;
}

.ch-call-ended-panel__form label span {
  color: rgba(45, 45, 47, 0.5);
  font-size: 0.62rem;
  font-weight: 780;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}

.ch-call-ended-panel__form input {
  width: 100%;
  min-width: 0;
  height: 2.35rem;
  padding: 0 0.72rem;
  border: 1px solid rgba(45, 45, 47, 0.13);
  border-radius: 0.58rem;
  background: #fff;
  color: var(--thread-console);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1;
}

.ch-call-ended-panel__form input:focus {
  border-color: rgba(45, 45, 47, 0.34);
  outline: 0;
  box-shadow: 0 0 0 0.18rem rgba(255, 239, 153, 0.45);
}

.ch-call-ended-panel__form button {
  height: 2.5rem;
  margin-top: 0.12rem;
  padding: 0 0.9rem;
  border: 0;
  border-radius: 0.6rem;
  background: var(--thread-console);
  color: #f7f6f1;
  cursor: pointer;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 820;
  letter-spacing: -0.01em;
  line-height: 1;
  white-space: nowrap;
}

.ch-call-ended-panel__form button:hover {
  background: #1f1f21;
}

.ch-call-ended-panel__feedback {
  display: none;
  margin: 0;
  color: var(--thread-muted);
  font-size: 0.76rem;
  font-weight: 680;
  line-height: 1.2;
}

.ch-call-ended-panel.is-capture-submitted .ch-call-ended-panel__feedback {
  display: block;
}

section.ch-patient-thread .ch-patient-thread__messages div.ch-patient-thread__message {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  width: min(100%, 33rem) !important;
  max-width: 33rem !important;
  height: auto !important;
  min-height: unset !important;
  gap: 0.3rem !important;
  padding: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--thread-console) !important;
  line-height: 1.32 !important;
}

.ch-patient-thread__message-role {
  grid-column: 1 / -1;
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 0.28rem;
  color: rgba(45, 45, 47, 0.54);
  font-size: 0.64rem;
  font-weight: 760;
  letter-spacing: 0.01em;
  line-height: 1.1;
}

.ch-patient-thread__message-role::before {
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 999px;
  content: '';
}

.ch-patient-thread__message p {
  grid-column: 1 / -1;
  width: fit-content;
  max-width: min(100%, 28.5rem);
  margin: 0 !important;
  padding: 0.72rem 0.98rem;
  border: 1px solid transparent;
  border-radius: 0.82rem;
  color: #18181a;
  font-size: clamp(0.95rem, 1.12vw, 1.04rem);
  font-weight: 510 !important;
  letter-spacing: -0.006em;
  line-height: 1.38;
  text-wrap: pretty;
}

.ch-patient-thread__message-time {
  grid-column: 1 / -1;
  justify-self: end;
  color: rgba(45, 45, 47, 0.42);
  font-size: 0.64rem;
  font-weight: 650;
  line-height: 1;
}

section.ch-patient-thread .ch-patient-thread__messages div.ch-patient-thread__message--patient {
  align-self: flex-end !important;
}

section.ch-patient-thread .ch-patient-thread__messages div.ch-patient-thread__message--patient .ch-patient-thread__message-role {
  justify-self: end;
  color: rgba(45, 45, 47, 0.56);
}

section.ch-patient-thread .ch-patient-thread__messages div.ch-patient-thread__message--patient .ch-patient-thread__message-role::before {
  background: var(--thread-blue);
  box-shadow: inset 0 0 0 1px rgba(45, 45, 47, 0.08);
}

section.ch-patient-thread .ch-patient-thread__messages div.ch-patient-thread__message--patient p {
  justify-self: end;
  max-width: min(100%, 24rem);
  border-color: rgba(0, 0, 0, 0.04);
  background: #181819;
  color: #f7f6f1;
  font-weight: 570 !important;
  box-shadow:
    0 0.4rem 0.92rem rgba(45, 45, 47, 0.105),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  text-align: right;
}

section.ch-patient-thread .ch-patient-thread__messages div.ch-patient-thread__message--patient .ch-patient-thread__message-time {
  justify-self: end;
}

section.ch-patient-thread .ch-patient-thread__messages div.ch-patient-thread__message--hub {
  align-self: flex-start !important;
}

section.ch-patient-thread .ch-patient-thread__messages div.ch-patient-thread__message--hub .ch-patient-thread__message-role {
  justify-self: start;
  color: rgba(45, 45, 47, 0.56);
}

section.ch-patient-thread .ch-patient-thread__messages div.ch-patient-thread__message--hub .ch-patient-thread__message-role::before {
  background: var(--thread-mint);
  box-shadow: inset 0 0 0 1px rgba(45, 45, 47, 0.08);
}

section.ch-patient-thread .ch-patient-thread__messages div.ch-patient-thread__message--hub p {
  justify-self: start;
  border-color: rgba(45, 45, 47, 0.04);
  background: #f3f3f2;
  color: #18181a;
  font-weight: 500 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
  text-align: left;
}

section.ch-patient-thread .ch-patient-thread__messages div.ch-patient-thread__message--hub .ch-patient-thread__message-time {
  justify-self: start;
}

.ch-live-transcript__empty {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  align-content: center;
  justify-items: start;
  color: rgba(45, 45, 47, 0.6);
}

.ch-live-transcript__empty > span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1.1rem;
  color: rgba(45, 45, 47, 0.74);
  font-size: 0.82rem;
  font-weight: 780;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
}

.ch-live-transcript__empty > span::before {
  content: "";
  width: 0.48rem;
  height: 0.48rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--thread-mint);
  box-shadow: 0 0 0 0.2rem rgba(182, 239, 174, 0.18);
}

.ch-live-transcript__empty strong {
  display: block;
  max-width: 15ch;
  color: var(--thread-console);
  font-size: clamp(2.45rem, 4vw, 3.9rem);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 0.94;
  text-wrap: balance;
}

.ch-live-transcript__empty strong span {
  display: block;
}

.ch-live-transcript__empty p {
  max-width: 40ch;
  margin: 1.35rem 0 0;
  color: rgba(45, 45, 47, 0.76);
  font-size: clamp(1.08rem, 1.35vw, 1.24rem);
  font-weight: 620;
  line-height: 1.38;
  text-wrap: pretty;
}

@media (prefers-reduced-motion: reduce) {
  .wa-bubble,
  .ch-patient-thread__cta,
  .ch-call-control__waveform i,
  .ch-call-ended-panel,
  section.ch-patient-thread div.ch-patient-thread__messages.is-ending-handoff > *,
  .ch-live-transcript__empty {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 900px) {
  .ch-call-console__steps {
    grid-template-columns: 1fr;
  }

  .ch-phone-dock {
    transform: none;
  }
}

@media (max-width: 760px) {
  section.ch-patient-thread div.ch-patient-thread__frame {
    display: flex !important;
    height: auto !important;
    max-height: none !important;
    flex-direction: column !important;
    gap: 1.75rem !important;
    overflow: visible !important;
  }

  section.ch-patient-thread aside.ch-patient-thread__context {
    order: 2 !important;
    height: 31rem !important;
    border: 0 !important;
  }

  section.ch-patient-thread section.ch-patient-thread__conversation {
    order: 1 !important;
    height: auto !important;
  }

  section.ch-patient-thread div.ch-patient-thread__messages {
    padding: 0 !important;
  }

  .ch-call-ended-panel {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .ch-call-ended-panel__prompt h3 {
    font-size: clamp(2.15rem, 11vw, 3rem);
  }

  section.ch-patient-thread.is-ended .ch-patient-thread__cta {
    min-height: 2.35rem;
  }

  .ch-chat-ambient-state {
    max-width: none !important;
  }

  .ch-chat-ambient-state h2 {
    max-width: 15ch;
    font-size: clamp(2.55rem, 13vw, 4rem) !important;
  }

  .ch-phone-stage {
    padding: 1rem;
  }

  .ch-phone-shell {
    width: min(100%, 13rem);
  }

  .ch-patient-thread__cta-wrap {
    display: grid;
    justify-items: start;
    text-align: left;
  }

  .ch-patient-thread__cta-note {
    order: 2;
    max-width: 18rem;
  }

  .ch-patient-thread__cta {
    order: 1;
    width: min(100%, 16rem);
  }
}
