:root {
  color-scheme: dark;
  --bg: #0c1020;
  --card: rgba(255,255,255,.08);
  --text: #f5f7ff;
  --muted: #aeb7d4;
  --hot: #ff4d6d;
  --ok: #4ade80;
  --warn: #facc15;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif; background: radial-gradient(circle at top, #252b55 0, var(--bg) 54%); color: var(--text); }
.app { min-height: 100svh; padding: max(22px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom)); display: grid; grid-template-rows: auto auto auto auto 1fr; gap: 18px; max-width: 720px; margin: 0 auto; }
.hero { text-align: center; padding-top: 12px; }
.avatar-wrap { width: 156px; height: 156px; margin: 0 auto 16px; border-radius: 36px; padding: 7px; display: grid; place-items: center; background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(255,194,207,.7), rgba(255,77,109,.32)); box-shadow: 0 0 42px rgba(255,77,109,.45); transition: transform .18s ease, filter .18s ease, box-shadow .18s ease; overflow: hidden; }
.avatar { width: 100%; height: 100%; object-fit: cover; border-radius: 30px; display: block; }
.avatar-wrap[data-mode="listening"] { animation: pulse 1.15s infinite; box-shadow: 0 0 54px rgba(74,222,128,.5); }
.avatar-wrap[data-mode="thinking"] { animation: breathe 1.1s infinite; filter: saturate(.86); }
.avatar-wrap[data-mode="speaking"] { animation: pulse .62s infinite; box-shadow: 0 0 58px rgba(255,77,109,.56); }
.avatar-wrap[data-mode="error"] { filter: grayscale(.35); box-shadow: 0 0 36px rgba(250,204,21,.35); }
.eyebrow { margin: 0 0 4px; color: var(--muted); letter-spacing: .18em; text-transform: uppercase; font-size: 12px; }
h1 { margin: 0; font-size: clamp(34px, 8vw, 58px); line-height: .95; }
.status { color: var(--muted); min-height: 24px; font-size: 16px; }
.controls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.token { grid-column: 1 / -1; width: 100%; border: 1px solid rgba(255,255,255,.12); background: var(--card); color: var(--text); border-radius: 16px; padding: 15px 16px; font-size: 16px; outline: none; }
button { border: 0; border-radius: 18px; padding: 16px 18px; font-size: 17px; font-weight: 750; color: var(--text); }
button:disabled { opacity: .45; }
.primary { background: linear-gradient(135deg, var(--hot), #9b5cff); box-shadow: 0 12px 28px rgba(255,77,109,.22); }
.secondary { background: var(--card); }
.tiny { width: 100%; margin-top: 8px; padding: 8px 9px; border-radius: 12px; background: rgba(255,255,255,.10); color: var(--muted); font-size: 12px; font-weight: 700; }
.latency { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.latency div, .billing { background: var(--card); border: 1px solid rgba(255,255,255,.08); border-radius: 18px; padding: 13px 12px; }
.latency strong { display: block; font-size: 15px; }
.latency span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.cost-card strong { word-break: break-word; }
.billing { color: var(--muted); font-size: 13px; line-height: 1.35; }
.billing strong { color: var(--text); }
.transcript { overflow: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 0 18px; }
.bubble { max-width: 88%; padding: 12px 14px; border-radius: 18px; line-height: 1.35; white-space: pre-wrap; }
.bubble.user { align-self: flex-end; background: var(--hot); }
.bubble.assistant { align-self: flex-start; background: var(--card); border: 1px solid rgba(255,255,255,.08); }
.bubble.cost { align-self: center; max-width: 96%; color: var(--muted); background: rgba(255,255,255,.05); border: 1px dashed rgba(255,255,255,.16); font-size: 12px; padding: 8px 10px; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.055); } }
@keyframes breathe { 0%,100% { transform: scale(.985); } 50% { transform: scale(1.025); } }
@media (max-width: 430px) { .latency { grid-template-columns: repeat(2, 1fr); } .avatar-wrap { width: 138px; height: 138px; } }
@media (display-mode: standalone) { .app { padding-top: max(34px, env(safe-area-inset-top)); } }
