/* Chat mockup for the demo page. The page styles it by setting the
   --ph-* / --tg-* variables (light values on :root, dark ones in the theme blocks). */
.phone {
  width: min(100%, var(--ph-width, 360px));
  background: var(--ph-frame, #1a2233);
  border: var(--ph-border, 0);
  border-radius: var(--ph-radius, 46px);
  padding: var(--ph-pad, 12px);
  box-shadow: var(--ph-shadow, 0 30px 60px -28px rgba(18, 26, 43, .55));
}
.screen {
  border-radius: calc(var(--ph-radius, 46px) - var(--ph-pad, 12px));
  overflow: hidden;
  height: var(--ph-height, 620px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  font-family: var(--tg-font, -apple-system, system-ui, "Segoe UI", Roboto, sans-serif);
  color: var(--tg-text);
  background: var(--tg-wall);
}
.tg-head {
  display: flex; align-items: center; gap: 11px;
  padding: 30px 14px 10px;
  background: var(--tg-bar);
  border-bottom: 1px solid var(--tg-rule, rgba(0, 0, 0, .07));
}
.avatar {
  width: 38px; height: 38px; border-radius: var(--avatar-radius, 50%); flex: none;
  background: var(--avatar-bg); color: var(--avatar-fg);
  display: grid; place-items: center;
  font: 800 14px/1 var(--avatar-font, inherit); letter-spacing: -0.02em;
}
.tg-name { font-weight: 600; font-size: 16px; line-height: 1.2; }
.tg-status { font-size: 13.5px; color: var(--tg-meta); line-height: 1.3; }
.tg-status.typing { color: var(--tg-accent); }
.chat {
  display: flex; flex-direction: column; justify-content: flex-end; gap: 8px;
  padding: 12px 10px 10px;
  overflow: hidden;
  background-image: var(--tg-pattern, none);
  background-size: 18px 18px;
}
.msg {
  max-width: 86%;
  padding: 7px 10px 6px;
  border-radius: var(--bubble-radius, 16px);
  font-size: 15px; line-height: 1.38;
  box-shadow: var(--bubble-shadow, 0 1px 1px rgba(0, 0, 0, .08));
  border: var(--bubble-border, 0);
}
.msg.out { align-self: flex-end; background: var(--tg-out); border-bottom-right-radius: 5px; }
.msg.in { align-self: flex-start; background: var(--tg-in); border-bottom-left-radius: 5px; }
.msg.pop { animation: tg-pop .32s cubic-bezier(.2, .9, .3, 1.2) both; }
@keyframes tg-pop { from { opacity: 0; transform: translateY(10px) scale(.97); } }
.fwd { font-size: 13.5px; color: var(--tg-out-meta); margin-bottom: 4px; }
.fwd b { font-weight: 600; }
.voice { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; align-items: center; width: 228px; max-width: 100%; }
.play { width: 40px; height: 40px; border-radius: 50%; background: var(--tg-out-meta); display: grid; place-items: center; }
.play::after { content: ""; margin-left: 3px; border-left: 12px solid var(--tg-out); border-top: 8px solid transparent; border-bottom: 8px solid transparent; }
.wave { display: flex; align-items: center; gap: 2px; height: 24px; }
.wave i { flex: 1; min-width: 2px; border-radius: 2px; background: var(--tg-out-meta); opacity: .55; }
.voice-meta { font-size: 12.5px; color: var(--tg-out-meta); margin-top: 3px; }
.meta { float: right; margin: 6px 0 -3px 10px; font-size: 12px; color: var(--tg-meta); line-height: 1; }
.out .meta { color: var(--tg-out-meta); }
.quote {
  border-left: 3px solid var(--tg-accent);
  background: color-mix(in srgb, var(--tg-accent) 10%, transparent);
  border-radius: 4px 6px 6px 4px;
  padding: 3px 8px 4px; margin-bottom: 5px;
  font-size: 13.5px; line-height: 1.3;
}
.quote b { color: var(--tg-accent); display: block; font-weight: 600; }
.quote span { color: var(--tg-meta); }
.bot-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.bot-text.swap { animation: tg-swap .35s ease both; }
@keyframes tg-swap { from { opacity: .25; } }
.bot-check { display: block; margin-top: 6px; font-size: 13.5px; color: var(--tg-meta); animation: tg-pulse 1.4s ease-in-out infinite; }
@keyframes tg-pulse { 50% { opacity: .45; } }
.fix { color: inherit; border-radius: 4px; background: transparent; animation: tg-fix 2.6s ease-out both; }
@keyframes tg-fix { from, 35% { background: color-mix(in srgb, var(--tg-accent) 32%, transparent); } }
.tg-input { padding: 10px 14px 24px; background: var(--tg-bar); color: var(--tg-meta); font-size: 15px; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  .msg.pop, .bot-text.swap, .bot-check, .fix { animation: none; }
}
