/* BakBak — dark, mobile-first */
:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel2: #1e222b;
  --line: #2a2f3a;
  --text: #e8eaf0;
  --muted: #9aa3b2;
  --accent: #e11d48;      /* record rose */
  --accent-soft: #fb7185;
  --ok: #34d399;
  --warn: #fbbf24;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  min-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: var(--accent-soft); text-decoration: none; }

/* header */
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: rgba(15,17,21,.92); backdrop-filter: blur(8px); z-index: 5;
}
header .brand { font-weight: 800; font-size: 18px; color: var(--text); }
header nav { display: flex; gap: 6px; }
header nav a {
  color: var(--muted); font-size: 14px; padding: 7px 10px; border-radius: 10px;
}
header nav a.on { color: var(--text); background: var(--panel2); }

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

/* generic bits */
.card {
  display: block; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; color: var(--text);
}
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
button, .btn {
  font: inherit; color: var(--text); background: var(--panel2);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 16px; cursor: pointer; min-height: 44px;
}
button:active { transform: scale(.98); }
button.primary { background: var(--accent); border-color: var(--accent); font-weight: 700; }
button.ghost { background: transparent; }
button.danger { color: #fda4af; border-color: #7f1d1d; }
button:disabled { opacity: .5; cursor: default; }
input[type=text], input[type=password], input[type=number], textarea, select {
  font: inherit; color: var(--text); background: var(--panel2);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 14px; width: 100%;
}
textarea { min-height: 200px; resize: vertical; line-height: 1.6; }
label { display: block; margin: 18px 0 6px; font-weight: 600; font-size: 14px; }
label .hint { font-weight: 400; color: var(--muted); }

/* segmented mode toggle */
.seg { display: flex; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.seg button {
  flex: 1; border: 0; background: transparent; border-radius: 10px; min-height: 40px; color: var(--muted);
}
.seg button.on { background: var(--panel); color: var(--text); font-weight: 700; border: 1px solid var(--line); }

/* chips */
.chip {
  display: inline-block; padding: 5px 12px; border-radius: 999px;
  background: var(--panel2); border: 1px solid var(--line); color: var(--muted);
  font-size: 13px; cursor: pointer;
}
.chip.on { color: var(--text); border-color: var(--accent); }

/* capture screen */
.capture { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 8px; }
.mic {
  width: 108px; height: 108px; border-radius: 50%;
  background: var(--accent); border: 0; font-size: 44px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 0 rgba(225,29,72,.45);
  transition: box-shadow .2s;
}
.mic.rec { animation: pulse 1.6s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(225,29,72,.45); }
  70% { box-shadow: 0 0 0 26px rgba(225,29,72,0); }
  100% { box-shadow: 0 0 0 0 rgba(225,29,72,0); }
}
.timer { font-variant-numeric: tabular-nums; font-size: 28px; font-weight: 700; }
.meter { width: 200px; height: 8px; border-radius: 6px; background: var(--panel2); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--ok); transition: width 60ms linear; }
.status-line { min-height: 22px; color: var(--muted); text-align: center; }

.transcript {
  width: 100%; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; min-height: 120px;
  white-space: pre-wrap; line-height: 1.6;
}
.transcript .interim { color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; width: 100%; }
.actions button { flex: 1 1 auto; }

/* note cards */
.note-card { margin-bottom: 10px; }
.nc-top { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.nc-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nc-snippet { color: var(--muted); font-size: 14px; margin: 4px 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.nc-meta { color: var(--muted); font-size: 12.5px; }
.badge { font-size: 11.5px; padding: 3px 9px; border-radius: 999px; white-space: nowrap; font-weight: 600; }
.badge.pending { background: #3b2f10; color: var(--warn); }
.badge.error { background: #3d141d; color: #fda4af; }

.section-title { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 0 10px; }
.section-title h2 { font-size: 15px; margin: 0; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }

/* editor */
.editor input.title { font-size: 18px; font-weight: 700; }
.editor audio { width: 100%; margin-top: 10px; }

/* toast */
#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: #262b35; color: var(--text); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 18px; opacity: 0; pointer-events: none;
  transition: all .25s; z-index: 50; max-width: 90vw; text-align: center; font-size: 14.5px;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#toast a { color: inherit; font-weight: 700; text-decoration: underline; }

.spacer { height: 24px; }
