:root {
  --ink: #1A2238; --paper: #F6F3EC; --paper2: #ECE6D9; --card: #FBF9F4; --line: #E2DACB;
  --accent: #F0A04B; --accent-ink: #A6520D; --muted: #5A6170; --ok: #2F7D5B;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 17px; line-height: 1.4; }
body { padding: env(safe-area-inset-top) 0 calc(76px + env(safe-area-inset-bottom)); }
.hidden { display: none !important; }
h1 { font-size: 32px; margin: 0 0 8px; letter-spacing: -0.5px; }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--accent-ink); margin: 28px 0 10px; }
.center { max-width: 420px; margin: 18vh auto 0; padding: 0 24px; text-align: center; }
.small { font-size: 14px; color: var(--muted); }
.top { padding: 20px 20px 4px; }
.hello { font-size: 28px; font-weight: 700; margin: 0; }
.sub { margin: 2px 0 0; color: var(--muted); }
.view { padding: 0 20px 24px; max-width: 640px; margin: 0 auto; }

.dictate { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 12px; margin-top: 16px; }
.dictate textarea, .dictate input, .stack input {
  width: 100%; border: 0; background: transparent; font: inherit; color: inherit; resize: none; outline: none; padding: 6px 4px;
}
.stack { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.stack input { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.dictate-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.btn { font: inherit; font-size: 15px; font-weight: 600; border-radius: 999px; padding: 10px 18px; border: 1px solid var(--ink); cursor: pointer; }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn:disabled { opacity: 0.5; }
.btn.rec { background: #B3261E; border-color: #B3261E; color: #fff; }
.view > .btn { display: block; width: 100%; margin-top: 10px; }
.small-btn { padding: 6px 12px; font-size: 13px; }
.row-between { display: flex; justify-content: space-between; align-items: center; }

.reply { background: var(--ink); color: var(--paper); border-radius: 16px; padding: 12px 14px; margin: 12px 0; }

.cards, .plain { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.card .t { font-weight: 600; }
.card .m { font-size: 14px; color: var(--muted); margin-top: 2px; }
.card .draft { margin-top: 8px; padding: 8px 10px; border-left: 3px solid var(--accent); background: var(--paper); border-radius: 6px; font-size: 15px; }
.card .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.card .acts a, .card .acts button { font: inherit; font-size: 13px; font-weight: 600; text-decoration: none; color: var(--ink);
  border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; background: var(--paper2); border-radius: 999px; padding: 2px 8px; margin-left: 6px; }
.empty { color: var(--muted); font-size: 14px; }
.plain li { padding: 6px 0; border-bottom: 1px solid var(--line); }

.list { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 8px 14px; margin-top: 10px; }
.list h3 { margin: 6px 0; font-size: 16px; }
.list label { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.list input { width: 20px; height: 20px; accent-color: var(--ink); }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--ink); padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); }
.tabs button { font: inherit; font-size: 14px; font-weight: 600; color: #C9CFDD; background: none; border: 0; padding: 10px 0; border-radius: 12px; }
.tabs button.active { color: var(--ink); background: var(--accent); }
