:root {
  color-scheme: light;
  --bg: #f7f8f4;
  --panel: #ffffff;
  --ink: #17201c;
  --muted: #68746f;
  --line: #dce3dd;
  --accent: #2f6f5e;
  --accent-strong: #1f5748;
  --danger: #a13f3f;
  --shadow: 0 16px 40px rgba(24, 35, 30, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(47, 111, 94, 0.10), rgba(247, 248, 244, 0) 280px),
    var(--bg);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(47, 111, 94, 0.28);
  outline-offset: 2px;
}

.shell {
  width: min(720px, calc(100% - 28px));
  margin: 0 auto;
  padding: 32px 0;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 8vw, 3.5rem);
  line-height: 1;
  letter-spacing: 0;
}

.count {
  flex: 0 0 auto;
  margin: 0 0 4px;
  color: var(--muted);
  font-weight: 700;
}

.add-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.add-form input {
  min-width: 0;
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 12px;
  color: var(--ink);
  background: #f4f6f1;
}

.add-form button {
  padding: 0 18px;
  color: #fff;
  background: var(--accent);
  font-weight: 800;
}

.add-form button:hover {
  background: var(--accent-strong);
}

.status {
  min-height: 24px;
  margin: 12px 2px;
  color: var(--danger);
  font-weight: 700;
}

.list-wrap {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.todo-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.todo-item {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 64px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.todo-item:last-child {
  border-bottom: 0;
}

.todo-check {
  width: 24px;
  height: 24px;
  justify-self: center;
  accent-color: var(--accent);
  cursor: pointer;
}

.todo-text {
  overflow-wrap: anywhere;
  line-height: 1.35;
}

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

.delete-button {
  width: 44px;
  padding: 0;
  color: var(--danger);
  background: transparent;
  font-size: 1.35rem;
}

.delete-button:hover {
  background: #f8eeee;
}

.empty {
  padding: 40px 18px;
  text-align: center;
}

.empty h2 {
  margin: 0 0 6px;
  font-size: 1.2rem;
}

.empty p {
  margin: 0;
  color: var(--muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 520px) {
  .shell {
    width: min(100% - 20px, 720px);
    padding: 20px 0;
  }

  .topbar {
    align-items: start;
  }

  .add-form {
    grid-template-columns: 1fr;
  }

  .add-form button {
    width: 100%;
  }
}
