:root {
  color-scheme: light;
  --surface-0: #f6f5f2; --surface-1: #fcfcfb; --line: #e2e0da;
  --text-primary: #0b0b0b; --text-secondary: #52514e; --text-muted: #8a8880;
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a;
  --seq-1: #e3eefc; --seq-2: #a9c9f2; --seq-3: #5f9be4; --seq-4: #2a78d6; --seq-5: #164a8a;
  --accent: #2a78d6;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --surface-0: #121211; --surface-1: #1a1a19; --line: #33322f;
    --text-primary: #ffffff; --text-secondary: #c3c2b7; --text-muted: #8f8e86;
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70;
    --seq-1: #1f2a3a; --seq-2: #24466f; --seq-3: #2d63a3; --seq-4: #3987e5; --seq-5: #8cbcf5;
    --accent: #3987e5;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-0: #121211; --surface-1: #1a1a19; --line: #33322f;
  --text-primary: #ffffff; --text-secondary: #c3c2b7; --text-muted: #8f8e86;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70;
  --seq-1: #1f2a3a; --seq-2: #24466f; --seq-3: #2d63a3; --seq-4: #3987e5; --seq-5: #8cbcf5;
  --accent: #3987e5;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--surface-0); color: var(--text-primary); font: 14px/1.5 system-ui, -apple-system, "Pretendard", "Malgun Gothic", sans-serif; }
.muted { color: var(--text-secondary); }
a { color: var(--accent); }
header.top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-1); position: sticky; top: 0; z-index: 2; }
header.top h1 { font-size: 16px; margin: 0; }
header.top form { margin-left: auto; }
main { padding: 16px; max-width: 1200px; margin: 0 auto; }
.filters { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: end; padding: 12px; margin-bottom: 16px; background: var(--surface-1); border: 1px solid var(--line); border-radius: 8px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-secondary); }
.filters input, .filters select { min-height: 32px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-0); color: var(--text-primary); font: inherit; }
.filters .presets { display: flex; gap: 6px; }
button { min-height: 32px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-1); color: var(--text-primary); font: inherit; cursor: pointer; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { padding: 12px 14px; background: var(--surface-1); border: 1px solid var(--line); border-radius: 8px; }
.tile .label { font-size: 12px; color: var(--text-secondary); }
.tile .value { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.tile .sub { font-size: 12px; color: var(--text-muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 12px; }
.card { background: var(--surface-1); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; min-width: 0; }
.card h2 { font-size: 14px; margin: 0 0 8px; }
.card .chart { position: relative; height: 220px; }
.card details { margin-top: 8px; }
.card summary { cursor: pointer; font-size: 12px; color: var(--text-secondary); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--line); font-size: 13px; }
td.num, th.num { text-align: right; }
.heat { display: grid; grid-template-columns: 32px repeat(24, 1fr); gap: 2px; font-size: 10px; color: var(--text-secondary); }
.heat .cell { aspect-ratio: 1; border-radius: 2px; background: var(--seq-1); min-width: 0; }
.heat .cell[data-level="1"] { background: var(--seq-2); } .heat .cell[data-level="2"] { background: var(--seq-3); }
.heat .cell[data-level="3"] { background: var(--seq-4); } .heat .cell[data-level="4"] { background: var(--seq-5); }
.heat .lbl { display: flex; align-items: center; }
.heat .hour { text-align: center; }
.status { font-size: 12px; color: var(--text-muted); margin: 0 0 8px; min-height: 1.2em; }
.login-page { display: grid; place-items: center; min-height: 100dvh; }
.login { width: min(360px, calc(100vw - 32px)); padding: 24px; background: var(--surface-1); border: 1px solid var(--line); border-radius: 12px; }
.login h1 { margin: 0 0 4px; font-size: 20px; }
.login form { display: grid; gap: 12px; margin-top: 16px; }
.login label { display: grid; gap: 4px; font-size: 12px; color: var(--text-secondary); }
.login input { min-height: 36px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-0); color: var(--text-primary); font: inherit; }
.login button { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (max-width: 600px) { .card .chart { height: 180px; } .heat { font-size: 8px; } }
