:root {
  color-scheme: light;
  --ink: #171d1a;
  --muted: #606b66;
  --paper: #eef4ef;
  --panel: #fffefb;
  --line: #d9dfd8;
  --green: #3e8b78;
  --green-dark: #245f51;
  --gold: #d89426;
  --red: #ad3d3a;
  --shadow: rgba(23, 29, 26, 0.16);
  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;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(62, 139, 120, 0.14), transparent 34%),
    linear-gradient(300deg, rgba(216, 148, 38, 0.13), transparent 36%),
    var(--paper);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 36px 18px;
}

.task-board {
  width: min(100%, 620px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 32px 92px var(--shadow);
  padding: clamp(24px, 5vw, 36px);
}

.hero {
  margin-bottom: 26px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(3.6rem, 12vw, 4.6rem);
  line-height: 0.92;
}

.intro {
  max-width: 520px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.55;
}

.task-form {
  display: grid;
  grid-template-columns: 1fr 66px;
  gap: 10px;
  margin-bottom: 16px;
}

.task-form input {
  min-width: 0;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 15px;
}

.task-form input:focus {
  outline: 3px solid rgba(62, 139, 120, 0.18);
  border-color: var(--green);
}

.task-form button,
.clear-button,
.filter-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 850;
}

.task-form button {
  min-height: 48px;
  border-color: var(--green);
  background: var(--green);
  color: #ffffff;
}

.task-form button:hover {
  background: var(--green-dark);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.filter-button {
  min-width: 76px;
  padding: 0 18px;
}

.filter-button.active {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold);
}

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

.task-item,
.empty-state {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.task-item {
  display: grid;
  grid-template-columns: 1fr 48px;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 14px;
}

.task-item label {
  min-width: 0;
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 12px;
}

.task-toggle {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.task-title {
  min-width: 0;
  overflow-wrap: anywhere;
}

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

.delete-button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--red);
  font-size: 1.55rem;
  line-height: 1;
}

.delete-button:hover {
  background: rgba(173, 61, 58, 0.08);
}

.empty-state {
  display: grid;
  place-items: center;
  color: var(--muted);
  padding: 20px;
  text-align: center;
}

.summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
}

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

.clear-button {
  padding: 0 14px;
}

.clear-button:not(:disabled):hover,
.filter-button:hover {
  border-color: var(--green);
  color: var(--green-dark);
}

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

@media (max-width: 560px) {
  .app-shell {
    padding: 16px;
  }

  h1 {
    font-size: clamp(3rem, 18vw, 4rem);
  }

  .task-form,
  .summary-bar {
    grid-template-columns: 1fr;
  }

  .task-form {
    display: grid;
  }

  .summary-bar {
    display: grid;
    align-items: stretch;
  }

  .clear-button {
    min-height: 44px;
  }
}
