:root {
  --bg: #101418;
  --surface: #171d23;
  --line: #26313a;
  --text: #e6edf3;
  --muted: #8b9aa7;
  --accent: #5eead4;
  --warn: #fbbf24;
  --error: #f87171;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f9fb;
    --surface: #ffffff;
    --line: #dfe6ec;
    --text: #16202a;
    --muted: #5b6874;
    --accent: #0f766e;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: env(safe-area-inset-top) 1rem calc(1rem + env(safe-area-inset-bottom));
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  max-width: 42rem;
  margin-inline: auto;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

h1 { font-size: 1.1rem; margin: 0; letter-spacing: 0.02em; }
h2 { font-size: 0.8rem; text-transform: uppercase; color: var(--muted); letter-spacing: 0.08em; }

.pill {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.pill[data-tone="ok"] { color: var(--accent); border-color: var(--accent); }
.pill[data-tone="warn"] { color: var(--warn); border-color: var(--warn); }

.talk {
  width: 100%;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  color: inherit;
  font-size: 1rem;
  cursor: pointer;
}
.talk .dot {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: var(--accent);
  transition: transform 0.15s ease;
}
.talk.recording .dot { animation: pulse 1.2s ease-in-out infinite; background: var(--error); }
.talk.recording .label::after { content: " · recording"; }

@keyframes pulse {
  50% { transform: scale(1.12); opacity: 0.75; }
}
@media (prefers-reduced-motion: reduce) {
  .talk.recording .dot { animation: none; }
}

.status { color: var(--muted); font-size: 0.875rem; min-height: 1.5rem; }
.status[data-tone="ok"] { color: var(--accent); }
.status[data-tone="warn"] { color: var(--warn); }
.status[data-tone="error"] { color: var(--error); }

textarea {
  width: 100%;
  padding: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  color: inherit;
  font: inherit;
  resize: vertical;
}

.actions { display: flex; gap: 0.5rem; margin: 0.75rem 0; flex-wrap: wrap; }

button, select {
  padding: 0.5rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
button:disabled { opacity: 0.45; cursor: default; }

.offline { border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1rem; }
.hint { color: var(--muted); font-size: 0.8rem; margin: 0.4rem 0 0; }

.feed ul { list-style: none; padding: 0; margin: 0; }
.row {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.row .meta { font-size: 0.72rem; color: var(--muted); }
.row.ambient .text { color: var(--muted); }
.row .text { overflow-wrap: anywhere; }
