:root {
  color-scheme: light dark;
  --paper: #f7f9fc; --surface: #ffffff; --ink: #243047; --muted: #657189;
  --line: #dbe2ed; --accent: #345e9e; --tint: #e9eff8; --alert: #a3424b;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  font-size: 16px; line-height: 1.7; background: var(--paper); color: var(--ink);
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #172132; --surface: #202e42; --ink: #e5ebf4; --muted: #adbbce; --line: #3d4d65; --accent: #a5c5f8; --tint: #273b58; --alert: #ffacb4; }
}
* { box-sizing: border-box; }
body { margin: 0; }
main { max-width: 720px; margin: auto; padding: 36px 24px 60px; }
h1 { font-size: clamp(1.65rem, 5vw, 2.1rem); font-weight: 600; margin: 0; letter-spacing: .03em; }
h2, summary { font-size: 1.18rem; font-weight: 600; margin: 0 0 20px; }
h3 { font-size: .9rem; color: var(--muted); font-weight: 500; margin: 24px 0 6px; }
p { margin: 0 0 12px; }
a { color: var(--accent); text-underline-offset: 4px; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 32px; }
.page-header p { font-size: .85rem; margin-bottom: 4px; }
.page-header a { white-space: nowrap; font-size: .9rem; }
section { padding: 30px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 20px; }
section.today { border-top: 3px solid var(--accent); }
.count { margin-left: 10px; color: var(--muted); font-size: .85rem; font-weight: normal; }
.muted, .empty { color: var(--muted); font-size: .88rem; }
.empty { margin: 12px 0; }
ul { list-style: none; padding: 0; margin: 0; }
.task { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.task-open { flex: 1; min-width: 0; background: transparent; border: 0; text-align: left; padding: 8px 4px; color: var(--ink); }
.task-title { display: block; overflow-wrap: anywhere; }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: .76rem; color: var(--muted); margin-top: 3px; }
.overdue { color: var(--alert); }
.pending { color: var(--accent); }
.check-label { display: grid; place-items: center; min-width: 44px; min-height: 44px; cursor: pointer; }
.check-label input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.review-actions { display: flex; gap: 6px; }
.review-actions button { padding: 8px 10px; font-size: .8rem; }
label { display: block; font-size: .85rem; margin-bottom: 16px; }
input, select, textarea, button { font: inherit; }
input:not([type=checkbox]), select, textarea { display: block; width: 100%; min-width: 0; padding: 11px 12px; margin-top: 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font-size: 1rem; }
textarea { resize: vertical; margin-bottom: 16px; }
button { min-height: 44px; border: 1px solid var(--line); padding: 9px 18px; border-radius: 6px; background: var(--surface); color: var(--ink); cursor: pointer; }
button:hover { background: var(--tint); }
button:disabled { opacity: .55; cursor: wait; }
button.primary { background: var(--accent); color: var(--paper); border-color: var(--accent); }
button.quiet { border-color: transparent; background: transparent; color: var(--muted); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.wide { grid-column: 1 / -1; }
.actions { display: flex; justify-content: flex-end; gap: 12px; }
#feedback { font-size: .9rem; color: var(--accent); }
#feedback:empty { display: none; }
#feedback.error, #edit-error { color: var(--alert); }
.usage-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 0; }
.usage-grid dt { font-size: .78rem; color: var(--muted); }
.usage-grid dd { font-size: 1.3rem; margin: 6px 0 0; font-variant-numeric: tabular-nums; }
summary { cursor: pointer; min-height: 44px; margin: 0; }
details[open] summary { margin-bottom: 16px; }
footer { color: var(--muted); font-size: .75rem; padding-top: 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
footer p { margin: 0; }
dialog { width: min(540px, calc(100% - 32px)); max-height: calc(100dvh - 40px); padding: 28px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--paper); }
dialog::backdrop { background: rgb(10 20 40 / .5); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.login { max-width: 420px; padding-top: 18vh; }
.login h1 { margin-bottom: 36px; }
@media (max-width: 420px) {
  main { padding: 24px 18px 40px; }
  .task { flex-wrap: wrap; }
  .review-actions { margin-left: auto; }
  .usage-grid { gap: 8px; }
  .usage-grid dd { font-size: 1.1rem; }
  dialog { padding: 20px; }
}
