:root {
  color-scheme: dark;
  --bg: #12161b;
  --surface: #1a2027;
  --border: #29323c;
  --text: #e7edf3;
  --muted: #8a97a5;
  --accent: #5eead4;
  --accent-text: #0b3d34;
  --danger: #e5484d;
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f6f8fa;
    --surface: #ffffff;
    --border: #d9e0e7;
    --text: #1c2530;
    --muted: #5c6a78;
    --accent: #0d9488;
    --accent-text: #ffffff;
    --danger: #c62a30;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0 auto;
  max-width: 40rem;
  padding: 1rem 1rem 5rem;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}
h1 { font-size: 1.4rem; margin: 0.5rem 0 1rem; }
h2 {
  font-size: 0.85rem; margin: 1.5rem 0 0.5rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.05em;
}
a { color: var(--accent); text-decoration: none; }
.muted { color: var(--muted); font-size: 0.85rem; font-weight: normal; }
.error { color: var(--danger); }

input, select, button {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.55rem 0.7rem;
  max-width: 100%;
}
input[type="text"], input[type="password"] { width: 100%; }
button { cursor: pointer; }
button[type="submit"], .button-link {
  background: var(--accent); color: var(--accent-text);
  border: none; font-weight: 600;
}
.button-link { display: inline-block; padding: 0.55rem 0.9rem; border-radius: 0.5rem; }
button.small { padding: 0.25rem 0.5rem; font-size: 0.8rem; }
button.big { width: 100%; padding: 0.9rem; font-size: 1.1rem; }

.row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin: 0.5rem 0; }
form.capture { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
form.capture input[name="title"] { flex: 1; }
form.inline { display: inline; }

.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.8rem 1rem;
  margin: 0.5rem 0;
  color: var(--text);
}
.card .muted { display: block; margin-top: 0.2rem; }

.todo {
  display: flex; gap: 0.6rem; align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.6rem 0.8rem;
  margin: 0.4rem 0;
}
.todo.done .title { text-decoration: line-through; color: var(--muted); }
.todo-body { flex: 1; min-width: 0; }
.todo .title { display: block; overflow-wrap: anywhere; }
.todo .reason { display: block; }
button.check {
  background: var(--accent); color: var(--accent-text);
  border: none; border-radius: 50%;
  width: 2.1rem; height: 2.1rem; padding: 0;
}
button.drop { background: none; border: none; color: var(--muted); padding: 0.2rem; }

.focus { text-align: center; padding: 2rem 1rem; }
.focus h2 { color: var(--text); text-transform: none; font-size: 1.3rem; letter-spacing: 0; }
.pin-time { color: var(--accent); font-weight: 600; margin: 0.6rem 0 0; }
.day { margin-bottom: 1rem; }
details.move summary { font-size: 0.8rem; color: var(--muted); cursor: pointer; }

.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; justify-content: space-around;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 0.6rem 0 calc(0.6rem + env(safe-area-inset-bottom));
}
.bottom-nav a { color: var(--muted); font-size: 0.85rem; }

.countdown { font-size: 2.4rem; font-weight: 700; margin: 0.4rem 0; font-variant-numeric: tabular-nums; }
.countdown.over { color: var(--danger); }
input.mins { width: 4.5rem; }
.center { justify-content: center; }
