:root {
  color-scheme: light dark;
  --bg: #f5f5f3;
  --card: #fff;
  --text: #171717;
  --muted: #707070;
  --border: #e5e5e2;
  --accent: #171717;
  --accent-text: #fff;
  --success: #16803c;
  --danger: #c62e2e;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }

.shell { width: min(680px, calc(100% - 32px)); margin: 0 auto; padding: 64px 0 40px; }
.hero { margin-bottom: 28px; }
.brand { color: inherit; font-size: 24px; font-weight: 900; letter-spacing: -.04em; text-decoration: none; }
.badge { display: inline-block; margin-left: 12px; padding: 5px 9px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-size: 12px; font-weight: 700; vertical-align: 3px; }
h1 { margin: 28px 0 12px; font-size: clamp(38px, 8vw, 62px); line-height: .98; letter-spacing: -.055em; }
.hero p { max-width: 620px; margin: 0; color: var(--muted); font-size: 18px; line-height: 1.55; }

.card { min-height: 330px; padding: 28px; border: 1px solid var(--border); border-radius: 24px; background: var(--card); box-shadow: 0 18px 60px rgb(0 0 0 / .06); }
.empty-state { padding: 46px 16px; text-align: center; }
.empty-state h2 { margin: 0 0 8px; font-size: 28px; }
.empty-state p { margin: 0 auto 24px; max-width: 440px; color: var(--muted); line-height: 1.5; }
.primary { min-height: 46px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-text); font-weight: 750; }

.session-bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.session-bar > div { display: flex; align-items: center; gap: 8px; }
.session-bar small { color: var(--muted); }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 15%, transparent); }
.link-button, .remove { padding: 6px; border: 0; background: transparent; color: var(--muted); }
.link-button:hover, .remove:hover { color: var(--text); }

.todo-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin: 24px 0; }
.todo-form input { min-width: 0; height: 48px; padding: 0 16px; border: 1px solid var(--border); border-radius: 999px; background: transparent; color: var(--text); outline: none; }
.todo-form input:focus { border-color: var(--text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 10%, transparent); }
.todos { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.todo { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; min-height: 52px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 14px; }
.todo input { width: 18px; height: 18px; accent-color: var(--accent); }
.todo.completed span { color: var(--muted); text-decoration: line-through; }
.remove { color: var(--danger); font-size: 13px; }
.empty-list { margin: 52px 0; color: var(--muted); text-align: center; }
.message { min-height: 24px; margin: 18px 4px 0; color: var(--muted); font-size: 14px; text-align: center; }
.message[data-kind="error"] { color: var(--danger); }
.message[data-kind="success"] { color: var(--success); }

footer { margin-top: 24px; color: var(--muted); font-size: 14px; line-height: 1.55; }
footer a { color: var(--text); font-weight: 700; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (prefers-color-scheme: dark) {
  :root { --bg: #111; --card: #191919; --text: #f2f2f2; --muted: #a0a0a0; --border: #333; --accent: #f2f2f2; --accent-text: #111; }
}

@media (max-width: 520px) {
  .shell { padding-top: 34px; }
  .badge { display: block; width: fit-content; margin: 10px 0 0; }
  .card { padding: 20px; border-radius: 20px; }
  .todo-form { grid-template-columns: 1fr; }
  .todo-form .primary { width: 100%; }
  .session-bar > div { align-items: flex-start; flex-wrap: wrap; }
}
