:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f6f8;
  color: #17202a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  place-items: start center;
  padding: 48px 16px;
}

.todo-panel {
  width: min(100%, 720px);
  background: #ffffff;
  border: 1px solid #d9e1e8;
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(23, 32, 42, 0.08);
  padding: 28px;
}

.header {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 24px;
}

.eyebrow {
  color: #577084;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 4px;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1;
  margin-bottom: 0;
}

.count {
  background: #eaf2f8;
  border-radius: 999px;
  color: #1f5f8b;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 8px 12px;
  white-space: nowrap;
}

.add-form {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto;
  margin-bottom: 22px;
}

.add-form input {
  border: 1px solid #c9d4df;
  border-radius: 6px;
  min-width: 0;
  padding: 13px 14px;
}

.add-form input:focus {
  border-color: #2a7ab0;
  outline: 3px solid rgba(42, 122, 176, 0.16);
}

.add-form button,
.delete {
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
}

.add-form button {
  background: #2a7ab0;
  color: #ffffff;
  padding: 0 20px;
}

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

.todo-item {
  align-items: center;
  background: #fbfcfd;
  border: 1px solid #e1e8ef;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: auto 1fr auto;
  min-height: 58px;
  padding: 10px 12px;
}

.toggle {
  align-items: center;
  background: #ffffff;
  border: 2px solid #8aa1b4;
  border-radius: 50%;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  height: 28px;
  justify-content: center;
  line-height: 1;
  width: 28px;
}

.is-done .toggle {
  background: #1f8a5b;
  border-color: #1f8a5b;
}

.todo-title {
  overflow-wrap: anywhere;
}

.is-done .todo-title {
  color: #6b7c88;
  text-decoration: line-through;
}

.delete {
  background: #f8e7e7;
  color: #9b2727;
  padding: 9px 12px;
}

.empty-state {
  background: #f7fafc;
  border: 1px dashed #b8c8d5;
  border-radius: 8px;
  padding: 32px;
  text-align: center;
}

.empty-state h2 {
  margin-bottom: 8px;
}

.empty-state p {
  color: #617483;
  margin-bottom: 0;
}

.messages {
  width: min(100%, 720px);
  margin-bottom: 16px;
}

.messages p {
  background: #e9f7ef;
  border: 1px solid #b7e2c7;
  border-radius: 6px;
  color: #185c37;
  margin-bottom: 8px;
  padding: 10px 12px;
}

.sr-only {
  height: 1px;
  margin: -1px;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

@media (max-width: 520px) {
  .app-shell {
    padding: 18px 12px;
  }

  .todo-panel {
    padding: 18px;
  }

  .header {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .add-form button {
    min-height: 46px;
  }

  .todo-item {
    grid-template-columns: auto 1fr;
  }

  .delete {
    grid-column: 2;
    justify-self: start;
  }
}
