:root {
  --bg: #ffffff;
  --muted: #6b7280;
  --accent: #2563eb;
  --danger: #ef4444;
  --border: #e9ecef;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  color: #222;
}

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: inherit;
}

.app {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 16px;
  box-sizing: border-box;
}

h1 {
  margin: 0 0 12px 0;
  font-size: 20px;
  font-weight: 600;
}

form {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

input[type="text"] {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 16px;
  outline: none;
}

button {
  height: 44px;
  padding: 0 14px;
  border-radius: 8px;
  border: 0;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

button.secondary {
  background: var(--danger);
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

li:last-child { border-bottom: none; }

li.checked .item-label {
  text-decoration: line-through;
  color: var(--muted);
}

input[type="checkbox"] {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin: 0;
}

.item-label {
  flex: 1 1 auto;
  min-width: 0;
  word-break: normal;
  overflow-wrap: anywhere;
  white-space: normal;
  font-size: 16px;
}

.remove-btn {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  color: var(--danger);
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  border-radius: 6px;
}

.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}

.count {
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 520px) {
  form { flex-direction: column-reverse; }
  button { width: 100%; }
  input[type="text"] { width: 100%; }
  .app { padding: 12px; }
}

@media (min-width: 521px) {
  .app { padding-left: 20px; padding-right: 20px; }
}
