/* JARVIS voice test (DESIGN §23). ULTRON's palette, with JARVIS's blue in place of ULTRON's red. */
:root {
  --bg: #0b0d10;
  --card: #14181d;
  --line: #232a32;
  --text: #e8ecf0;
  --muted: #8a96a3;
  --blue: #4fc3f7;
  --blue-glow: rgba(79, 195, 247, .35);
  --amber: #ffb347;
  --bad: #ff6b6b;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding: calc(12px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
  max-width: 560px; margin: 0 auto;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
.muted { color: var(--muted); font-size: 14px; }
.center { text-align: center; margin-top: 8px; }
.wordmark { font-weight: 800; letter-spacing: .32em; color: var(--blue); text-shadow: 0 0 18px var(--blue-glow); font-size: 32px; }
h2 { font-size: 13px; margin: 0 0 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 12px 0; }

.btn { display: inline-block; font: inherit; font-weight: 600; text-align: center; text-decoration: none; border: 0; border-radius: 10px;
  padding: 12px 14px; background: var(--blue); color: #061018; cursor: pointer; }
.btn.ghost { background: #222a33; color: var(--text); }
.btn.big { width: 100%; padding: 22px; font-size: 20px; box-shadow: 0 0 24px var(--blue-glow); }
.back { display: inline-block; color: var(--muted); text-decoration: none; font-size: 14px; margin-bottom: 4px; }
/* Arrived from the dash's CALL JARVIS: the browser still needs one tap before the mic and speaker open. */
.btn.big.calling { animation: calling 1.6s ease-in-out infinite; }
@keyframes calling { 50% { box-shadow: 0 0 46px var(--blue-glow); transform: scale(1.02); } }
@media (prefers-reduced-motion: reduce) { .btn.big.calling { animation: none; } }
.btn.big.live { background: var(--amber); box-shadow: 0 0 30px rgba(255, 179, 71, .45); }
.btn:disabled { opacity: .45; }

.row { display: flex; gap: 8px; margin-top: 10px; }
.row > * { flex: 1; min-width: 0; }
input[type=text], select, textarea { width: 100%; font: inherit; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
textarea { margin-top: 10px; resize: vertical; }
.check { display: flex; gap: 8px; align-items: center; margin-top: 12px; color: var(--muted); font-size: 14px; }
.slider { display: block; margin-top: 10px; color: var(--muted); font-size: 14px; }
.slider b { color: var(--text); float: right; font-variant-numeric: tabular-nums; }
.slider input { width: 100%; accent-color: var(--blue); }
.interim { min-height: 1.4em; color: var(--muted); font-style: italic; margin-top: 6px; text-align: center; }

#chat { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow: auto; }
#chat:empty::before { content: "Say \"Good morning, Jarvis\" to begin."; color: var(--muted); }
.msg { padding: 10px 12px; border-radius: 12px; max-width: 88%; }
.msg.me { align-self: flex-end; background: #1e2730; }
.msg.him { align-self: flex-start; background: #0f2230; border: 1px solid #16384d; }
.msg .t { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }
.msg.err { border-color: var(--bad); }

.stats div { display: flex; justify-content: space-between; color: var(--muted); font-size: 14px; margin: 4px 0; }
.stats b { color: var(--text); font-variant-numeric: tabular-nums; }
.ok { color: var(--blue); } .bad { color: var(--bad); }
