:root { --bg:#fff; --fg:#1d1d1f; --muted:#6b6b72; --line:#e3e3e8; --red:#cc0000; --redbg:#ffe6e6; --accent:#c62828; }
@media (prefers-color-scheme: dark) {
  :root { --bg:#16161a; --fg:#ececf1; --muted:#9a9aa5; --line:#33333b; --redbg:#3a1c1c; --red:#ff7b7b; --accent:#e5534b; }
}
* { box-sizing: border-box; }
body { margin:0 auto; max-width:1200px; padding:16px; background:var(--bg); color:var(--fg); font:15px/1.5 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; }
h1 { font-size:22px; margin:0 0 4px; }
h2 { font-size:17px; margin:0; }
h3 { font-size:16px; margin:24px 0 8px; }
.muted { color:var(--muted); margin:4px 0; }
.controls { display:flex; flex-wrap:wrap; gap:12px; align-items:end; margin:16px 0 8px; }
.controls label { display:flex; flex-direction:column; font-size:13px; color:var(--muted); gap:2px; }
input[type=date] { font:inherit; padding:6px 8px; border:1px solid var(--line); border-radius:6px; background:var(--bg); color:var(--fg); }
button { font:inherit; padding:7px 12px; border:1px solid var(--line); border-radius:6px; background:transparent; color:var(--fg); cursor:pointer; }
button:hover { border-color:var(--accent); }
button.primary { background:var(--accent); border-color:var(--accent); color:#fff; }
.presets { display:flex; gap:6px; flex-wrap:wrap; }
.notice { padding:8px 12px; border-radius:6px; background:var(--redbg); color:var(--red); margin:8px 0; }
.summary { margin:16px 0; padding:14px 16px; border:1px solid var(--line); border-radius:8px; }
.summary-head { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:8px; margin-bottom:8px; }
.summary-head button { margin-left:6px; }
#lines p { margin:6px 0; }
#lines p:first-child { font-weight:600; }
.table-wrap { overflow-x:auto; }
table.cal { border-collapse:collapse; width:100%; min-width:760px; table-layout:fixed; }
.cal th, .cal td { border:1px solid var(--line); vertical-align:top; padding:6px; }
.cal th { background:var(--redbg); font-size:13px; text-align:center; }
.cal td.has { background:var(--redbg); }
.cal td.out { opacity:.35; }
.cal .d { font-weight:600; margin-bottom:4px; }
.cal .t { font-size:11px; line-height:1.4; }
.cal .n { color:var(--red); font-weight:600; font-size:12px; margin-top:4px; }
.cal .s { color:var(--red); font-size:11px; }
.loading::before { content:""; display:inline-block; width:14px; height:14px; margin-right:8px; vertical-align:-2px; border:2px solid var(--line); border-top-color:var(--accent); border-radius:50%; animation:spin .8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .loading::before { animation-duration:3s; } }
button:disabled { opacity:.6; cursor:progress; }
