.phone-v3-scene {
  --phone-text: #162b53;
  --phone-muted: #4d607c;
  --phone-paper: #fff;
  --phone-bg: #f2f5ff;
  --phone-rule: #dce5f4;
  --phone-reply: #1644c2;
  isolation: isolate;
  position: relative;
  display: grid;
  justify-items: center;
  gap: 11px;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 12px 7px 5px;
}

.phone-v3-scene::before,
.phone-v3-scene::after {
  position: absolute;
  z-index: -1;
  inset-block-start: 50%;
  left: 50%;
  border-radius: 50%;
  content: '';
  pointer-events: none;
}

.phone-v3-scene::before {
  width: min(105%, 490px);
  aspect-ratio: 1;
  background: radial-gradient(circle at 27% 28%, #ffffffc9, transparent 48%),
    radial-gradient(circle at 77% 75%, #ffd8e6, transparent 45%),
    linear-gradient(146deg, #d4e3ff, #e8e5ff 57%, #f6dce9);
  transform: translate(-50%, -53%);
}

.phone-v3-scene::after {
  width: min(117%, 540px);
  aspect-ratio: 1;
  border: 1px solid #bac9ef;
  transform: translate(-50%, -53%);
}

.phone-v3-device {
  position: relative;
  width: min(100%, 322px);
  padding: 8px;
  border: 1px solid #627395;
  border-radius: 45px;
  background: linear-gradient(153deg, #697d9e, #172e54 15%, #080f20 42%, #2f4569 81%, #7287a8);
  box-shadow: inset 0 0 0 2px #ffffff34, 0 0 0 1px #fff9,
    0 25px 43px #12265935, 0 5px 10px #1d316a36;
}

.phone-v3-device::before,
.phone-v3-device::after {
  position: absolute;
  width: 3px;
  border-radius: 2px;
  background: #2c4267;
  content: '';
}

.phone-v3-device::before {
  left: -4px;
  top: 103px;
  height: 30px;
  box-shadow: 0 40px 0 #2c4267;
}

.phone-v3-device::after {
  right: -4px;
  top: 122px;
  height: 53px;
}

.phone-v3-screen {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #07142c;
  border-radius: 36px;
  background: var(--phone-paper);
  color: var(--phone-text);
  font-family: inherit;
}

.phone-v3-status {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 39px;
  padding-inline: 18px;
  direction: ltr;
  font-size: 11px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.phone-v3-island {
  position: absolute;
  inset-block-start: 8px;
  left: 50%;
  display: block;
  width: 82px;
  height: 21px;
  border-radius: 20px;
  background: #0d1628;
  transform: translateX(-50%);
}

.phone-v3-island::after {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 38%, #5d79a2 0, #223d6a 29%, #101c38 51%);
  content: '';
}

.phone-v3-indicators {
  display: flex;
  align-items: center;
  gap: 3px;
}

.phone-v3-header {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 61px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--phone-rule);
}

.phone-v3-brand {
  display: grid;
  flex: 0 0 75px;
  min-height: 38px;
  place-items: center;
  padding: 4px;
  border: 1px solid #e5eafa;
  border-radius: 12px;
  background: #fff;
}

.phone-v3-brand img {
  display: block;
  width: 100%;
  height: auto;
}

.phone-v3-profile {
  display: grid;
  flex: 1 1 auto;
  gap: 3px;
  min-width: 0;
  line-height: 1.28;
}

.phone-v3-profile strong {
  color: var(--phone-text);
  font-size: 12.5px;
}

.phone-v3-profile small {
  color: var(--phone-muted);
  font-size: 10px;
}

.phone-v3-demo {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 1px solid var(--phone-rule);
  border-radius: 30px;
  background: var(--phone-bg);
  color: var(--phone-muted);
  font-size: 9px;
  font-weight: 700;
}

.phone-v3-log {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 11px;
  height: 269px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 13px 13px 16px;
  background: radial-gradient(ellipse at 0% 0%, #dce8ff8f, transparent 54%), var(--phone-bg);
  scrollbar-color: #8899bb transparent;
  scrollbar-width: thin;
}

.phone-v3-log-title {
  align-self: center;
  margin: 0 0 2px;
  color: var(--phone-muted);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.phone-v3-bubble {
  max-width: 88%;
  margin: 0;
  padding: 9px 11px;
  border-radius: 16px;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.phone-v3-bubble-visitor {
  align-self: flex-end;
  border-end-end-radius: 5px;
  background: var(--phone-reply);
  color: #fff;
}

.phone-v3-bubble-team {
  border: 1px solid var(--phone-rule);
  border-end-start-radius: 5px;
  background: var(--phone-paper);
  color: var(--phone-text);
}

.phone-v3-bubble-team:not([hidden]) {
  animation: phone-v3-appear .38s ease-out both;
}

.phone-v3-typing {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid var(--phone-rule);
  border-radius: 15px 15px 15px 5px;
  background: var(--phone-paper);
  color: var(--phone-muted);
  font-size: 10px;
  font-weight: 650;
}

.phone-v3-dots {
  display: flex;
  gap: 3px;
}

.phone-v3-dots i {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  animation: phone-v3-dot 1.25s ease-in-out infinite;
}

.phone-v3-dots i:nth-child(2) { animation-delay: .16s; }
.phone-v3-dots i:nth-child(3) { animation-delay: .32s; }

.phone-v3-actions {
  display: grid;
  gap: 7px;
  padding: 10px 12px 8px;
  border-top: 1px solid var(--phone-rule);
}

.phone-v3-prompt,
.phone-v3-open {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 22px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: background-color .2s ease;
}

.phone-v3-prompt {
  width: 100%;
  border: 1px solid var(--phone-rule);
  background: var(--phone-bg);
  color: var(--phone-text);
  text-align: start;
  cursor: pointer;
}

.phone-v3-prompt:hover { background: #e0e9ff; }

.phone-v3-open {
  border: 1px solid transparent;
  background: var(--phone-reply);
  color: #fff;
}

.phone-v3-open:hover { background: #0e338e; color: #fff; }

.phone-v3-home {
  align-self: center;
  width: 94px;
  height: 4px;
  margin: 1px 0 7px;
  border-radius: 12px;
  background: var(--phone-text);
  opacity: .75;
}

.phone-v3-caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 5px 9px;
  color: var(--muted, #4d607c);
  font-size: 11px;
}

.phone-v3-replay {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 9px;
  border: 1px solid var(--phone-rule);
  border-radius: 20px;
  background: var(--phone-paper);
  color: var(--phone-text);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.phone-v3-replay:hover { background: var(--phone-bg); }

.phone-v3-scene :is(button, a, [tabindex]):focus-visible {
  outline: 2px solid #527fff;
  outline-offset: -2px;
}

.phone-v3-announcement {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

html[data-theme=dark] .phone-v3-scene {
  --phone-text: #edf3ff;
  --phone-muted: #b5c5de;
  --phone-paper: #172237;
  --phone-bg: #1b2942;
  --phone-rule: #3c4b67;
  --phone-reply: #2453ce;
}

html[data-theme=dark] .phone-v3-scene::before {
  background: radial-gradient(circle at 25% 20%, #425e9c, transparent 56%),
    linear-gradient(146deg, #2c456e, #29385a 55%, #563146);
}

html[data-theme=dark] .phone-v3-scene::after { border-color: #4d6084; }
html[data-theme=dark] .phone-v3-log { background: var(--phone-bg); }
html[data-theme=dark] .phone-v3-prompt:hover { background: #2b3b57; }

@keyframes phone-v3-appear {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes phone-v3-dot {
  0%, 65%, 100% { transform: translateY(0); opacity: .62; }
  32% { transform: translateY(-3px); opacity: 1; }
}

@media (max-width: 590px) {
  .phone-v3-scene { padding-block: 5px; }
  .phone-v3-device { width: min(100%, 306px); }
  .phone-v3-scene::after { width: min(100%, 370px); }
}

@media (max-width: 360px) {
  .phone-v3-brand { flex-basis: 58px; }
  .phone-v3-header { gap: 7px; padding-inline: 9px; }
  .phone-v3-demo { padding-inline: 5px; }
}

html[data-motion=off] .phone-v3-scene * {
  animation: none !important;
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .phone-v3-scene * {
    animation: none !important;
    transition: none !important;
  }
}
