:root {
  --paper: #f3efe6;
  --card: #fffdf8;
  --ink: #1c1915;
  --muted: #6e665d;
  --line: #e3dacb;
  --accent: #0e6b62;
  --accent-ink: #f3fffc;
  --danger: #8d2e1e;
  --warn: #8a5a12;
  --shadow: 0 12px 30px rgba(48, 36, 20, 0.05);
  --sans: ui-sans-serif, system-ui, sans-serif;
  --serif: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 10% -10%, rgba(14, 107, 98, 0.08), transparent 60%),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}

main {
  flex: 1;
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding-bottom: 32px;
}

.top, .foot {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding: 36px 0 20px;
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 2.7rem);
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.eyebrow, .hint, .help, .who, .status, .foot p {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.session {
  display: flex;
  align-items: center;
  gap: 12px;
}

.who { margin: 0; font-size: 0.92rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.tabs button, .filters button, .ghost, button {
  font: inherit;
}

.tabs button, .filters button, .ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
}

.tabs button[aria-selected="true"], .filters button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--card);
  border-color: var(--ink);
}

form { display: grid; gap: 8px; }

label {
  font-size: 0.82rem;
  font-weight: 650;
}

input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
}

textarea { resize: vertical; min-height: 76px; }

button[type="submit"], #add {
  justify-self: start;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 650;
}

button:disabled { opacity: 0.55; cursor: wait; }

.hint, .help { margin: 0; font-size: 0.88rem; }

.banner {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8ebe6;
  color: var(--danger);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin: 18px 0 8px;
}

.filters { display: flex; gap: 8px; flex-wrap: wrap; }

.toolbar input { max-width: 260px; }

.row {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
}

.row > div { flex: 1; }

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}

.item.done .title { color: var(--muted); text-decoration: line-through; }

.title { margin: 0; font-weight: 680; }

.notes {
  margin: 4px 0 0;
  white-space: pre-wrap;
  color: var(--ink);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.meta .overdue { color: var(--warn); font-weight: 650; }

.actions { display: flex; gap: 6px; }

.actions button, .edit-actions button {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
  color: var(--ink);
}

.actions .danger { color: var(--danger); }

.check {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 3px;
  accent-color: var(--accent);
}

.edit { grid-column: 1 / -1; display: grid; gap: 8px; }

.edit-actions { display: flex; gap: 8px; }

.status { min-height: 1.2em; margin: 8px 0; }

.foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 0 22px;
  border-top: 1px solid var(--line);
  font-size: 0.86rem;
}

.foot p { margin: 0; }

.foot nav { display: flex; gap: 14px; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .top, .toolbar, .foot, .row, .item { display: flex; flex-direction: column; align-items: stretch; }
  .session { justify-content: space-between; }
  .toolbar input { max-width: none; }
  .actions { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; }
}
