:root {
  color-scheme: dark;
  --bg: #0f172a;
  --panel: #1e293b;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --danger: #f87171;
  --ok: #4ade80;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}

.view {
  display: none;
  padding: calc(1.25rem + env(safe-area-inset-top)) 1.25rem 1.25rem;
  max-width: 480px;
  margin: 0 auto;
}
.view.active { display: block; }

h1 { font-size: 1.25rem; margin: 0 0 1rem; }

input[type="password"], input[type="text"] {
  width: 100%;
  padding: 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid #334155;
  background: var(--panel);
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

button {
  font-size: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
}

.btn-primary { background: var(--accent); color: #04121f; width: 100%; font-weight: 600; }
.btn-danger { background: var(--danger); color: #250606; }
.btn-secondary { background: var(--panel); color: var(--text); border: 1px solid #334155; }

.error { color: var(--danger); font-size: 0.9rem; min-height: 1.2em; margin-bottom: 0.5rem; }
.ok { color: var(--ok); font-size: 0.9rem; min-height: 1.2em; margin-bottom: 0.5rem; }

#recordBtn {
  display: block;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--danger);
  margin: 2rem auto;
  color: white;
  font-weight: 700;
}
#recordBtn.recording { background: #ef4444; box-shadow: 0 0 0 8px rgba(239,68,68,0.25); }

#recordStatus { text-align: center; color: var(--muted); min-height: 1.2em; }

.note-list { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.note-item {
  background: var(--panel);
  border-radius: 0.5rem;
  padding: 0.85rem 1rem;
  margin-bottom: 0.6rem;
  cursor: pointer;
}
.note-item .title { font-weight: 600; }
.note-item .meta { color: var(--muted); font-size: 0.8rem; margin-top: 0.2rem; }
.status-pending, .status-transcribing { color: var(--accent); }
.status-failed { color: var(--danger); }
.status-done { color: var(--ok); }

.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.topbar button { background: none; color: var(--muted); }

.chip-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.5rem 0; }
.chip {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid #334155;
  color: var(--muted);
  font-size: 0.8rem;
  cursor: pointer;
}
.chip.active { background: var(--accent); color: #04121f; border-color: var(--accent); }

audio { width: 100%; margin: 1rem 0; }
.transcript { white-space: pre-wrap; line-height: 1.5; background: var(--panel); padding: 1rem; border-radius: 0.5rem; }
.summary { white-space: pre-wrap; line-height: 1.5; background: #14532d33; border: 1px solid #14532d; padding: 1rem; border-radius: 0.5rem; margin-top: 1rem; }
