.scp-phone {
  position: relative;
  width: min(100%, 19.5rem);
  padding: 1px;
  border: 1px solid hsl(150 8% 86%);
  border-radius: 45px;
  background: #fff;
  box-shadow: 0 32px 68px rgb(31 42 47 / 0.17), 0 10px 24px rgb(31 42 47 / 0.08);
  color: hsl(240 7% 6%);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

.scp-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.scp-screen {
  overflow: hidden;
  border-radius: 43px;
  background: #ebe7f6 url("../assets/images/chat-background-pastel.jpeg") center / cover no-repeat;
}

.scp-status,
.scp-header,
.scp-composer {
  background: hsl(270 14% 98% / 0.78);
  -webkit-backdrop-filter: blur(0.75rem) saturate(108%);
  backdrop-filter: blur(0.75rem) saturate(108%);
}

.scp-status {
  display: flex;
  height: 2rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 1rem 0.1rem 1.2rem;
  font-size: 0.7rem;
  font-weight: 650;
}

.scp-status__time { display: flex; align-items: center; gap: 0.2rem; }
.scp-status__person { position: relative; width: 0.45rem; height: 0.45rem; }
.scp-status__person::before { content: ""; position: absolute; top: 0; left: 50%; width: 0.2rem; height: 0.2rem; border-radius: 999px; background: currentColor; transform: translateX(-50%); }
.scp-status__person::after { content: ""; position: absolute; right: 0; bottom: 0; left: 0; height: 0.22rem; border-radius: 999px 999px 0.1rem 0.1rem; background: currentColor; }

.scp-status__icons {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.scp-status__icons svg:first-child { width: 0.8rem; height: 0.56rem; fill: currentColor; }
.scp-status__icons svg:nth-child(2) { width: 0.9rem; height: 0.65rem; }

.scp-battery {
  display: grid;
  width: 1.35rem;
  height: 0.82rem;
  place-items: center;
  border-radius: 999px;
  background: hsl(240 4% 71%);
  color: hsl(240 7% 9%);
  font-size: 0.48rem;
  font-weight: 700;
}

.scp-header {
  display: flex;
  min-height: 4.35rem;
  align-items: center;
  gap: 0.55rem;
  padding: 0.2rem 0.8rem 0.6rem;
  border-bottom: 1px solid hsl(270 8% 36% / 0.1);
}

.scp-back {
  position: relative;
  display: grid;
  width: 2.45rem;
  height: 2.45rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.74);
}
.scp-back::before { content: ""; width: 0.55rem; height: 0.55rem; border-bottom: 2px solid currentColor; border-left: 2px solid currentColor; transform: translateX(0.12rem) rotate(45deg); }

.scp-contact { display: flex; align-items: center; gap: 0.65rem; }

.scp-avatar {
  position: relative;
  display: grid;
  width: 2.8rem;
  height: 2.8rem;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 999px;
  background: hsl(158 50% 89%);
  color: hsl(158 70% 24%);
  font-size: 0.78rem;
  font-weight: 750;
}

.scp-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scp-avatar.has-image .scp-avatar__fallback { visibility: hidden; }
.scp-contact__copy { min-width: 0; line-height: 1.15; }
.scp-contact__name { display: flex; align-items: center; gap: 0.28rem; font-size: 0.9rem; font-weight: 750; }
.scp-contact__name > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scp-contact__subtitle { display: block; overflow: hidden; margin-top: 0.2rem; color: hsl(240 3% 43%); font-size: 0.68rem; text-overflow: ellipsis; white-space: nowrap; }
.scp-verified { display: inline-flex; width: 0.78rem; height: 0.78rem; flex: 0 0 auto; }
.scp-verified svg { width: 100%; height: 100%; }

.scp-chat {
  display: flex;
  min-height: 27.8rem;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.55rem;
  padding: 0.8rem 0.7rem;
}

.scp-message { display: flex; opacity: 1; }
.scp-message--outgoing { justify-content: flex-end; }
.scp-message--incoming { justify-content: flex-start; }

.scp-typing {
  position: relative;
  display: flex;
  min-width: 2.75rem;
  min-height: 1.75rem;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.38rem 0.52rem;
  border-radius: 0.9rem 0.9rem 0.9rem 0.2rem;
  background: #fff;
  box-shadow: 0 1px 0.5px rgb(0 0 0 / 0.13);
}
.scp-typing::after { content: ""; position: absolute; bottom: -0.1rem; left: -0.14rem; width: 0.55rem; height: 0.55rem; background: #fff; clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.scp-typing span { width: 0.3rem; height: 0.3rem; border-radius: 999px; background: #9ca3af; animation: scp-typing-dot 1.35s ease-in-out infinite; }
.scp-typing span:nth-child(2) { animation-delay: 150ms; }
.scp-typing span:nth-child(3) { animation-delay: 300ms; }

.scp-choice {
  position: relative;
  overflow: visible;
  width: min(88%, 16rem);
  border-radius: 0.72rem 0.72rem 0.72rem 0.18rem;
  background: #fff;
  box-shadow: 0 1px 0.5px rgb(0 0 0 / 0.13);
}
.scp-choice::after { content: ""; position: absolute; bottom: 0; left: -0.38rem; width: 0.7rem; height: 0.72rem; background: #fff; clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.scp-choice__body { padding: 0.68rem 0.72rem 0.48rem; border-radius: 0.72rem 0.72rem 0 0; background: #fff; }
.scp-choice__heading { display: block; margin-bottom: 0.32rem; color: #111b21; font-size: 0.9rem; font-weight: 700; line-height: 1.22; }
.scp-choice__body p { margin: 0; color: #111b21; font-size: 0.84rem; font-weight: 500; line-height: 1.38; }
.scp-choice__translation { display: block; margin-top: 0.46rem; padding-left: 0.7rem; border-left: 3px solid #8a8f92; color: #667781; font-size: 0.82rem; line-height: 1.35; }
.scp-choice__time { display: block; margin-top: 0.3rem; color: #667781; font-size: 0.68rem; text-align: right; }
.scp-choice__options { overflow: hidden; border-top: 1px solid #e7e9ea; border-radius: 0 0 0.72rem 0.18rem; }
.scp-choice__option { display: flex; width: 100%; min-height: 2.45rem; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.42rem 0.6rem; border: 0; border-bottom: 1px solid #e7e9ea; background: #fff; color: #128c62; font: inherit; font-size: 0.82rem; line-height: 1.2; cursor: pointer; }
.scp-choice__option:last-child { border-bottom: 0; }
.scp-choice__option:hover, .scp-choice__option.is-selected { background: #edf8f2; }
.scp-choice__option:focus-visible { position: relative; z-index: 1; outline: 3px solid rgb(10 132 255 / 0.45); outline-offset: -3px; }
.scp-choice__arrow { display: inline-flex; width: 1.1rem; height: 1.1rem; }
.scp-choice__arrow svg { width: 100%; height: 100%; }

.scp-bubble {
  position: relative;
  max-width: 87%;
  padding: 0.62rem 0.7rem 0.4rem;
  border-radius: 0.75rem 0.75rem 0.75rem 0.2rem;
  background: hsl(0 0% 100%);
  box-shadow: 0 1px 0.5px hsl(0 0% 0% / 0.13);
}
.scp-bubble::after { content: ""; position: absolute; bottom: 0; left: -0.38rem; width: 0.7rem; height: 0.72rem; background: #fff; clip-path: polygon(100% 0, 100% 100%, 0 100%); }

.scp-message--outgoing .scp-bubble {
  border-radius: 0.75rem 0.75rem 0.2rem 0.75rem;
  background: #d9fdd3;
}
.scp-message--outgoing .scp-bubble::after { right: -0.38rem; left: auto; background: #d9fdd3; clip-path: polygon(0 0, 100% 100%, 0 100%); }

.scp-bubble--reply { width: min(88%, 16rem); padding: 0.35rem 0.38rem 0.42rem; }
.scp-quote { display: grid; gap: 0.1rem; padding: 0.46rem 0.54rem; border-left: 3px solid #9b654c; border-radius: 0.4rem; background: rgb(255 255 255 / 0.34); }
.scp-quote__author { color: #8b5a43; font-size: 0.78rem; font-weight: 700; line-height: 1.2; }
.scp-quote__title { color: #27343a; font-size: 0.78rem; font-weight: 700; line-height: 1.22; }
.scp-quote__text { color: #3f4b50; font-size: 0.74rem; line-height: 1.3; }
.scp-reply-answer { display: block; padding: 0.44rem 0.42rem 0; color: #111b21; font-size: 0.86rem; font-weight: 500; line-height: 1.3; }
.scp-reply-meta { display: flex; justify-content: flex-end; gap: 0.2rem; padding: 0.06rem 0.25rem 0; color: #667781; font-size: 0.67rem; }
.scp-ticks { color: #667781; letter-spacing: -0.18rem; padding-right: 0.18rem; }

.scp-bubble p { margin: 0; color: #111b21; font-size: 0.85rem; font-weight: 500; line-height: 1.38; }
.scp-time { display: block; margin-top: 0.24rem; color: #667781; font-size: 0.67rem; text-align: right; }

.scp-correction {
  margin-top: 0.5rem;
  padding-top: 0.45rem;
  border-top: 1px solid hsl(158 25% 82%);
  color: hsl(158 62% 27%);
  font-size: 0.68rem;
  font-weight: 650;
}

.scp-correction-card { display: grid; gap: 0.3rem; margin-top: 0.58rem; padding-top: 0.52rem; border-top: 1px solid #e5e7eb; font-size: 0.76rem; line-height: 1.34; }
.scp-correction-card__label { color: #128c62; font-weight: 700; }
.scp-correction-card__original { color: #6b7280; text-decoration: line-through; }
.scp-correction-card__improved { color: #174c3c; font-weight: 650; }

.scp-voice {
  width: min(86%, 15.5rem);
  padding: 0.8rem;
  border-radius: 0.75rem 0.75rem 0.75rem 0.2rem;
  background: hsl(0 0% 100%);
  box-shadow: 0 1px 0.5px hsl(0 0% 0% / 0.13);
}

.scp-voice__play {
  display: inline-block;
  width: 0;
  height: 0;
  margin-right: 0.7rem;
  border-top: 0.48rem solid transparent;
  border-bottom: 0.48rem solid transparent;
  border-left: 0.72rem solid hsl(158 66% 36%);
  vertical-align: middle;
}

.scp-voice__wave { display: inline-flex; height: 1.45rem; align-items: center; gap: 0.14rem; vertical-align: middle; }
.scp-voice__wave i { display: block; width: 0.13rem; height: 40%; border-radius: 999px; background: hsl(158 66% 36%); }
.scp-voice__wave i:nth-child(3n + 1) { height: 78%; }
.scp-voice__wave i:nth-child(2n) { height: 58%; }
.scp-voice__meta { display: flex; justify-content: space-between; margin: 0.25rem 0 0 1.55rem; color: hsl(205 7% 47%); font-size: 0.62rem; }

.scp-composer {
  display: flex;
  min-height: 4rem;
  align-items: center;
  gap: 0.42rem;
  padding: 0.55rem 0.7rem 0.8rem;
  border-top: 1px solid hsl(270 8% 36% / 0.1);
}

.scp-plus, .scp-camera, .scp-mic { display: grid; width: 1.65rem; height: 2.15rem; flex: 0 0 auto; place-items: center; color: hsl(240 5% 12%); }
.scp-plus { font-size: 1.55rem; font-weight: 300; }
.scp-camera svg, .scp-mic svg { width: 1.35rem; height: 1.35rem; }
.scp-input { display: flex; height: 2.15rem; min-width: 0; flex: 1 1 auto; align-items: center; justify-content: space-between; padding: 0 0.52rem 0 0.68rem; border: 1px solid hsl(30 3% 85%); border-radius: 999px; background: hsl(0 0% 100%); }
.scp-input__cursor { width: 1px; height: 1.25rem; background: #0fa47a; }
.scp-sticker { position: relative; width: 1.1rem; height: 1.1rem; border: 1.5px solid currentColor; border-radius: 0.28rem; }
.scp-sticker::after { content: ""; position: absolute; right: 0.08rem; bottom: 0.08rem; width: 0.3rem; height: 0.3rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; border-radius: 0 0 0.18rem; }

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .scp-status, .scp-header, .scp-composer { background: hsl(270 14% 98% / 0.96); }
}

@media (prefers-reduced-motion: no-preference) {
  .scp-message {
    animation: scp-message-in 0.45s ease-out both;
    animation-delay: calc(var(--message-index) * 520ms + 450ms);
  }
}

@media (prefers-reduced-motion: reduce) {
  .scp-typing span { animation: none; }
}

@keyframes scp-message-in {
  from { opacity: 0; transform: translateY(0.5rem); }
}

@keyframes scp-typing-dot {
  0%, 60%, 100% { opacity: 0.45; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-0.08rem); }
}
