:root {
  --bg: #f6f5f2;
  --card: #fff;
  --text: #222;
  --muted: #777;
  --line: #e3e1dc;
  --accent: #c8553d;
  --danger: #b3261e;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1b1d;
    --card: #26262a;
    --text: #eee;
    --muted: #9a9aa0;
    --line: #3a3a40;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  line-height: 1.6;
}

[hidden] { display: none !important; }

header {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.tabs { display: flex; max-width: 800px; margin: 0 auto; }

.tab {
  flex: 1;
  padding: 14px;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 16px;
  border-bottom: 3px solid transparent;
  cursor: pointer;
}

.tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }

main { max-width: 800px; margin: 0 auto; padding: 16px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

h1, h2 { margin: 0 0 8px; font-size: 20px; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--danger); }

button, .button {
  font: inherit;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.danger { color: var(--danger); }
button.link { border: none; background: none; padding: 4px 0; color: var(--accent); }
button:disabled { opacity: 0.5; cursor: default; }

input {
  font: inherit;
  width: 100%;
  padding: 10px;
  margin: 4px 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}

.login-card { max-width: 360px; margin: 15vh auto 0; }
.login-card button { width: 100%; }

.recorder { text-align: center; }
.rec-time { font-size: 48px; font-variant-numeric: tabular-nums; letter-spacing: 1px; }

.meter { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin: 8px auto 20px; max-width: 320px; }
.meter-bar { height: 100%; width: 0; background: var(--accent); transition: width 0.1s linear; }

.rec-button {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 4px solid var(--line);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.rec-button span { width: 60px; height: 60px; border-radius: 50%; background: var(--accent); transition: all 0.2s; }
.rec-button.recording span { width: 32px; height: 32px; border-radius: 6px; }

.rec-controls { display: flex; justify-content: center; align-items: center; gap: 16px; }
.pause-button { min-width: 96px; }
.badge.paused { background: #d9a400; color: #fff; }

.transcript p.pause-mark { color: var(--muted); font-size: 13px; text-align: center; margin: 12px 0; }

.transcript { margin-top: 12px; }
.transcript p { margin: 0 0 8px; }
.transcript time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; margin-right: 8px; }

.rec-list { list-style: none; margin: 0; padding: 0; }
.rec-list li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.rec-list .title { font-weight: 600; }

.badge { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--line); white-space: nowrap; }
.badge.recording { background: var(--accent); color: #fff; }
.badge.error { background: var(--danger); color: #fff; }

.detail-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
audio { width: 100%; margin-top: 8px; }
