:root {
  --bg: #f6f7fb; --card: #ffffff; --text: #111827; --muted: #6b7280; --line: #e5e7eb;
  --accent: #0E6B5C; --rec: #dc2626; --ok: #059669; --warn: #b45309; --err: #b91c1c;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1115; --card: #181b22; --text: #f3f4f6; --muted: #9ca3af; --line: #2a2f3a;
    --accent: #2FA98E; --rec: #ef4444; --ok: #34d399; --warn: #fbbf24; --err: #f87171; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
#app { max-width: 560px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 18px) 16px calc(env(safe-area-inset-bottom) + 28px); }
header h1 { margin: 0; font-size: 26px; }
.sub { margin: 2px 0 14px; color: var(--muted); font-size: 14px; }
.sub.bad { color: var(--err); }
.hidden { display: none !important; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-top: 14px; }
h2 { font-size: 16px; margin: 0 0 6px; }
.hint { color: var(--muted); font-size: 13px; }
.err { color: var(--err); font-size: 14px; min-height: 1em; }
.lbl { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
textarea { width: 100%; font: inherit; font-size: 16px; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; resize: vertical; }
.btn { display: block; width: 100%; margin-top: 10px; padding: 13px; border: 0; border-radius: 12px;
  font: inherit; font-weight: 600; background: var(--accent); color: #fff; }
.btn:disabled { opacity: .45; }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
.btn.danger { color: var(--err); }

.rec-wrap { display: flex; flex-direction: column; align-items: center; padding: 18px 0 6px; }
.rec { width: 168px; height: 168px; border-radius: 50%; border: 0; background: var(--rec);
  box-shadow: 0 10px 30px rgba(220, 38, 38, .35); display: grid; place-items: center;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.rec .dot { width: 56px; height: 56px; border-radius: 50%; background: #fff; transition: all .15s; }
.rec.on { animation: pulse 1.4s infinite; }
.rec.on .dot { border-radius: 10px; width: 50px; height: 50px; }
.rec:disabled { opacity: .5; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .5); } 70% { box-shadow: 0 0 0 26px rgba(220, 38, 38, 0); } 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); } }
.rec-label { margin-top: 14px; font-weight: 600; }
.rec-time { color: var(--muted); font-variant-numeric: tabular-nums; min-height: 1.4em; }

.row-head { display: flex; justify-content: space-between; align-items: baseline; }
#list { list-style: none; margin: 0; padding: 0; }
#list li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; }
#list li:first-child { border-top: 0; }
.what small { display: block; color: var(--muted); font-size: 12px; }
.st { white-space: nowrap; font-size: 13px; font-weight: 600; align-self: center; }
.st.queued, .st.sending { color: var(--warn); }
.st.sent { color: var(--ok); }
.st.error { color: var(--err); }
.more summary { font-weight: 600; cursor: pointer; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 20px);
  background: #111827; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; max-width: 90vw; }
