/* light-dark(light, dark). Default dark; <html class="light"> selects light. */
:root {
  color-scheme: dark;
  --bg: light-dark(#f2f4f5, #0e1113);
  --card: light-dark(#ffffff, #181c1f);
  --line: light-dark(#b4bbc2, #4d5761);
  --text: light-dark(#14171a, #e8ebee);
  --dim: light-dark(#525a63, #aab3bc);
  --accent: light-dark(#dc2626, #ef4444);
  --bin: light-dark(#14171a, #ffffff);
}
:root.light { color-scheme: light; }

/* 100dvh: add bar stays above the keyboard. */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 600 30px/1.3 -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }

header { display: flex; align-items: center; gap: 10px; padding: max(14px, env(safe-area-inset-top)) 12px 12px 18px; }
h1 { flex: 1; min-width: 0; margin: 0; font-size: clamp(20px, calc((100vw - 252px) / 5.2), 44px); font-weight: 800; white-space: nowrap; }
header button, #info { flex: none; display: block; width: 60px; height: 60px; padding: 9px; background: none; border: 2px solid var(--line); border-radius: 12px; color: var(--text); }
header button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
header svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

main { flex: 1; overflow-y: auto; padding: 0 12px 12px; }

ul { list-style: none; margin: 0; padding: 0; background: var(--card); border: 2px solid var(--line); border-radius: 14px; overflow: hidden; }
ul:empty { display: none; }
li { display: flex; align-items: center; border-top: 2px solid var(--line); }
li:first-child { border-top: 0; }

.tick, .bin { flex: none; width: 72px; align-self: stretch; display: grid; place-items: center; background: none; border: 0; }
.box { width: 38px; height: 38px; border: 3px solid var(--dim); border-radius: 50%; display: grid; place-items: center; font-size: 22px; color: transparent; }
.done .tick .box { border-color: var(--accent); background: var(--accent); color: var(--card); }
.bin .box { border-color: var(--bin); color: var(--bin); font-size: 34px; font-weight: 700; line-height: 1; }
.text { flex: 1; min-height: 68px; display: flex; align-items: center; padding: 6px 4px; overflow-wrap: anywhere; min-width: 0; }
.done .text { color: var(--dim); text-decoration: line-through; }

#empty { padding: 48px 20px; text-align: center; color: var(--dim); }

form { display: flex; gap: 10px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 2px solid var(--line); }
input { flex: 1; min-width: 0; padding: 14px 16px; background: var(--card); border: 2px solid var(--line); border-radius: 12px; }
input::placeholder { color: var(--dim); opacity: 1; }
input:focus { outline: 3px solid var(--accent); outline-offset: -2px; }
form button { flex: none; width: 76px; background: var(--accent); border: 0; border-radius: 12px; color: #fff; font-size: 44px; font-weight: 700; }
