:root {
  --primary: #1e3a8a; --on-primary: #ffffff;
  --surface: #f7f8fb; --card: #ffffff; --outline: #d5d9e3;
  --text: #1b1f27; --muted: #6b7280;
  --ok: #16a34a; --warn: #d97706; --error: #dc2626;
  --radius: 14px; --shadow-1: 0 1px 3px rgba(20, 30, 60, .12);
  font-family: system-ui, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; margin: 0; }
body { background: var(--surface); color: var(--text); min-height: 100vh; }
.hidden { display: none !important; }
.view { max-width: 480px; margin: 0 auto; padding: 16px; }
.card { background: var(--card); border: 1px solid var(--outline);
        border-radius: var(--radius); box-shadow: var(--shadow-1);
        padding: 14px; margin-bottom: 12px; }
button { border: 0; border-radius: var(--radius); padding: 12px 18px;
         font-size: 1rem; cursor: pointer; background: var(--primary);
         color: var(--on-primary); }
button.secondary { background: #e8ecf5; color: var(--primary); }
input { width: 100%; padding: 12px; font-size: 1.1rem; border-radius: 10px;
        border: 1px solid var(--outline); }
.topbar { display: flex; justify-content: space-between; align-items: center;
          padding: 12px 16px; background: var(--primary); color: var(--on-primary); }
.badge { background: var(--warn); color: #fff; border-radius: 999px;
         padding: 2px 9px; font-size: .85rem; font-weight: 700; }
.chip { display: inline-block; border-radius: 999px; padding: 2px 10px;
        font-size: .8rem; font-weight: 600; }
.chip.ok { background: #dcfce7; color: var(--ok); }
.chip.warn { background: #fef3c7; color: var(--warn); }
.chip.err { background: #fee2e2; color: var(--error); }
.chip.pend { background: #e8ecf5; color: var(--muted); }
#recordBtn { width: 170px; height: 170px; border-radius: 50%; font-size: 1.25rem;
             display: block; margin: 28px auto 10px; box-shadow: var(--shadow-1); }
#recordBtn.recording { background: var(--error); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { transform: scale(1.045); } }
#timer { text-align: center; font-size: 1.6rem; font-variant-numeric: tabular-nums; }
#timer.warning { color: var(--error); font-weight: 700; }
#viz { display: flex; gap: 3px; height: 28px; align-items: flex-end;
       justify-content: center; margin: 10px 0; }
#viz .bar { width: 6px; min-height: 3px; background: var(--primary);
            border-radius: 3px; transition: height 60ms linear; }
.hint { text-align: center; color: var(--muted); margin-top: 8px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
         background: var(--ok); color: #fff; padding: 12px 22px;
         border-radius: 999px; box-shadow: var(--shadow-1); z-index: 50; }
.toast.error { background: var(--error); }
.note-meta { color: var(--muted); font-size: .85rem; margin-bottom: 6px; }
.fixup { border-left: 4px solid var(--warn); }
.row { display: flex; gap: 8px; margin-top: 8px; }
.row > * { flex: 1; }
audio { width: 100%; margin-top: 8px; }
.sum-label { font-size: .72rem; text-transform: uppercase; color: var(--muted); margin-top: 8px; }
.sum-text { white-space: pre-wrap; font-size: .95rem; }
