:root {
  --brand: #004cce;         /* Fat Cat blue */
  --brand-dark: #003ba1;
  --bg: #f5f7fb;            /* light app background */
  --surface: #ffffff;
  --surface-2: #eef2f9;
  --border: #dfe4ee;
  --text: #0f1826;
  --text-2: #5b6472;
  --muted: #8a93a3;
  --synced: #1a9d52;
  --waiting: #b7791f;
  --failed: #d64545;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  overscroll-behavior: none;
}
.hidden { display: none !important; }
.screen { min-height: 100dvh; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.center { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px; }
.muted { color: var(--muted); }

/* Login */
.login-logo { width: 108px; height: auto; margin-bottom: 18px; }
.brand-lockup { font-size: 32px; font-weight: 800; letter-spacing: -0.5px; text-align: center; }
.brand { color: var(--text); }
.brand-accent { color: var(--brand); margin-left: 8px; }
.tagline { color: var(--text-2); margin: 10px 0 28px; text-align: center; }
.login-footer { margin-top: 36px; text-align: center; }
.powered { color: var(--brand); font-size: 13px; font-weight: 800; letter-spacing: .3px; text-transform: uppercase; }
.legal { color: var(--muted); font-size: 12px; margin-top: 6px; }
.form { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 12px; }
input, .select, .textarea {
  width: 100%; padding: 14px; border-radius: 12px; background: var(--surface);
  color: var(--text); border: 1px solid var(--border); font-size: 16px;
}
input::placeholder, .textarea::placeholder { color: var(--muted); }
.textarea { min-height: 80px; resize: vertical; }
.error { color: var(--failed); font-size: 14px; min-height: 18px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 68px; }
.pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--brand); font-size: 14px; font-weight: 700; padding: 8px; }

/* Buttons */
.btn { border: none; border-radius: 14px; height: 52px; font-size: 17px; font-weight: 700; color: #fff; }
.btn.primary { background: var(--brand); }
.btn.ghost { background: var(--surface-2); color: var(--text); }
.btn:disabled { opacity: 0.5; }
.link-btn { background: none; border: none; color: var(--brand); font-size: 14px; font-weight: 600; padding: 6px; }

/* Topbar */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; background: var(--surface); border-bottom: 1px solid var(--border); }
.brand-sm { font-weight: 800; font-size: 18px; }
.header-right { display: flex; align-items: center; gap: 10px; }
.chip { font-size: 12px; font-weight: 700; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); padding: 5px 10px; border-radius: 999px; }
.chip.waiting { color: var(--waiting); border-color: #f0d9a8; background: #fdf6e7; }
.chip.failed { color: var(--failed); border-color: #f2c4c4; background: #fdeeee; }
.chip.synced { color: var(--synced); border-color: #bfe6cd; background: #ecf8f1; }

.offline-banner { background: #fdf6e7; color: var(--waiting); font-size: 13px; font-weight: 700; text-align: center; padding: 8px; border-bottom: 1px solid #f0d9a8; }

/* Capture — record is the hero */
.capture { padding: 20px 18px 40px; }
.record-area { display: flex; flex-direction: column; align-items: center; padding: 24px 0 8px; }
.timer { font-size: 44px; font-weight: 800; font-variant-numeric: tabular-nums; margin-bottom: 12px; color: var(--text); }
.wave { width: 320px; max-width: 90%; height: 56px; margin-bottom: 14px; }
.record-btn { width: 132px; height: 132px; border-radius: 50%; background: var(--surface); border: 3px solid var(--border); display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(0,76,206,.15); }
.record-btn .record-dot { width: 84px; height: 84px; border-radius: 50%; background: var(--brand); transition: all .15s; }
.record-btn.recording .record-dot { width: 44px; height: 44px; border-radius: 10px; }
.record-caption { margin-top: 14px; font-weight: 700; font-size: 16px; }
.record-hint { color: var(--muted); font-size: 13px; margin-top: 4px; }
.record-controls { display: flex; gap: 12px; margin-top: 18px; width: 100%; }
.record-controls .btn { flex: 1; }

/* Recordings list, grouped by day */
.recent-head { display: flex; justify-content: space-between; align-items: center; color: var(--text-2); font-size: 13px; font-weight: 700; margin: 24px 0 6px; }
.day-head { color: var(--brand); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; margin: 18px 0 4px; }
.notes-list { list-style: none; padding: 0; margin: 0; }
.note-item { display: flex; align-items: center; gap: 12px; padding: 14px 6px; border-bottom: 1px solid var(--border); }
.note-item .note-main { flex: 1; min-width: 0; }
.note-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-sub { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.note-status { font-size: 11px; font-weight: 700; }
.icon-btn { background: none; border: 1px solid var(--border); border-radius: 10px; color: var(--brand); font-size: 16px; width: 38px; height: 38px; }

/* Sheets */
.sheet { position: fixed; inset: 0; background: rgba(15,24,38,.45); display: flex; align-items: flex-end; z-index: 50; }
.sheet-inner { background: var(--surface); width: 100%; max-height: 88dvh; overflow-y: auto; border-top-left-radius: 20px; border-top-right-radius: 20px; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.fld-label { display: block; color: var(--text-2); font-size: 13px; font-weight: 700; margin: 14px 0 6px; }
.checkbox { display: flex; align-items: center; gap: 8px; margin: 14px 0; font-size: 15px; }
.checkbox input { width: auto; }
.preview { width: 100%; margin: 10px 0; }
.select { appearance: none; }
.date-badge { display: inline-block; background: var(--surface-2); color: var(--text); font-weight: 700; font-size: 14px; padding: 8px 12px; border-radius: 10px; }

/* Install prompt — a quiet card, not an alert */
.install-banner { display: flex; align-items: center; gap: 12px; background: var(--surface); border-bottom: 1px solid var(--border); padding: 10px 14px; }
.install-icon { width: 38px; height: 38px; border-radius: 9px; flex-shrink: 0; }
.install-copy { flex: 1; min-width: 0; }
.install-title { font-weight: 700; font-size: 14px; color: var(--text); }
.install-sub { color: var(--text-2); font-size: 12px; margin-top: 2px; }
.install-btn { background: var(--brand); color: #fff; border: none; border-radius: 10px; padding: 9px 16px; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.install-x { background: none; border: none; color: var(--muted); font-size: 16px; padding: 6px 4px; flex-shrink: 0; }
