:root { --bg: #f6f5f1; --card: #fff; --ink: #1d1d1b; --muted: #77756e; --line: #e3e0d8; --accent: #1f6f5c; --ok: #3a9d6e; --no: #d0574b; --val: #9aa7c7; }
@media (prefers-color-scheme: dark) {
  :root { --bg: #151614; --card: #1f201d; --ink: #ecebe6; --muted: #9b998f; --line: #34352f; --accent: #5fbf9f; --ok: #3f9b6e; --no: #c4584d; --val: #5d6a8a; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { max-width: 760px; margin: 0 auto; padding: 12px 16px 60px; }
a { color: var(--accent); text-decoration: none; }
h1 { font-size: 1.5rem; margin: 16px 0 8px; }
h2 { font-size: 1.1rem; margin: 0 0 10px; }
h2 small, .muted, .hint { color: var(--muted); font-weight: normal; font-size: .85rem; }
h3 { font-size: 1rem; margin: 6px 0; }
section { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin: 14px 0; }
nav { display: flex; gap: 4px; overflow-x: auto; padding: 6px 0; border-bottom: 1px solid var(--line); }
nav a, .tabs a { padding: 6px 10px; border-radius: 8px; white-space: nowrap; color: var(--ink); }
nav a.on, .tabs a.on { background: var(--accent); color: #fff; }
nav form { margin-left: auto; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0; }
.tabs small { opacity: .7; }
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; min-width: 0; }
textarea { width: 100%; resize: vertical; }
button { background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 7px 14px; cursor: pointer; }
button.ico { background: none; color: inherit; padding: 2px 4px; font-size: 1.15rem; line-height: 1; }
button.del { color: var(--muted); }
button.link { background: none; color: var(--muted); padding: 4px 8px; }
form.inline { display: inline; margin: 0; }
form.row, .row { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; margin: 8px 0; }
form.row input[name=text], form.row input[name=title], form.row input[name=s] { flex: 1 1 200px; }
form.stack { display: flex; flex-direction: column; gap: 8px; }
form.stack button { align-self: flex-start; }
label { display: flex; flex-direction: column; gap: 3px; font-size: .85rem; color: var(--muted); }
label input, label select, label textarea { color: var(--ink); font-size: 1rem; }
label.chk { flex-direction: row; align-items: center; gap: 6px; padding-bottom: 8px; }
ul { padding-left: 0; list-style: none; margin: 0; }
ul.focus li { display: flex; align-items: center; gap: 6px; padding: 4px 0; border-bottom: 1px solid var(--line); }
ul.focus li span { flex: 1; }
ul.focus li.done span { text-decoration: line-through; color: var(--muted); }
ul.books li, ul.ideas li, section > ul li { padding: 7px 0; border-bottom: 1px solid var(--line); }
ul.ideas li { display: flex; gap: 8px; justify-content: space-between; flex-wrap: wrap; }
ul.ideas li.done div, ul.ideas li.drop div { color: var(--muted); text-decoration: line-through; }
.tag { display: inline-block; font-size: .75rem; padding: 1px 7px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
table.hab { width: 100%; border-collapse: collapse; }
table.hab th { font-weight: normal; color: var(--muted); font-size: .8rem; }
table.hab td { padding: 4px 2px; border-bottom: 1px solid var(--line); }
table.hab td:not(:first-child), table.hab th { text-align: center; width: 64px; }
.num { color: var(--muted); }
.entry { padding: 6px 0; border-bottom: 1px solid var(--line); }
.entry time { color: var(--muted); font-size: .8rem; margin-right: 8px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.tile { background: var(--bg); border-radius: 10px; padding: 10px; font-size: .85rem; color: var(--muted); }
.tile b { display: block; font-size: 1.5rem; color: var(--ink); }
.tile b small { font-size: .9rem; color: var(--muted); }
.gr { margin: 8px 0; }
.gr b { font-weight: normal; font-size: .9rem; }
.cells { display: grid; grid-template-columns: repeat(30, 1fr); gap: 2px; margin-top: 3px; }
.cells i { aspect-ratio: 1; border-radius: 3px; background: var(--line); font-style: normal; font-size: .6rem; display: flex; align-items: center; justify-content: center; color: #fff; }
.cells i.ok { background: var(--ok); }
.cells i.no { background: var(--no); }
.cells i.val { background: var(--val); }
.habit { border-bottom: 1px solid var(--line); padding: 8px 0; }
.habit.off { opacity: .55; }
.note { white-space: normal; font-size: .9rem; margin: 4px 0; }
details summary { cursor: pointer; color: var(--accent); font-size: .9rem; margin: 4px 0; }
.err { color: var(--no); }
form.login { max-width: 320px; margin: 18vh auto; }
