:root {
  color-scheme: light;
  --bg: #f5f6fa;
  --card: #ffffff;
  --text: #1f2430;
  --muted: #6b7280;
  --accent: #4f46e5;
  --accent-dark: #4338ca;
  --border: #e5e7eb;
  --done: #9ca3af;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex;
  justify-content: center;
  padding: 32px 16px;
}

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

h1 {
  margin: 0 0 4px;
  font-size: 28px;
}

.subtitle {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
}

.add-form {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.add-form input {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}

#author-input {
  flex: 0 0 130px;
}

#text-input {
  flex: 1 1 200px;
}

.add-form button {
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-weight: 600;
  cursor: pointer;
}

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

.todo-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.todo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}

.todo-item .text {
  flex: 1;
  font-size: 15px;
  word-break: break-word;
}

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

.todo-item .author {
  font-size: 12px;
  color: var(--muted);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.todo-item .delete-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 4px;
}

.todo-item .delete-btn:hover {
  color: #dc2626;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  margin-top: 32px;
}
