:root {
  --bg: #f6f5f1; --card: #ffffff; --ink: #1f2421; --muted: #6b726d; --line: #e2e0d8;
  --accent: #2f6f5e; --danger: #b3412f; --done: #8a938d;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #171a18; --card: #202522; --ink: #ecefec; --muted: #98a19b; --line: #333a36;
          --accent: #5fb89f; --danger: #e07a67; --done: #6d766f; }
}
* { 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; }
.wrap { max-width: 960px; margin: 0 auto; padding: 20px 16px 60px; }
.narrow .wrap { max-width: 420px; }
header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
h1 { font-size: 1.5rem; margin: 0; }
h2 { font-size: 1.4rem; margin: 0; }
h3.section { margin: 28px 0 8px; font-size: 1.05rem; }
.sub { color: var(--muted); font-size: .9rem; }
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
button { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; cursor: pointer; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.icon { padding: 4px 8px; line-height: 1.2; color: var(--muted); }
button.icon:hover { color: var(--ink); }
button.danger:hover, button.icon.danger:hover { color: var(--danger); border-color: var(--danger); }
input[type=text], input[type=password], select { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; }
select { width: auto; max-width: 150px; padding: 5px 6px; font-size: .85rem; color: var(--muted); }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); transition: width .25s; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.room { display: block; text-decoration: none; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.room:hover { border-color: var(--accent); }
.room h3 { margin: 0 0 2px; font-size: 1.05rem; }
.room .n { color: var(--muted); font-size: .85rem; margin-bottom: 10px; }
.total { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
.total .row { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 6px 8px; margin: 14px 0; }
.panel.pad { padding: 14px 16px; }
.task { display: flex; align-items: center; gap: 10px; padding: 8px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.task:last-child { border-bottom: 0; }
.task input[type=checkbox] { width: 24px; height: 24px; accent-color: var(--accent); flex: none; cursor: pointer; }
.task label { flex: 1; cursor: pointer; word-break: break-word; padding: 2px 0; }
.task.done label, .task.done .edit input { color: var(--done); text-decoration: line-through; }
.task .edit { flex: 1; min-width: 160px; }
.task .tools { display: flex; gap: 4px; align-items: center; }
.hide-done .task.done { display: none; }
.hide-toggle { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .9rem; margin-top: 10px; cursor: pointer; }
.roomrow { justify-content: space-between; }
.roomlink { flex: 1; text-decoration: none; color: inherit; display: flex; flex-direction: column; padding: 4px 0; }
.add { display: flex; gap: 8px; margin-top: 8px; }
.quick label { display: block; margin-bottom: 8px; }
.quick .add { margin-top: 0; }
.back { display: inline-block; margin-bottom: 10px; text-decoration: none; }
.titlerow { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.progress { margin: 12px 0 4px; }
.progress .sub { margin-bottom: 6px; }
.empty { color: var(--muted); padding: 14px 8px; }
.warn { background: #fff3cd; color: #5c4400; border-radius: 8px; padding: 8px 12px; margin: 0 0 14px; font-size: .95rem; }
label { font-size: .95rem; }
