:root {
  --bg: #f7f5f0;
  --panel: #ffffff;
  --text: #1f1d1a;
  --muted: #6b665d;
  --line: #e4dfd5;
  --accent: #2f5d50;
  --good: #23784d;
  --bad: #b3412f;
  --c1: #2f5d50;
  --c2: #c48a2c;
  --c3: #6c7fb3;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161513;
    --panel: #201f1c;
    --text: #f1ede4;
    --muted: #a9a294;
    --line: #36332e;
    --accent: #8cc4b0;
    --good: #6cc58f;
    --bad: #f08a76;
    --c1: #8cc4b0;
    --c2: #e2b062;
    --c3: #9fb0e0;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
/* Class display rules (.login is a grid) must not override the hidden attribute. */
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 -apple-system, "Apple SD Gothic Neo", "Pretendard", system-ui, sans-serif; }
h1 { font-size: 18px; margin: 0; }
h2 { font-size: 15px; margin: 0 0 12px; }
button, input, select { font: inherit; color: inherit; }
button { border: 1px solid var(--accent); background: var(--accent); color: var(--panel); border-radius: 8px; padding: 6px 12px; cursor: pointer; }
button.quiet, .presets button { background: transparent; color: var(--accent); }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input, select { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 5px 8px; }
#app { max-width: 1200px; margin: 0 auto; padding: 16px; }
.top { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.range { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.presets { display: flex; gap: 4px; }
section { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 12px 0; }
.note { color: var(--muted); font-size: 12px; margin: 4px 0; }
.status { min-height: 1.5em; color: var(--muted); }
.error { color: var(--bad); min-height: 1.5em; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.card { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.card .label { color: var(--muted); font-size: 12px; }
.card .value { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.card .delta { font-size: 12px; font-variant-numeric: tabular-nums; }
.up { color: var(--good); }
.down { color: var(--bad); }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
figure { margin: 0; }
figcaption { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
svg { width: 100%; height: auto; display: block; }
svg text { fill: var(--muted); font-size: 10px; }
.legend { display: flex; gap: 12px; font-size: 12px; color: var(--muted); margin-top: 4px; }
.legend .swatch { display: inline-block; width: 10px; height: 10px; margin-right: 4px; vertical-align: -1px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 12px; }
dl { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.links { margin: 0; padding-left: 18px; }
a { color: var(--accent); }
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login form { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 24px; width: min(360px, 100%); display: grid; gap: 10px; }
