:root {
  --bg: #0b0e13;
  --surface: #141922;
  --surface-2: #1b2230;
  --border: #27303f;
  --text: #e7ecf3;
  --muted: #8b95a7;
  --accent: #3d7bfd;
  --accent-press: #2f63d4;
  --danger: #e5534b;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100%;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px 32px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.topbar h1 {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}

.chips { display: flex; gap: 8px; }

.chip {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
}

.chip.active {
  background: rgba(61, 123, 253, 0.15);
  border-color: var(--accent);
  color: var(--accent);
}

.composer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
}

.composer textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  font-family: inherit;
}

.composer textarea::placeholder { color: #5a6475; }

.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.hint { font-size: 12px; color: var(--muted); }
.hint.listening { color: var(--danger); }

.buttons { display: flex; gap: 8px; }

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.icon-btn.primary:active { background: var(--accent-press); }
.icon-btn.recording { border-color: var(--danger); color: var(--danger); }

.preview {
  margin-top: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}

.preview.hidden { display: none; }

.preview-header {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  margin-bottom: 14px;
}

.title-input {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px dashed transparent;
  outline: none;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  padding: 2px 0;
}

.title-input:focus { border-bottom-color: var(--accent); }

.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.preview-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.preview-grid input,
.preview-grid select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  color-scheme: dark;
  width: 100%;
}

.reminders {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.reminder-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(61, 123, 253, 0.12);
  border: 1px solid rgba(61, 123, 253, 0.4);
  color: #9bbcff;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
}

.reminder-chip button {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  line-height: 1;
}

.reminder-add {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
}

.preview-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.btn {
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  font-family: inherit;
}

.btn.ghost { background: transparent; color: var(--muted); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.accent:active { background: var(--accent-press); }

.recent { margin-top: 28px; }

.recent h2 {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 10px;
}

.recent ul { list-style: none; margin: 0; padding: 0; }

.recent li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.recent li .when { color: var(--muted); white-space: nowrap; }

.recent .empty {
  border: none;
  color: #5a6475;
  font-size: 13px;
}

.footer {
  margin-top: 32px;
  display: flex;
  justify-content: center;
  gap: 10px;
  font-size: 12px;
  color: #5a6475;
}

.footer a {
  color: var(--muted);
  text-decoration: none;
}

.footer a:hover { color: var(--accent); }
