:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #1c1c1e;
  --muted: #6b6b70;
  --border: #e2e2e0;
  --accent: #2563eb;
  --danger: #dc2626;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161617;
    --surface: #232324;
    --text: #f2f2f3;
    --muted: #a1a1a6;
    --border: #3a3a3c;
    --accent: #5b8cff;
    --danger: #f26d6d;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
}
.app { max-width: 640px; margin: 0 auto; padding: 20px 16px 48px; }
h1 { font-size: 24px; margin: 8px 0 4px; }
h2 { font-size: 16px; margin: 0 0 8px; }
.lead { color: var(--muted); margin: 0 0 20px; }
section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
}
.recorder { text-align: center; }
.ring-wrap { position: relative; width: 160px; height: 160px; margin: 0 auto; }
.ring { width: 160px; height: 160px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 6; }
.ring-bg { stroke: var(--border); }
.ring-fg {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 339.3;
  stroke-dashoffset: 0;
}
.record-btn {
  position: absolute; inset: 18px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 26px;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.record-btn span { font-size: 13px; }
.record-btn.recording { background: var(--danger); color: #fff; border-color: var(--danger); }
.timer { font-variant-numeric: tabular-nums; color: var(--muted); margin: 10px 0 0; }
.status { color: var(--danger); min-height: 1.2em; margin: 6px 0 0; font-size: 14px; }
.transcript { text-align: left; margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.transcript p { margin: 0; white-space: pre-wrap; word-break: break-word; }
textarea, input[type="text"] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  font: inherit;
  background: var(--surface);
  color: var(--text);
}
button.primary {
  background: var(--accent); color: #fff; border: none;
  border-radius: 10px; padding: 10px 16px; font: inherit; cursor: pointer;
}
button.ghost {
  background: none; border: 1px solid var(--border); color: var(--muted);
  border-radius: 10px; padding: 6px 10px; font-size: 13px; cursor: pointer;
}
.text-fallback textarea { margin-bottom: 10px; }
.tasks-head { display: flex; justify-content: space-between; align-items: center; }
.add-form { display: flex; gap: 8px; margin-bottom: 12px; }
.add-form input { flex: 1; }
.task-list, .history-list { list-style: none; margin: 0; padding: 0; }
.task-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 4px; border-top: 1px solid var(--border);
}
.task-item .text { flex: 1; word-break: break-word; }
.task-item.done .text { text-decoration: line-through; color: var(--muted); }
.task-item .due { font-size: 12px; color: var(--accent); white-space: nowrap; }
.task-item button {
  background: none; border: none; cursor: pointer; font-size: 15px; color: var(--muted); padding: 4px;
}
.task-item .del-btn {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 14px;
  white-space: nowrap;
}
button.ghost:disabled { opacity: 0.45; cursor: default; }
.task-item input[type="checkbox"] { width: 22px; height: 22px; flex: none; }
.history-item { padding: 8px 4px; border-top: 1px solid var(--border); font-size: 14px; }
.history-item time { color: var(--muted); font-size: 12px; display: block; }
.empty { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
