:root {
  color-scheme: light;
  --paper: #f8f5ed;
  --ink: #343b35;
  --green: #304a38;
  --muted: #546554;
  --line: #deded2;
  --selected: #e3ebdf;
  font-family: system-ui, sans-serif;
  background: #efede3;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; }
main {
  max-width: 540px;
  min-height: 100dvh;
  margin: auto;
  background: var(--paper);
  padding: env(safe-area-inset-top) max(16px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
h1, h2, p, figure { margin: 0; }
h1, h2 { font-family: Georgia, serif; font-weight: normal; color: var(--green); }
button, input, summary { font: inherit; }
button, summary { cursor: pointer; }
button {
  min-height: 44px;
  color: var(--green);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 7px;
}
:focus-visible { outline: 2px solid #41684a; outline-offset: 2px; }
.masthead {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 17px 2px 14px;
}
h1 { font-size: clamp(24px, 7vw, 34px); }
.masthead p { margin-top: 3px; font-size: 12px; letter-spacing: .055em; color: var(--muted); }
summary { min-height: 44px; padding: 13px 5px; font-size: 13px; color: var(--muted); }
.backup-panel {
  position: absolute;
  right: 0;
  z-index: 1;
  display: grid;
  gap: 5px;
  padding: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 3px 12px #3445331c;
}
.backup-panel button { padding-inline: 10px; }
figure {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7edda;
}
figure img { display: block; width: 100%; height: min(21svh, 175px); object-fit: cover; }
figcaption { padding: 6px 10px; color: var(--muted); font: italic 14px Georgia, serif; text-align: center; background: var(--paper); }
.calendar { padding: 12px 0; }
.month-bar { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.month-bar h2 { font-size: clamp(23px, 7vw, 32px); text-align: center; }
.arrow { width: 44px; font-size: 26px; background: transparent; border-color: transparent; }
.week, .days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); text-align: center; }
.week { padding: 7px 0 4px; color: var(--muted); font-size: 12px; }
.day { position: relative; border-color: transparent; padding: 0; background: transparent; font-variant-numeric: tabular-nums; }
.day[aria-pressed="true"] { background: var(--selected); border-color: #b5c6af; font-weight: 650; }
.day[aria-current="date"] span { text-decoration: underline; text-underline-offset: 4px; }
.day.has-tasks::after { content: ""; position: absolute; bottom: 5px; left: calc(50% - 2px); width: 4px; height: 4px; border-radius: 50%; background: #527757; }
.tasks { border-top: 1px solid var(--line); padding-top: 14px; }
.task-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 8px; }
.task-heading h2 { font-size: 22px; }
#count, #empty, #status { color: var(--muted); font-size: 13px; }
#empty { margin-top: 12px; font: italic 16px Georgia, serif; }
#tasks { list-style: none; padding: 0; margin: 6px 0; }
#tasks li { display: flex; align-items: center; gap: 2px; border-bottom: 1px solid var(--line); }
.task-label { display: flex; align-items: center; flex: 1; min-width: 0; overflow-wrap: anywhere; padding-right: 4px; }
.check { display: grid; place-items: center; width: 44px; min-height: 44px; flex: none; }
.check input { width: 18px; height: 18px; accent-color: #527757; }
.completed .task-text { text-decoration: line-through; color: var(--muted); }
.task-action { border-color: transparent; padding: 0 6px; min-width: 44px; font-size: 12px; }
#add-form { display: flex; gap: 8px; padding-top: 7px; }
#task-input {
  min-width: 0;
  min-height: 44px;
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fffcf6;
  color: var(--ink);
}
#add-form button { padding: 0 16px; background: #dce7d9; border-color: #b8c8b3; }
#status { margin-top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (hover: hover) {
  button:hover { border-color: #95aa91; }
}
