.todo-layout { flex: 1; overflow-y: auto; padding: 24px; }

/* One rounded panel holding the whole list, matching the Logbook. */
.todo-panel {
  max-width: 780px; margin: 0 auto;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px var(--border);
  padding: 18px 20px 8px;
}

.todo-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.todo-head h2 {
  margin: 0; font-size: 17px; color: var(--text-strong);
  display: flex; align-items: center; gap: 8px;
}
.todo-head .pill {
  background: var(--accent); color: #fff; font-size: 12px;
  padding: 1px 8px; border-radius: 999px;
}
.todo-head .spacer { flex: 1; }

.todo-add { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.todo-add-row { display: flex; gap: 8px; }
.todo-add-row input { flex: 1; }
.todo-add textarea { resize: vertical; min-height: 42px; font-size: 13px; }

.todo-list { list-style: none; margin: 0; padding: 0; }

.todo-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 8px;
  border-radius: var(--radius-sm);
}
.todo-item + .todo-item { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05); }
.todo-item:hover { background: var(--surface-2); }

/* The row's buttons stay out of the way until you are on the row. */
.todo-item .ghost.small { opacity: 0; font-size: 12px; padding: 4px 8px; }
.todo-item:hover .ghost.small, .todo-item:focus-within .ghost.small { opacity: 1; }
.todo-item .danger-text { color: #ff9093; }

.todo-item .tick {
  width: 22px; height: 22px; flex: none; padding: 0;
  border-radius: 50%; background: transparent;
  box-shadow: inset 0 0 0 2px var(--border);
  display: grid; place-items: center; line-height: 0;
}
.todo-item .tick:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.todo-item .tick.checked { background: var(--success); box-shadow: none; }
.todo-item .tick svg {
  width: 14px; height: 14px; display: block;
  fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
}

.todo-text { flex: 1; min-width: 0; }
.todo-title { font-size: 14px; color: var(--text-strong); word-break: break-word; }
.todo-sub { font-size: 12px; color: var(--muted); }

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

/* The description keeps the author's own line breaks. */
.todo-desc {
  font-size: 13px; color: var(--text); margin: 2px 0 3px;
  white-space: pre-wrap; word-break: break-word;
}
.todo-item.done .todo-desc { color: var(--muted); }

.todo-item.editing { display: block; padding: 10px 8px; }
.todo-edit-fields { display: flex; flex-direction: column; gap: 8px; }
.todo-edit-fields textarea { resize: vertical; font-size: 13px; }
.todo-edit-actions { display: flex; gap: 8px; justify-content: flex-end; }

.todo-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 16px 0 6px; padding: 0 8px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--muted);
}
.todo-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

.todo-list .empty.small { padding: 18px 8px; color: var(--muted); font-size: 13px; }

.todo-when { display: flex; gap: 12px; flex-wrap: wrap; }
.todo-when label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.todo-when input { font-size: 12px; padding: 4px 6px; width: auto; }

/* A deadline shouts only when it is close, and stops shouting once ticked. */
.todo-due { font-size: 12px; color: var(--muted); margin: 2px 0; }
.todo-due.soon { color: #ffcc4d; }
.todo-due.late { color: #ff9093; font-weight: 600; }
.todo-due.done { color: var(--muted); text-decoration: line-through; }

@media (max-width: 720px) {
  .todo-layout { padding: 12px; }
  .todo-panel { padding: 14px 12px 6px; }
  .todo-item .ghost.small { opacity: 1; }
  .todo-when { flex-direction: column; gap: 6px; }
}
