:root {
  color-scheme: light dark;
  --bg: #f6f7f7;
  --fg: #16201f;
  --muted: #5b6b69;
  --card: #ffffff;
  --line: #d5dddc;
  --accent: #0f766e;
  --accent-fg: #ffffff;
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1413;
    --fg: #e6eeec;
    --muted: #93a5a2;
    --card: #17201f;
    --line: #2a3735;
    --accent: #2dd4bf;
    --accent-fg: #062a26;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

main {
  max-width: 28rem;
  margin: 0 auto;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1.5rem, env(safe-area-inset-bottom));
}

header { margin-bottom: 1rem; }
h1 { font-size: 1.5rem; margin: 0; }
.muted { color: var(--muted); }
#date { margin: 0.25rem 0 0; }

fieldset {
  border: 0;
  margin: 0 0 1rem;
  padding: 0;
}

legend {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.options {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
}

.options button {
  min-height: 3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--fg);
  font: inherit;
  font-size: 1.125rem;
  touch-action: manipulation;
}

.options button[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
  font-weight: 700;
}

label { display: block; font-weight: 600; margin: 0.5rem 0; }

textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--fg);
  font: inherit;
  resize: vertical;
}

button#save, button.secondary {
  display: block;
  width: 100%;
  min-height: 3rem;
  margin-top: 1rem;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 600;
  touch-action: manipulation;
}

button#save {
  border: 0;
  background: var(--accent);
  color: var(--accent-fg);
}

button.secondary {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
}

button:disabled { opacity: 0.6; }
button:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#status { min-height: 1.5rem; margin-top: 1rem; text-align: center; color: var(--muted); }
.reminder { margin: 1rem 0 0; text-align: center; }
