:root {
  color-scheme: dark;
  --bg: #0f1419;
  --card: #18202a;
  --text: #e8edf2;
  --muted: #8b98a5;
  --accent: #4fb3a9;
  --accent-2: #7fd1c7;
  --danger: #e5675f;
  --warn: #e0b45a;
  --radius: 18px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

main {
  max-width: 34rem;
  margin: 0 auto;
  padding: max(1rem, env(safe-area-inset-top)) 1.25rem max(1.5rem, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

header { display: flex; align-items: center; justify-content: space-between; }
h1 { font-size: 1.4rem; margin: .25rem 0 1rem; letter-spacing: .02em; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
p { line-height: 1.5; }
section { display: flex; flex-direction: column; flex: 1; }
section[hidden] { display: none; }

.muted, .hint { color: var(--muted); }
.hint { text-align: center; font-size: .95rem; }

.status { min-height: 1.5rem; margin: 0 0 .5rem; font-size: .95rem; }
.status.ok { color: var(--accent-2); }
.status.warn { color: var(--warn); }
.status.error { color: var(--danger); }

button { font: inherit; cursor: pointer; }
button.primary {
  margin-top: auto;
  padding: 1rem 1.25rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: #06201d;
  font-weight: 600;
}
button.primary:disabled { opacity: .45; cursor: not-allowed; }
button.link { background: none; border: 0; color: var(--muted); text-decoration: underline; }

.check { display: flex; gap: .6rem; align-items: flex-start; margin: .5rem 0 1.25rem; line-height: 1.4; }
.check input { width: 1.25rem; height: 1.25rem; margin-top: .1rem; accent-color: var(--accent); }

blockquote {
  margin: .5rem 0 auto;
  padding: 1.25rem;
  background: var(--card);
  border-radius: var(--radius);
  font-size: 1.15rem;
  line-height: 1.55;
}

.log { list-style: none; padding: 0; margin: 0 0 1rem; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: .6rem; }
.log li { padding: .75rem 1rem; border-radius: var(--radius); max-width: 85%; line-height: 1.45; }
.log li small { display: block; color: var(--muted); font-size: .75rem; margin-top: .3rem; }
.log li.me { align-self: flex-end; background: #234; }
.log li.me.other { background: #3a2424; }
.log li.agent { align-self: flex-start; background: var(--card); }

.mic {
  align-self: center;
  width: 6.5rem;
  height: 6.5rem;
  margin: 1.25rem 0 .75rem;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(79, 179, 169, .5);
  display: grid;
  place-items: center;
  transition: transform .15s ease, background .2s ease;
}
.mic:active { transform: scale(.96); }
.mic.recording { background: var(--danger); animation: pulse 1.4s infinite; }
.mic.busy { background: #2c3a46; animation: none; }

.mic-icon {
  width: 1.6rem;
  height: 2.6rem;
  border: .32rem solid #06201d;
  border-radius: 1rem;
  position: relative;
}
.mic.recording .mic-icon { border-color: #fff; }
.mic.busy .mic-icon { border-color: var(--muted); }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(229, 103, 95, .55); }
  70% { box-shadow: 0 0 0 1.4rem rgba(229, 103, 95, 0); }
  100% { box-shadow: 0 0 0 0 rgba(229, 103, 95, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .mic.recording { animation: none; }
}
