:root {
  --bg: #fafaf7; --fg: #222; --muted: #777; --line: #ddd;
  --accent: #e2a800; --cell: #fff; --weekend: #f3f1ea;
  --conflict: #ffd6d6; --today: #fff6cc; --phase: #e8f0ff;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1b1b19; --fg: #eee; --muted: #999; --line: #3a3a36; --cell: #242421; --weekend: #2a2a26; --conflict: #5a2a2a; --today: #4a4220; --phase: #26324a; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.4 "Malgun Gothic", system-ui, sans-serif; }
header { display: flex; align-items: center; gap: 16px; padding: 10px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
h1 { font-size: 18px; margin: 0; }
nav { display: flex; gap: 4px; }
.mode { margin-left: auto; font-size: 13px; color: var(--muted); }
main { padding: 12px 16px; }
button, input, select { font: inherit; color: inherit; }
button { padding: 6px 12px; border: 1px solid var(--line); background: var(--cell); border-radius: 6px; cursor: pointer; }
button.tab.active, button.primary { background: var(--accent); border-color: var(--accent); color: #222; font-weight: 600; }
button.danger { color: #c33; }
input, select { padding: 6px 8px; border: 1px solid var(--line); background: var(--cell); border-radius: 6px; }
.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.legend { margin-left: auto; font-size: 12px; color: var(--muted); }
.sw { display: inline-block; width: 12px; height: 12px; vertical-align: -2px; margin-right: 4px; border: 1px solid var(--line); }
.sw.conflict { background: var(--conflict); }
.gridwrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: var(--cell); }
th, td { border: 1px solid var(--line); padding: 6px 8px; text-align: center; white-space: nowrap; }
thead th { position: sticky; top: 0; background: var(--bg); }
td.date { text-align: left; color: var(--muted); font-variant-numeric: tabular-nums; }
tr.weekend td { background: var(--weekend); }
tr.today td.date { background: var(--today); font-weight: 700; color: var(--fg); }
td.cell { min-width: 96px; }
td.cell.editable { cursor: pointer; }
td.cell.editable:hover { outline: 2px solid var(--accent); outline-offset: -2px; }
td.cell.conflict { background: var(--conflict); }
.phase { display: block; font-size: 11px; color: var(--muted); }
tfoot td { font-weight: 600; background: var(--bg); }
.hint { color: var(--muted); font-size: 13px; }
#siteTable td { text-align: left; }
dialog { border: 1px solid var(--line); border-radius: 10px; padding: 18px; background: var(--cell); color: var(--fg); min-width: 280px; }
dialog h2 { margin: 0 0 12px; font-size: 16px; }
dialog label { display: block; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
dialog label input, dialog label select { display: block; width: 100%; margin-top: 4px; font-size: 15px; color: var(--fg); }
dialog menu { display: flex; gap: 8px; justify-content: flex-end; padding: 0; margin: 12px 0 0; }
.error { color: #c33; min-height: 1.2em; font-size: 13px; margin: 0; }
@media (max-width: 600px) { main { padding: 8px; } td.cell { min-width: 72px; } }
