:root {
  --bg: #f4f4f1; --card: #fff; --line: #e4e4de; --ink: #1c1c1e; --muted: #77776f;
  --accent: #3b5bfd; --accent-soft: #e8ecff; --done: #a3a39b; --bad: #d93a2b;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { max-width: 620px; margin: 0 auto; padding: 32px 16px 64px; }
header { margin-bottom: 20px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 26px; font-weight: 750; letter-spacing: -0.02em; }
.mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M9 16.5l4.5 4.5L23 11.5' stroke='white' stroke-width='3.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100%; }
.tagline { margin: 6px 0 0; color: var(--muted); }
.status { margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; }
.pill { padding: 2px 10px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); color: var(--muted); }
.pill.on { color: var(--ink); }
.pill.on::before { content: "● "; color: #20a35a; }
.pill.off::before { content: "○ "; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 14px; }
textarea { width: 100%; resize: vertical; border: 0; outline: 0; font: inherit; color: inherit; background: transparent; min-height: 110px; }
textarea::placeholder { color: #b0b0a8; }
.actions { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.primary, .secondary { font: inherit; font-weight: 600; border-radius: 10px; padding: 10px 18px; cursor: pointer; border: 0; }
.primary { background: var(--accent); color: #fff; }
.secondary { background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; }
.primary:disabled, .busy .secondary { opacity: .55; cursor: progress; }
.error { color: var(--bad); margin: 8px 0 0; font-size: 14px; min-height: 0; }
.error:empty { display: none; }

.list-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.thumb img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; display: block; border: 1px solid var(--line); }
.list-meta { flex: 1; min-width: 0; }
h2 { font-size: 18px; margin: 0; overflow-wrap: anywhere; }
.progress { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.items { list-style: none; margin: 0; padding: 0; }
.item { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }
.check { position: relative; width: 22px; height: 22px; flex: none; cursor: pointer; }
.check input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.check span { position: absolute; inset: 0; border: 2px solid #c9c9c1; border-radius: 6px; }
.check input:checked + span { background: var(--accent); border-color: var(--accent); }
.check input:checked + span::after { content: ""; position: absolute; left: 6px; top: 2px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.check input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.text { flex: 1; min-width: 0; font: inherit; color: inherit; border: 0; background: transparent; padding: 6px 4px; border-radius: 6px; }
.text:focus { outline: 0; background: var(--bg); }
.done .text { color: var(--done); text-decoration: line-through; }
.icon { border: 0; background: transparent; color: #b0b0a8; font-size: 22px; line-height: 1; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; flex: none; }
.icon:hover { background: var(--bg); color: var(--bad); }
@media (hover: hover) { .item .icon { opacity: 0; } .item:hover .icon, .item .icon:focus { opacity: 1; } }
.empty { text-align: center; color: var(--muted); padding: 28px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
