:root {
  color-scheme: dark;
  --bg: #10120f;
  --surface: #181b17;
  --surface-2: #20241e;
  --line: #30372d;
  --text: #f0f2ec;
  --muted: #a6aea0;
  --accent: #d7ff72;
  --danger: #ff8e78;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 80% -20%, #27301e 0, transparent 35rem), var(--bg); }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.topbar {
  height: 4.5rem;
  padding: 0 max(1.25rem, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.brand { color: var(--text); text-decoration: none; display: flex; align-items: center; gap: .7rem; font-weight: 760; }
.brand-mark { width: 2rem; height: 2rem; display: grid; place-items: center; border: 1px solid var(--accent); border-radius: .65rem; color: var(--accent); }
.account { display: flex; align-items: center; gap: 1rem; color: var(--muted); font-size: .85rem; }
.quiet-link { color: var(--text); text-underline-offset: .2rem; }

main { width: min(68rem, calc(100% - 2rem)); margin: 0 auto; padding: 4.5rem 0 7rem; }
.hero { max-width: 40rem; margin-bottom: 2.2rem; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2.3rem, 7vw, 4.8rem); letter-spacing: -.055em; line-height: .98; margin-bottom: 1rem; }
h2 { letter-spacing: -.025em; }
.eyebrow, .card-kicker { color: var(--accent); text-transform: uppercase; letter-spacing: .13em; font-size: .72rem; font-weight: 800; }
.subtle { color: var(--muted); line-height: 1.55; }

.login-card { width: min(38rem, 100%); margin: 8vh auto; padding: clamp(1.6rem, 6vw, 3.5rem); background: rgba(24,27,23,.92); border: 1px solid var(--line); border-radius: 1.5rem; }
.login-card p:not(.eyebrow) { color: var(--muted); line-height: 1.65; margin-bottom: 2rem; }

.capture-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.capture-card, .draft-panel, .history { background: rgba(24,27,23,.88); border: 1px solid var(--line); border-radius: 1.25rem; }
.capture-card { min-height: 25rem; padding: 1.5rem; display: flex; flex-direction: column; justify-content: space-between; gap: 1.25rem; }
.record-zone { display: grid; justify-items: center; gap: 1rem; }
.record-button { width: 7.5rem; height: 7.5rem; border-radius: 50%; border: 1px solid #56604d; background: #20251d; cursor: pointer; transition: transform .15s, border-color .15s; }
.record-button:hover { transform: scale(1.02); border-color: var(--accent); }
.record-button.is-recording { animation: pulse 1.5s infinite; }
.record-dot { display: inline-block; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--danger); }
.is-recording .record-dot { border-radius: .45rem; }
@keyframes pulse { 50% { box-shadow: 0 0 0 1rem rgba(255,142,120,.05); } }

textarea, input[type="text"] { width: 100%; color: var(--text); background: #11130f; border: 1px solid var(--line); border-radius: .8rem; padding: 1rem; outline: none; }
textarea { resize: vertical; min-height: 10rem; line-height: 1.5; }
textarea:focus, input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(215,255,114,.08); }
.primary-button, .secondary-button, .quiet-button { border-radius: .75rem; padding: .8rem 1.1rem; font-weight: 760; cursor: pointer; text-align: center; text-decoration: none; }
.primary-button { display: inline-block; color: #11130f; background: var(--accent); border: 1px solid var(--accent); }
.secondary-button { color: var(--text); background: var(--surface-2); border: 1px solid var(--line); }
.quiet-button { color: var(--muted); background: transparent; border: 1px solid var(--line); }
button:disabled { opacity: .45; cursor: wait; }
.file-label, .quiet-file { display: block; cursor: pointer; }
.quiet-file { text-align: center; color: var(--muted); font-size: .85rem; text-decoration: underline; text-underline-offset: .2rem; }

.draft-panel { margin-top: 1rem; padding: 1.5rem; display: grid; grid-template-columns: 1fr minmax(15rem, .7fr); gap: 1rem 2rem; align-items: end; }
.draft-panel[hidden] { display: none; }
.draft-panel label span { display: block; color: var(--muted); font-size: .8rem; margin-bottom: .45rem; }
.draft-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: .65rem; }
.message { min-height: 1.5rem; color: var(--accent); margin: 1.2rem .2rem; }
.message.is-error { color: var(--danger); }

.history { margin-top: 3rem; padding: 1.5rem; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.notes-list { display: grid; gap: .6rem; }
.note-card { display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center; padding: 1rem; background: #121510; border: 1px solid #272d24; border-radius: .9rem; }
.note-icon { width: 2.5rem; height: 2.5rem; display: grid; place-items: center; color: var(--accent); background: #23291e; border-radius: .7rem; font-weight: 800; }
.note-copy h3 { font-size: .98rem; margin-bottom: .25rem; overflow-wrap: anywhere; }
.note-meta { color: var(--muted); font-size: .78rem; margin-bottom: 0; }
.status-pill { color: var(--accent); background: rgba(215,255,114,.08); border-radius: 99rem; padding: .35rem .55rem; font-size: .72rem; }
.status-pill.is-rejected { color: var(--danger); background: rgba(255,142,120,.08); }
.empty-state { color: var(--muted); text-align: center; padding: 3rem 1rem 2rem; }

[hidden] { display: none !important; }
@media (max-width: 720px) {
  main { padding-top: 2.5rem; }
  .capture-grid { grid-template-columns: 1fr; }
  .capture-card { min-height: 22rem; }
  .draft-panel { grid-template-columns: 1fr; }
  .draft-actions { grid-column: auto; }
  .account span { display: none; }
  .note-card { grid-template-columns: auto 1fr; }
  .status-pill { grid-column: 2; justify-self: start; }
}
