:root {
  --bg: #f4f1ea;
  --card: #fff;
  --ink: #1c1917;
  --muted: #57534e;
  --line: #e7e5e4;
  --accent: #0f766e;
  --danger: #b91c1c;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
}
a { color: var(--accent); }
.wrap { max-width: 920px; margin: 0 auto; padding: 1.25rem; }
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.nav a.brand { color: var(--ink); text-decoration: none; font-weight: 700; }
.nav form { display: inline; }
.flash, .error {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin: 1rem 0;
}
.flash { background: #ecfdf5; }
.error { background: #fef2f2; color: var(--danger); }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  margin: 0.75rem 0;
}
.muted { color: var(--muted); }
.row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
label { display: block; font-weight: 600; margin: 0.75rem 0 0.25rem; }
input, select, textarea {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}
textarea { min-height: 8rem; }
button, .btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 0.45rem 0.8rem;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}
button.secondary, .btn.secondary { background: #44403c; }
button.danger, .btn.danger { background: var(--danger); }
.google { background: #1f2937; }
ul.plain { list-style: none; padding: 0; }
.empty { color: var(--muted); font-style: italic; }
.item-title { font-weight: 650; margin: 0 0 0.25rem; }
.thumb { max-width: 160px; max-height: 120px; border-radius: 8px; }
.day h2 { margin-bottom: 0.25rem; }
.actions { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.5rem; }
.actions form { display: inline; }
.check-item { display: flex; align-items: center; gap: 0.5rem; }
.check-item form { margin: 0; }
.check-item > form:first-child { flex: 1; }
.check-item button { padding: 0.2rem 0.45rem; font-size: 0.85rem; }
.done { text-decoration: line-through; color: var(--muted); }
.checklist,
.note {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  margin: 0.6rem 0;
  background: var(--card);
}
.note > p { margin: 0; white-space: pre-wrap; }
.checklist-head,
.title-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}
.checklist-head .item-title,
.title-actions .item-title,
.title-actions h1 {
  flex: 1;
  margin: 0;
}
.checklist-head form,
.title-actions form { margin: 0; }
.checklist-items { margin: 0 0 0.5rem; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  background: transparent;
  color: var(--muted);
  border: 0;
  border-radius: 6px;
  text-decoration: none;
}
.icon-btn:hover, .icon-btn:focus { color: var(--ink); background: var(--bg); }
.danger-icon:hover, .danger-icon:focus { color: var(--danger); background: #fef2f2; }
.check-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  margin: 0;
  cursor: pointer;
}
.check-label input { width: auto; margin: 0; }
.check-add {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
}
.check-add input { flex: 1; width: auto; min-width: 0; }
.check-add button { flex-shrink: 0; }

a.item-link {
  display: block;
  color: inherit;
  text-decoration: none;
}
a.item-link:hover .item-card,
a.item-link:focus .item-card {
  border-color: var(--accent);
}
.item-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  margin: 0.5rem 0;
}
.item-card-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.item-cover {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: var(--bg);
}
.item-card-body { flex: 1; min-width: 0; }
.item-card-body p { margin: 0 0 0.2rem; }
.item-desc { white-space: pre-wrap; color: var(--ink); }
.cover-choice { align-items: center; }
.cover-choice .thumb { max-width: 72px; max-height: 72px; }
.add-btn {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  min-width: 2.25rem;
  text-align: center;
  padding: 0.35rem 0.65rem;
}
fieldset {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 1rem 1rem;
  margin: 1rem 0;
}
legend { font-weight: 650; padding: 0 0.25rem; }
.choice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  margin: 0.4rem 0;
}
.choice input { width: auto; }

.item-list { min-height: 2.5rem; }
.day { transition: background 0.15s ease, border-color 0.15s ease; }
.day.drag-over {
  border-color: var(--accent);
  outline: 2px dashed var(--accent);
  background: #ecfdf5;
}
.drag-item {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  margin: 0.4rem 0;
}
.drag-item.dragging { opacity: 0.45; }
.drag-handle {
  flex-shrink: 0;
  cursor: grab;
  color: var(--muted);
  letter-spacing: -0.15em;
  user-select: none;
  padding: 0.55rem 0.15rem;
  line-height: 1;
}
.drag-item:active .drag-handle { cursor: grabbing; }
.drag-body { flex: 1; min-width: 0; }
.drag-body .item-card,
.drag-body .checklist,
.drag-body .note { margin: 0; }
