:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #18212b;
  --muted: #6a7480;
  --line: #dce2e8;
  --primary: #1769e0;
  --primary-dark: #0f4da8;
  --danger: #b42318;
  --soft-blue: #eaf2ff;
  --soft-green: #eaf8ef;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(circle at top right, #eaf2ff 0, var(--bg) 38rem); color: var(--text); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.shell { width: min(100% - 2rem, 980px); margin: 0 auto; padding: 3rem 0 5rem; }
.brand, .toolbar, .section-heading, .list-heading, .form-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { margin-bottom: 2rem; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.8rem, 5vw, 3rem); letter-spacing: -0.04em; }
h2 { margin-bottom: .5rem; font-size: 1.6rem; }
h3 { margin-bottom: 0; }
.eyebrow { color: var(--primary); font-size: .72rem; font-weight: 800; letter-spacing: .14em; margin-bottom: .5rem; }
.muted { color: var(--muted); line-height: 1.5; }
.card { background: color-mix(in srgb, var(--panel) 94%, transparent); border: 1px solid var(--line); border-radius: 1.2rem; box-shadow: 0 18px 50px rgb(32 50 72 / 8%); padding: clamp(1.2rem, 3vw, 2rem); margin-bottom: 1.5rem; }
.narrow { max-width: 480px; margin: 3rem auto 0; }
.stack { display: grid; gap: .65rem; }
label { font-size: .9rem; font-weight: 700; }
input, select { width: 100%; border: 1px solid var(--line); border-radius: .7rem; padding: .78rem .85rem; background: var(--panel); color: var(--text); }
input:focus, select:focus, button:focus-visible { outline: 3px solid rgb(23 105 224 / 25%); outline-offset: 2px; border-color: var(--primary); }
.primary, .ghost, .text-button { border-radius: .7rem; border: 0; padding: .75rem 1rem; font-weight: 750; }
.primary { color: #fff; background: var(--primary); }
.primary:hover { background: var(--primary-dark); }
.ghost { color: var(--primary); border: 1px solid #bdd2f5; background: var(--soft-blue); }
.text-button { padding: .3rem; color: var(--primary); background: transparent; }
.status-dot { width: .85rem; height: .85rem; border-radius: 50%; background: #2db56e; box-shadow: 0 0 0 .35rem rgb(45 181 110 / 15%); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: .4rem; }
.check-row { display: flex; align-items: center; gap: .6rem; font-weight: 600; padding: .35rem 0; }
.check-row input { width: 1.1rem; height: 1.1rem; accent-color: var(--primary); }
.form-actions { justify-content: flex-start; margin-top: .5rem; }
.task-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.list-heading { margin: 0 0 .75rem; }
.count { display: inline-grid; place-items: center; min-width: 1.8rem; height: 1.8rem; border-radius: 1rem; color: var(--primary); background: var(--soft-blue); font-size: .8rem; font-weight: 800; }
.task-list { display: grid; gap: .75rem; list-style: none; padding: 0; margin: 0; }
.task-item { background: var(--panel); border: 1px solid var(--line); border-radius: .9rem; padding: 1rem; }
.task-main { display: flex; align-items: flex-start; gap: .75rem; }
.task-title { flex: 1; font-weight: 750; overflow-wrap: anywhere; }
.task-item.completed .task-title { color: var(--muted); text-decoration: line-through; }
.task-meta { color: var(--muted); font-size: .82rem; margin: .55rem 0 .75rem 1.75rem; line-height: 1.45; }
.task-actions { display: flex; flex-wrap: wrap; gap: .45rem; margin-left: 1.75rem; }
.task-actions button { border: 1px solid var(--line); border-radius: .55rem; padding: .4rem .65rem; color: var(--text); background: transparent; font-size: .82rem; }
.task-actions button:hover { border-color: var(--primary); color: var(--primary); }
.task-actions .delete:hover { border-color: var(--danger); color: var(--danger); }
.check-task { width: 1.2rem; height: 1.2rem; margin-top: .15rem; accent-color: var(--primary); }
.empty { color: var(--muted); font-size: .9rem; padding: .5rem 0; }
.error { color: var(--danger); background: #fff0ee; border: 1px solid #f3c5bd; border-radius: .7rem; padding: .7rem .85rem; }
[hidden] { display: none !important; }

@media (max-width: 700px) {
  .shell { width: min(100% - 1rem, 980px); padding-top: 1.5rem; }
  .task-columns, .form-grid { grid-template-columns: 1fr; }
  .brand { align-items: flex-start; }
  .toolbar { align-items: flex-start; }
}

@media (prefers-color-scheme: dark) {
  :root { color-scheme: dark; --bg: #11161c; --panel: #1a222b; --text: #edf2f7; --muted: #a9b4c0; --line: #33404c; --soft-blue: #192f55; --soft-green: #173b29; }
  body { background: radial-gradient(circle at top right, #172841 0, var(--bg) 38rem); }
  .error { background: #3b211f; border-color: #743b34; }
}
