:root {
  font-family: system-ui, sans-serif;
  color: #182634;
  background: #eef4f3;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(180deg, #d7ebe5, #eef4f3 23rem);
}

main {
  width: min(100% - 2rem, 44rem);
  margin: 0 auto;
  padding: clamp(2rem, 9vw, 5rem) 0 3rem;
}

h1, h2, p { margin: 0; }
h1 { font-size: clamp(2.5rem, 7vw, 4rem); letter-spacing: -0.06em; }
h2 { margin-bottom: 1rem; }
#summary { margin: 0.4rem 0 1.5rem; color: #465962; }

.panel, dialog {
  border: 1px solid #ceded9;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 0.75rem 2.5rem #183c2e0d;
  padding: clamp(1rem, 4vw, 2rem);
}

form > label { display: block; margin-bottom: 0.5rem; font-weight: 650; }
.form-row, .task-actions, .dialog-actions { display: flex; gap: 0.5rem; }

input:not([type="checkbox"]) {
  width: 100%;
  min-width: 0;
  border: 1px solid #aebfb9;
  border-radius: 0.5rem;
  padding: 0.65rem 0.75rem;
  font: inherit;
  color: inherit;
}

button {
  flex-shrink: 0;
  min-height: 2.75rem;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  padding: 0.55rem 0.9rem;
  background: #175c49;
  color: #fff;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

button:hover { background: #104536; }
button:disabled { opacity: 0.6; cursor: default; }
:focus-visible { outline: 2px solid #087e66; outline-offset: 3px; }
.secondary { color: #314c47; background: #edf4f1; }
.secondary:hover { background: #dcebe5; }
.delete { color: #94342f; background: #fbefed; }
.delete:hover { background: #f5dedb; }

#tasks { list-style: none; padding: 0; margin: 0; }
#tasks:not(:empty) { margin-top: 1.25rem; }
#tasks li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-top: 1px solid #e1ebe7;
  padding: 0.75rem 0;
}

#tasks li:last-child { padding-bottom: 0; }
.task { display: flex; align-items: center; gap: 0.75rem; min-width: 0; cursor: pointer; }
.task span { overflow-wrap: anywhere; }
.task input { flex: 0 0 auto; width: 1.2rem; height: 1.2rem; margin: 0; accent-color: #175c49; }
.task input:checked + span { color: #50605c; text-decoration: line-through; }
#empty, .error { margin-top: 1rem; }
#empty { border-top: 1px solid #e1ebe7; padding-top: 1rem; color: #465962; }
.error { color: #94342f; }

dialog { width: min(100% - 2rem, 28rem); }
dialog::backdrop { background: #18263480; }
.dialog-actions { justify-content: flex-end; margin-top: 1rem; }

@media (max-width: 32rem) {
  #tasks li { align-items: flex-start; flex-direction: column; }
  .task { min-height: 2rem; }
  .task-actions { padding-left: 1.95rem; }
}
