:root {
  --bg: #0b0b0c;
  --surface: #17171a;
  --text: #f2f2f4;
  --muted: #8a8a94;
  --accent: #3b82f6;
  --danger: #ef4444;
  --record: #ef3b3b;
  --border: #26262c;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  -webkit-tap-highlight-color: transparent; overscroll-behavior: contain; }
#app { min-height: 100vh; min-height: 100dvh; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.view { padding: 20px; max-width: 600px; margin: 0 auto; }
.hidden { display: none !important; }
.error { color: var(--danger); font-size: 14px; }

.signin-inner { display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 80vh; text-align: center; gap: 16px; }
.signin-inner h1 { font-size: 28px; margin: 0; }
.signin-inner p { color: var(--muted); margin: 0; }

.home-header { display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.user-name { font-weight: 600; }
.user-email { font-size: 13px; color: var(--muted); }

.record-main { display: flex; flex-direction: column; align-items: center;
  padding: 40px 0 32px; gap: 12px; }
.record-btn { background: none; border: none; padding: 0; cursor: pointer; }
.record-btn .record-inner {
  display: block; width: 120px; height: 120px; border-radius: 50%;
  background: var(--record); border: 6px solid rgba(239,59,59,0.25);
  transition: transform 0.15s, border-width 0.15s;
}
.record-btn.recording .record-inner {
  border-radius: 14px; width: 60px; height: 60px;
  animation: pulse 1.2s infinite ease-in-out;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.6; } }
.record-time { font-variant-numeric: tabular-nums; font-size: 20px; color: var(--muted); }
.record-btn.recording + .record-time { color: var(--record); }
.warning { font-size: 12px; color: #f59e0b; text-align: center; padding: 8px 12px;
  background: rgba(245,158,11,0.1); border-radius: 8px; max-width: 320px; }
.status { font-size: 13px; color: var(--muted); min-height: 18px; text-align: center; }

.recordings h2 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--muted); margin-bottom: 8px; }
#recordings-list { list-style: none; padding: 0; margin: 0; }
#recordings-list li { padding: 14px 12px; background: var(--surface);
  border-radius: 10px; margin-bottom: 8px; display: flex; justify-content: space-between;
  align-items: center; cursor: pointer; }
.rec-title { font-weight: 500; }
.rec-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.rec-status { font-size: 11px; padding: 3px 8px; border-radius: 999px; }
.rec-status.pending { background: rgba(245,158,11,0.15); color: #f59e0b; }
.rec-status.uploading { background: rgba(59,130,246,0.15); color: var(--accent); }
.rec-status.uploaded { background: rgba(34,197,94,0.15); color: #22c55e; }
.rec-status.failed { background: rgba(239,68,68,0.15); color: var(--danger); }
.rec-status.transcribing { background: rgba(168,85,247,0.15); color: #a855f7; }

.btn-primary { background: var(--text); color: var(--bg); border: none;
  padding: 12px 24px; font-size: 15px; font-weight: 600; border-radius: 10px;
  cursor: pointer; width: 100%; max-width: 320px; }
.btn-primary.danger { background: var(--danger); color: white; }
.btn-ghost { background: transparent; color: var(--muted); border: none;
  padding: 8px 12px; font-size: 13px; cursor: pointer; }
.btn-ghost.danger { color: var(--danger); }

dialog { background: var(--surface); color: var(--text); border: none;
  border-radius: 14px; padding: 20px; max-width: 90vw; width: 420px; }
dialog::backdrop { background: rgba(0,0,0,0.6); }
dialog h3 { margin: 0 0 16px; }
#name-form input { width: 100%; padding: 12px; background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px; color: var(--text);
  font-size: 16px; margin-bottom: 16px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

.playback-header { display: flex; justify-content: space-between; align-items: center; }
#playback-dialog audio { width: 100%; margin: 16px 0; }
.transcript-header { display: flex; justify-content: space-between; align-items: center;
  margin: 12px 0 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.transcript-header h4 { margin: 0; font-size: 14px; }
.transcript { max-height: 220px; overflow-y: auto; font-size: 14px;
  line-height: 1.6; padding: 12px; background: var(--bg); border-radius: 8px; }
.playback-actions { margin-top: 16px; display: flex; justify-content: center; }