:root {
  color-scheme: light;
  --bg: #f2f2f7;
  --surface-1: #ffffff;
  --text-primary: #191919;
  --text-secondary: #666666;
  --grid: #e5e5ea;
  --series-1: #257de0;
  --accent: #257de0;
  --error: #c0362c;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #000000;
    --surface-1: #191919;
    --text-primary: #efefef;
    --text-secondary: #9c9c9c;
    --grid: #2c2c2e;
    --series-1: #338ced;
    --accent: #338ced;
    --error: #ff6b5e;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font: 17px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}
.hidden { display: none !important; }
.muted { color: var(--text-secondary); font-size: 14px; }

main, .login {
  max-width: 640px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 24px) 16px calc(env(safe-area-inset-bottom) + 32px);
}
header { margin-bottom: 20px; }
h1 { font-size: 34px; font-weight: 700; margin: 0; letter-spacing: -0.02em; }
h2 { font-size: 17px; font-weight: 600; margin: 0; }
.eyebrow { margin: 0 0 2px; color: var(--text-secondary); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }

.btn {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.btn:active { opacity: 0.8; }
.status { margin: 10px 2px 0; font-size: 15px; color: var(--text-secondary); }
.status.error, .error { color: var(--error); }

.card { margin-top: 20px; padding: 16px; border-radius: 16px; background: var(--surface-1); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }

.chart { position: relative; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .axis-label { fill: var(--text-secondary); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart .line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .crosshair { stroke: var(--text-secondary); stroke-width: 1; }
.chart .dot { fill: var(--series-1); stroke: var(--surface-1); stroke-width: 2; }
.chart .empty { padding: 40px 0; text-align: center; color: var(--text-secondary); font-size: 15px; }
.tooltip {
  position: absolute;
  top: 0;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--surface-1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  pointer-events: none;
  white-space: nowrap;
  font-size: 13px;
  color: var(--text-secondary);
  transform: translateX(-50%);
}
.tooltip b { color: var(--text-primary); font-size: 15px; font-variant-numeric: tabular-nums; }

.login h1 { text-align: center; margin: 40px 0 24px; }
.login form { display: grid; gap: 12px; }
.login input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--grid);
  border-radius: 12px;
  background: var(--surface-1);
  color: var(--text-primary);
  font: inherit;
}
.login .error { margin: 0; font-size: 15px; }
