:root {
  --bg: #faf8f4; --ink: #1c1b18; --muted: #78736a; --line: #e6e1d7;
  --card: #ffffff; --gold: #a8720a; --gold-soft: #f4ead2;
  --good: #3a7a3a; color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131210; --ink: #e8e4dc; --muted: #8f887c; --line: #2a2721;
    --card: #1b1916; --gold: #e0b04f; --gold-soft: #2e2718; --good: #7dbb7d;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  max-width: 680px; margin: 0 auto; padding: 2.25rem 1.25rem 4rem;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* lock */
.lock { text-align: center; padding-top: 18vh; }
.lock h1 { font-size: 1.6rem; margin-bottom: 0.25rem; }
.lock form { display: flex; gap: 0.5rem; justify-content: center; margin-top: 1.25rem; }
.lock input {
  border: 1px solid var(--line); border-radius: 8px; background: var(--card);
  color: var(--ink); font: inherit; padding: 0.45rem 0.8rem; width: 14rem;
}
.lock-err { color: var(--gold); font-size: 0.9rem; margin-top: 0.8rem; }

.site-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.site-head h1 { font-size: 1.35rem; letter-spacing: -0.01em; }
.dot { color: var(--gold); }
.site-head .day { color: var(--muted); font-size: 0.9rem; font-weight: 600; }

.inspiration {
  color: var(--muted); font-size: 0.95rem; font-style: italic;
  border-left: 3px solid var(--gold); padding-left: 0.85rem;
  margin: 0.75rem 0 1.1rem;
}

.tabs { display: flex; gap: 0.25rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.tabs button {
  background: none; border: none; cursor: pointer; color: var(--muted);
  font: inherit; font-size: 0.9rem; font-weight: 600;
  padding: 0.4rem 0.75rem; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button.active { color: var(--ink); border-bottom-color: var(--gold); }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 1.1rem 1.2rem; margin-bottom: 1.4rem;
}
.card h2 {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin-bottom: 0.75rem; font-weight: 700;
}
.card h2 .when { float: right; font-weight: 500; letter-spacing: 0; text-transform: none; }

textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--ink); font: inherit; font-size: 1rem;
  padding: 0.7rem 0.8rem; resize: none;
}
textarea::placeholder { color: var(--muted); }
.capture-row { display: flex; gap: 0.5rem; margin-top: 0.6rem; align-items: center; }
.hint { color: var(--muted); font-size: 0.8rem; }
.spacer { flex: 1; }
.save {
  background: var(--gold); color: var(--bg); border: none; font: inherit;
  font-size: 0.9rem; font-weight: 700; padding: 0.4rem 1.1rem;
  border-radius: 8px; cursor: pointer;
}
.save:disabled { opacity: 0.5; cursor: default; }

#capture-list { margin-top: 0.9rem; }
#capture-list:empty { margin-top: 0; }
.cap { padding: 0.45rem 0; display: flex; gap: 0.6rem; align-items: baseline; }
.cap + .cap { border-top: 1px solid var(--line); }
.cap .at { color: var(--muted); font-size: 0.8rem; flex: none; min-width: 3rem; }
.cap .txt { overflow-wrap: anywhere; }
.cap.queued .at { color: var(--gold); }

.tag {
  font-size: 0.72rem; font-weight: 700; color: var(--gold);
  background: var(--gold-soft); border: none; font-family: inherit;
  border-radius: 999px; padding: 0.05rem 0.55rem; cursor: pointer; flex: none;
}

.brief p { margin-bottom: 0.8rem; }
.brief p:last-child { margin-bottom: 0; }
.brief .blunt { border-left: 3px solid var(--gold); padding: 0.15rem 0 0.15rem 0.85rem; }
.brief .tally { color: var(--muted); font-size: 0.9rem; }

.todo { display: flex; gap: 0.7rem; align-items: baseline; padding: 0.4rem 0; }
.todo + .todo { border-top: 1px solid var(--line); }
.tick {
  width: 1.5rem; height: 1.5rem; border-radius: 7px; border: 1.5px solid var(--line);
  display: grid; place-items: center; cursor: pointer; flex: none;
  color: transparent; font-size: 0.95rem; background: var(--bg);
  padding: 0; font-family: inherit;
  vertical-align: middle; transform: translateY(0.2rem);
}
.tick.on { background: var(--gold); border-color: var(--gold); color: var(--bg); }
.todo .txt { flex: 1; overflow-wrap: anywhere; }
.todo .age { color: var(--muted); font-size: 0.8rem; flex: none; }
.todo .age.old { color: var(--gold); font-weight: 700; }
.todo.done .txt { color: var(--muted); text-decoration: line-through; }

.datenav { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-bottom: 1rem; }
.datenav button {
  background: none; border: 1px solid var(--line); border-radius: 8px;
  color: var(--muted); font: inherit; cursor: pointer; padding: 0.1rem 0.6rem;
}
.datenav button:disabled { opacity: 0.35; cursor: default; }
.datenav .cur { font-weight: 700; }
.datenav .note { color: var(--muted); font-size: 0.8rem; }

.habit { display: flex; align-items: center; gap: 0.7rem; padding: 0.45rem 0; }
.habit + .habit { border-top: 1px solid var(--line); }
.habit .tick { transform: none; }
.habit .name { flex: 1; }
.habit.done .name { color: var(--muted); }
.week { display: flex; gap: 0.3rem; }
.week i { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--line); display: block; }
.week i.hit { background: var(--gold); }
.streak { color: var(--muted); font-size: 0.8rem; font-weight: 600; min-width: 2.2rem; text-align: right; }

footer {
  color: var(--muted); font-size: 0.8rem; display: flex; gap: 0.4rem;
  justify-content: center; margin-top: 2.5rem;
}
footer .ok { color: var(--good); }
footer .bad { color: var(--gold); }
