*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f6f5f2;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --green: #15803d;
  --red: #dc2626;
  --tag-bg: #f1f5f9;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
}

/* ── Layout ── */
.container { max-width: 680px; margin: 0 auto; padding: 0 20px; }

header {
  padding: 18px 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo { font-size: 15px; font-weight: 600; letter-spacing: 0.06em; color: var(--text); text-decoration: none; }
.logo span { color: var(--muted); font-weight: 400; }

nav { display: flex; gap: 20px; }
nav a { font-size: 13px; color: var(--muted); text-decoration: none; transition: color .15s; }
nav a:hover, nav a.active { color: var(--text); }

/* ── Cards ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 16px;
}

.card-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

/* ── The One Thing ── */
.one-thing {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
}

.staged-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
}

.recall-list { list-style: none; }
.recall-list li {
  font-size: 13px;
  color: var(--muted);
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.4;
}
.recall-list li:last-child { border-bottom: none; }
.recall-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  background: var(--tag-bg);
  color: var(--muted);
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 6px;
  text-transform: uppercase;
}

/* ── Empty / loading states ── */
.empty {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 40px 20px;
}

.loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  padding: 32px 0;
}

.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  text-decoration: none;
}

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

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--tag-bg); color: var(--text); }

/* ── Forms ── */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px; letter-spacing: 0.04em; }
.field input, .field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  color: var(--text);
  background: var(--card);
  transition: border-color .15s;
  outline: none;
  font-family: inherit;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 72px; }
.field input[type="date"] { cursor: pointer; }

/* ── Tasks ── */
.task-list { list-style: none; }
.task-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.task-item:last-child { border-bottom: none; }
.task-item.done .task-body { text-decoration: line-through; color: var(--muted); }

.task-check {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 1px;
  appearance: none;
  transition: background .15s, border-color .15s;
}
.task-check:checked {
  background: var(--green);
  border-color: var(--green);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 6l3 3 5-5' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.task-body { flex: 1; font-size: 14px; line-height: 1.4; }
.task-date { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ── Login ── */
.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 20px;
}
.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
}
.login-title { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.login-sub { font-size: 14px; color: var(--muted); margin-bottom: 28px; }

/* ── Flash messages ── */
.flash {
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
}
.flash.error { background: #fef2f2; color: var(--red); border: 1px solid #fecaca; display: block; }
.flash.success { background: #f0fdf4; color: var(--green); border: 1px solid #bbf7d0; display: block; }

/* ── Brief meta ── */
.brief-meta { font-size: 12px; color: var(--muted); margin-bottom: 20px; }
.actions-row { display: flex; gap: 10px; margin-bottom: 24px; flex-wrap: wrap; }
