:root {
  --surface: #f5f6f8;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #5b6673;
  --line: #d4d9e0;
  --accent: #0b5c7a;
  --accent-strong: #08475e;
  --on-accent: #ffffff;
  --danger: #a3271d;
  --ok-bg: #e2f1ea;
  --ok-ink: #14573b;
  --err-bg: #fbe9e7;
  --bar: #2a7f9e;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface: #12171d;
    --panel: #1a2129;
    --ink: #e7ebf0;
    --muted: #9aa5b1;
    --line: #2f3944;
    --accent: #58b4d6;
    --accent-strong: #7cc6e2;
    --on-accent: #08222d;
    --danger: #f08a7f;
    --ok-bg: #173528;
    --ok-ink: #9fdcbd;
    --err-bg: #3d1d1a;
    --bar: #58b4d6;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font: 16px/1.6 "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  word-break: keep-all;
}

a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.topbar-inner, main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
}
.topbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 24px;
  min-height: 56px;
}
.brand { font-weight: 700; font-size: 1.05rem; color: var(--ink); text-decoration: none; margin-right: 8px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
  padding: 16px 12px 13px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 3px solid transparent;
}
.nav a[aria-current="page"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
.who { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.9rem; }

main { padding-top: 32px; padding-bottom: 64px; }
h1 { font-size: 1.6rem; line-height: 1.3; margin: 0 0 4px; }
h2 { font-size: 1.1rem; margin: 0 0 12px; }
.lead { color: var(--muted); margin: 0 0 24px; }
section { margin-top: 32px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 20px;
}

.notice { padding: 10px 14px; border-radius: 6px; margin: 0 0 20px; }
.notice.ok { background: var(--ok-bg); color: var(--ok-ink); }
.notice.err { background: var(--err-bg); color: var(--danger); }

.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-weight: 600; color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.when { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--muted); }
td.name { font-weight: 600; word-break: break-all; }
.empty { padding: 28px 20px; color: var(--muted); text-align: center; }
.gone { color: var(--muted); font-weight: 400; font-size: 0.85rem; }

label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; }
input[type="text"], input[type="password"], input[type="date"], input[type="file"] {
  width: 100%;
  padding: 9px 11px;
  font: inherit;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.hint { color: var(--muted); font-size: 0.85rem; margin: 4px 0 0; }
.form-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.form-row > .field { flex: 1 1 180px; }

button, .button {
  display: inline-block;
  padding: 9px 16px;
  font: inherit;
  font-weight: 600;
  color: var(--on-accent);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
button:hover, .button:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
button.quiet { color: var(--ink); background: transparent; border-color: var(--line); }
button.quiet:hover { background: var(--surface); }
button.danger { color: var(--danger); background: transparent; border-color: var(--line); }
button.danger:hover { background: var(--err-bg); }
button.small { padding: 5px 11px; font-size: 0.875rem; }
form.inline { display: inline; }

.checks { list-style: none; margin: 0 0 16px; padding: 0; }
.checks li { border-bottom: 1px solid var(--line); }
.checks label { display: flex; gap: 12px; align-items: center; padding: 10px 4px; font-weight: 400; margin: 0; cursor: pointer; }
.checks .meta { margin-left: auto; color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.checks input { width: 18px; height: 18px; flex: none; }

.login { max-width: 380px; margin: 9vh auto 0; }
.login h1 { margin-bottom: 20px; }
.login .field { margin-bottom: 14px; }
.login button { width: 100%; margin-top: 6px; }

.figures { display: flex; flex-wrap: wrap; gap: 8px 48px; margin: 0; }
.figures div { min-width: 96px; }
.figures dt { color: var(--muted); font-size: 0.9rem; }
.figures dd { margin: 0; font-size: 1.9rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }

.chart { width: 100%; height: auto; display: block; }
.chart .bar { fill: var(--bar); }
.chart .slot:hover .bar { fill: var(--accent-strong); }
.chart .hit { fill: transparent; }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart text.value { fill: var(--ink); font-weight: 600; font-size: 12px; }

.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.pager { display: flex; gap: 16px; align-items: center; margin-top: 12px; color: var(--muted); font-size: 0.9rem; }
details summary { cursor: pointer; color: var(--muted); font-size: 0.9rem; margin-top: 8px; }
.status-partial { color: var(--danger); }
