:root {
  color-scheme: light;
  --bg: #f4f4f1;
  --surface: #fcfcfb;
  --text: #0b0b0b;
  --text2: #52514e;
  --muted: #6f6d67;
  --line: #e3e2dc;
  --grid: #ececE7;
  --s1: #2a78d6;
  --s2: #eb6834;
  --s3: #1baf7a;
  --good: #0a7a4f;
  --bad: #b3261e;
  --chip: #eceae4;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111110;
    --surface: #1a1a19;
    --text: #f0efec;
    --text2: #c3c2b7;
    --muted: #9b9a92;
    --line: #2d2d2a;
    --grid: #262624;
    --s1: #3987e5;
    --s2: #d95926;
    --s3: #199e70;
    --good: #4cc38a;
    --bad: #ff8a80;
    --chip: #262624;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111110;
  --surface: #1a1a19;
  --text: #f0efec;
  --text2: #c3c2b7;
  --muted: #9b9a92;
  --line: #2d2d2a;
  --grid: #262624;
  --s1: #3987e5;
  --s2: #d95926;
  --s3: #199e70;
  --good: #4cc38a;
  --bad: #ff8a80;
  --chip: #262624;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
}
h1 { font-size: 18px; margin: 0; }
h2 { font-size: 16px; margin: 0 0 10px; }
.muted { color: var(--muted); }
.wrap { max-width: 980px; margin: 0 auto; padding: 16px; }
.top { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.top-in { max-width: 980px; margin: 0 auto; padding: 12px 16px 10px; display: grid; gap: 10px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
.tab, .seg button, .btn {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 12px; cursor: pointer; white-space: nowrap; min-height: 36px;
}
.tab .n { margin-left: 6px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tab[aria-pressed="true"], .seg button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.tab[aria-pressed="true"] .n { color: inherit; opacity: .75; }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.custom { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.custom input { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; min-height: 36px; }
.note { font-size: 13px; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.card, .sec { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.sec { margin-bottom: 14px; }
.card .lbl { color: var(--text2); font-size: 13px; }
.card .val { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 2px 0; }
.card .dlt { font-size: 13px; color: var(--muted); }
.dlt.up { color: var(--good); }
.dlt.down { color: var(--bad); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--text2); margin-bottom: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.legend i.l { height: 3px; width: 14px; border-radius: 2px; vertical-align: 3px; }
.c1 { background: var(--s1); }
.c2 { background: var(--s2); }
.c3 { background: var(--s3); }
.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; }
.tip {
  position: absolute; pointer-events: none; z-index: 3; background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; font-size: 13px; box-shadow: 0 2px 8px rgba(0,0,0,.18);
  white-space: nowrap; transform: translate(-50%, -100%);
}
.tip b { display: block; margin-bottom: 2px; }
svg text { fill: var(--muted); font-size: 11px; font-family: inherit; }
svg .grid { stroke: var(--grid); stroke-width: 1; }
svg .hov { fill: var(--text); opacity: 0; }
svg .hov.on { opacity: .06; }
.barv { fill: var(--s1); }
.barn { fill: var(--s3); }
.linep { fill: none; stroke: var(--s2); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.dotp { fill: var(--s2); stroke: var(--surface); stroke-width: 2; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: right; padding: 7px 8px; border-bottom: 1px solid var(--line); font-size: 14px; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--text2); font-weight: 600; font-size: 13px; }
.tbl { overflow-x: auto; }
.tbl.tall { max-height: 360px; overflow-y: auto; }
.tbl td.path { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hb { display: grid; grid-template-columns: 92px 1fr 112px; align-items: center; gap: 8px; margin: 6px 0; font-size: 14px; }
.hb .tr { background: var(--chip); border-radius: 4px; height: 10px; overflow: hidden; }
.hb .fl { background: var(--s1); height: 100%; border-radius: 4px; }
.hb .pc { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; color: var(--text2); }
.list { margin: 8px 0 0; padding: 0; list-style: none; }
.list li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.list li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub { font-size: 13px; color: var(--text2); margin: 10px 0 0; }
.foot { font-size: 13px; color: var(--muted); }
.foot p { margin: 4px 0; }
.empty { color: var(--muted); padding: 8px 0; font-size: 14px; }
.error { color: var(--bad); }
.locked { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.lock-card { max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.lock-card h1 { margin-bottom: 10px; }
.site-links { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.site-links a { display: inline-block; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); text-decoration: none; }
@media (max-width: 720px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .card .val { font-size: 22px; }
  .hb { grid-template-columns: 72px 1fr 100px; font-size: 13px; }
  th, td { padding: 6px 5px; font-size: 13px; }
}
