:root {
  --bg: #0f1115;
  --surface: #1a1d24;
  --surface-2: #232730;
  --text: #e7e9ee;
  --muted: #9aa0ac;
  --accent: #5b8def;
  --accent-2: #3ad29f;
  --danger: #e5534b;
  --border: #2c313c;
  --radius: 14px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}
header h1 { font-size: 18px; margin: 0; font-weight: 600; }

main { padding: 16px; max-width: 720px; margin: 0 auto; padding-bottom: 96px; }

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

label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }

input[type="text"], input[type="date"], select {
  width: 100%;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
}

button {
  border: none;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  width: 100%;
  margin-top: 12px;
}
button.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
button.danger { background: var(--danger); }
button:disabled { opacity: .5; }

.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

.rec-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.rec-dot {
  width: 12px; height: 12px; border-radius: 50%; background: #fff;
}
.recording .rec-dot { background: var(--danger); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

.status {
  font-size: 14px; color: var(--muted); margin-top: 8px;
  display: flex; align-items: center; gap: 8px;
}
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.badge.processing { background: #3a2f00; color: #ffd84d; }
.badge.done { background: #0c3a2a; color: var(--accent-2); }
.badge.error { background: #3a1715; color: var(--danger); }

.segment {
  border-left: 3px solid var(--accent);
  padding: 8px 12px;
  margin: 10px 0;
  background: var(--surface-2);
  border-radius: 0 10px 10px 0;
}
.segment .speaker { font-weight: 700; font-size: 13px; color: var(--accent); }
.segment .time { font-size: 11px; color: var(--muted); float: right; }
.segment .text { margin-top: 4px; line-height: 1.5; }

.speaker-map { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.speaker-map .lbl { width: 90px; font-weight: 600; }

.hidden { display: none; }
.spinner {
  width: 16px; height: 16px; border: 2px solid var(--muted);
  border-top-color: transparent; border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
