/* Calm colors. Light by default, dark when the phone is in dark mode. */
:root {
  --bg: #f4f1ec;
  --card: #ffffff;
  --text: #2b2f31;
  --muted: #8a8f91;
  --accent: #4f8a7c;
  --line: #e4e0d8;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1f2a2e;
    --card: #28363b;
    --text: #e6e9e7;
    --muted: #8c9a9c;
    --accent: #8fbcb0;
    --line: #34444a;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 18px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  padding: env(safe-area-inset-top) 16px calc(env(safe-area-inset-bottom) + 80px);
  max-width: 640px;
  margin: 0 auto;
}

#add { position: sticky; top: 0; background: var(--bg); padding: 16px 0 8px; z-index: 1; }

#box {
  width: 100%;
  font-size: 20px;
  padding: 16px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--text);
  outline: none;
}
#box:focus { border-color: var(--accent); }

nav { display: flex; gap: 6px; margin: 8px 0 16px; }
nav button {
  flex: 1;
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
}
nav button.on { background: var(--card); color: var(--text); font-weight: 600; }

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

li {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 12px 16px;
  margin-bottom: 8px;
  background: var(--card);
  border-radius: 14px;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: transform .15s, opacity .15s;
}
li .text { flex: 1; word-break: break-word; }
li.done .text { text-decoration: line-through; color: var(--muted); }

li button, .big {
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: var(--bg);
  color: var(--accent);
  font-size: 15px;
}
li button.picked { background: var(--accent); color: var(--card); }

.big {
  width: 100%;
  min-height: 56px;
  background: var(--accent);
  color: var(--card);
  font-size: 18px;
  margin-top: 8px;
}

h2 { font-size: 15px; font-weight: 600; color: var(--muted); margin: 24px 0 8px; }
h2:first-child { margin-top: 0; }

.empty { color: var(--muted); text-align: center; padding: 40px 0; }
.hint { color: var(--muted); font-size: 14px; text-align: center; margin-top: 16px; }

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 24px);
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--card);
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
#toast.show { opacity: 1; }
