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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f5f5f5;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
  color: #1a1a1a;
}

.app {
  width: 100%;
  max-width: 480px;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 24px;
  letter-spacing: -0.5px;
}

#add-form {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

#add-form input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
}

#add-form input:focus { border-color: #6366f1; }

#add-form button {
  padding: 10px 18px;
  background: #6366f1;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

#add-form button:hover { background: #4f46e5; }

.filters {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}

.filter {
  padding: 5px 14px;
  border: 1.5px solid #ddd;
  border-radius: 20px;
  background: transparent;
  font-size: 0.85rem;
  cursor: pointer;
  color: #555;
  transition: all 0.15s;
}

.filter:hover { border-color: #6366f1; color: #6366f1; }
.filter.active { background: #6366f1; border-color: #6366f1; color: #fff; }

#list { list-style: none; display: flex; flex-direction: column; gap: 8px; }

.todo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1.5px solid #e5e5e5;
  border-radius: 10px;
  padding: 12px 14px;
  transition: opacity 0.15s;
}

.todo-item.done { opacity: 0.5; }

.todo-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #6366f1;
  cursor: pointer;
  flex-shrink: 0;
}

.todo-text {
  flex: 1;
  font-size: 0.95rem;
  word-break: break-word;
}

.todo-item.done .todo-text { text-decoration: line-through; }

.delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #bbb;
  font-size: 1.1rem;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.15s;
  flex-shrink: 0;
}

.delete-btn:hover { color: #ef4444; }

.empty {
  text-align: center;
  color: #aaa;
  font-size: 0.9rem;
  margin-top: 32px;
}

.hidden { display: none; }
