:root {
  color-scheme: light;
  font-family: system-ui, sans-serif;
  line-height: 1.5;
  color: #182a27;
  background: #f3f5f0;
  --muted: #475b55;
  --border: #c8d2cb;
  --accent: #155849;
  --accent-soft: #def0e8;
  --danger: #8c2b2b;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body, h1, h2, h3, p {
  margin: 0;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid #2959bd;
  outline-offset: 3px;
}

.container {
  width: min(100% - 2rem, 70rem);
  margin-inline: auto;
}

.site-header {
  padding-block: clamp(1.25rem, 5vw, 2.5rem);
  color: #f5faf6;
  background: #143d34;
}

.site-header h1 {
  font-size: clamp(1.3rem, 4vw, 2.25rem);
  line-height: 1.2;
  letter-spacing: 0.025em;
}

main {
  padding-block: clamp(1rem, 4vw, 2.5rem) 2.5rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  align-items: start;
  gap: 1rem;
}

.panel {
  padding: clamp(1rem, 3vw, 1.75rem);
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: white;
}

.storage-panel {
  margin-bottom: 1rem;
}

.storage-panel p {
  color: var(--muted);
}

.storage-panel .actions, #storage-help {
  margin-top: 0.75rem;
}

.storage-feedback:not(:empty) {
  margin-bottom: 1rem;
  color: var(--muted);
}

h2 {
  font-size: 1.35rem;
  line-height: 1.25;
}

.form-panel h2 {
  margin-bottom: 1.25rem;
}

.field {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

label {
  font-weight: 650;
}

.optional, .task-count, .task-description, .empty-state {
  color: var(--muted);
}

.optional {
  font-size: 0.875rem;
  font-weight: 400;
}

input, textarea, button {
  font: inherit;
}

input, textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid #748980;
  border-radius: 0.5rem;
  color: inherit;
  background: white;
}

textarea {
  resize: vertical;
}

[aria-invalid="true"] {
  border-color: var(--danger);
}

.field-error, .button-danger {
  color: var(--danger);
}

.field-error, .task-count, .task-state {
  font-size: 0.875rem;
}

.actions, .filters, .list-header, .task-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.button {
  min-height: 2.75rem;
  max-width: 100%;
  padding: 0.4rem 0.8rem;
  border: 1px solid #748980;
  border-radius: 0.5rem;
  color: inherit;
  background: white;
  font-weight: 600;
  cursor: pointer;
}

.button:hover {
  background: #eef2ee;
}

.button-primary, .button-primary:hover {
  border-color: var(--accent);
  color: white;
  background: var(--accent);
}

.button-primary:hover {
  background: #0c493b;
}

.button[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.list-header, .task-header {
  justify-content: space-between;
}

.filters {
  margin-block: 1rem;
}

.empty-state {
  padding: 1rem;
  border: 1px dashed #748980;
  border-radius: 0.65rem;
  background: #f6f8f5;
}

.task-list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.task {
  display: grid;
  gap: 0.65rem;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
}

.task h3, .task-description {
  overflow-wrap: anywhere;
}

.task h3 {
  min-width: 0;
  font-size: 1.05rem;
}

.task-description {
  white-space: pre-wrap;
}

.task-state {
  padding: 0.15rem 0.5rem;
  border-radius: 1rem;
  color: #3f554e;
  background: #edf1ed;
}

.task-state.completed {
  color: var(--accent);
  background: var(--accent-soft);
}

.notice {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid #a57832;
  border-radius: 0.65rem;
  color: #64420c;
  background: #fff3dc;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 46rem) {
  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }
}
