:root {
  --accent: #4CAF50;
  --ink: #222;
  --bg: #f6f7f8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.wrap {
  max-width: 680px;
  margin: 40px auto;
  padding: 0 16px;
}

.title {
  margin: 10px 0 16px;
  text-align: center;
}

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.mode-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

#cloudToggle {
  width: 48px;
  height: 28px;
  appearance: none;
  background: #ddd;
  border-radius: 999px;
  position: relative;
  outline: none;
  cursor: pointer;
  transition: background .2s ease;
}

#cloudToggle::after {
  content: "";
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: left .2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}

#cloudToggle:checked {
  background: var(--accent);
}

#cloudToggle:checked::after {
  left: 23px;
}

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

#user-todo {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 16px;
}

.btn {
  padding: 10px 14px;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.btn:hover {
  filter: brightness(.95);
}

.btn:disabled {
  background: #bbb;
  cursor: not-allowed;
}

.btn.danger {
  background: #e34c4c;
}

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

.list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 10px 12px;
}

.todo-text {
  flex: 1;
}

.done .todo-text {
  text-decoration: line-through;
  color: #888;
}

.actions {
  display: flex;
  gap: 8px;
}

.actions .mini {
  padding: 6px 10px;
  font-size: .9rem;
}

.edit-input {
  flex: 1;
  padding: 8px 10px;
  font-size: 16px;
  border: 1px solid #ddd;
  border-radius: 6px;
}

.dragging {
  opacity: .6;
}

/* Optional: visual disabled state for the toggle if you ever set disabled attr */
#cloudToggle:disabled {
  opacity: .5;
  cursor: not-allowed;
}
