:root {
  color-scheme: light;
  --page: #f4f4f1;
  --surface: #fcfcfb;
  --border: #e3e2dc;
  --grid: #ecebe6;
  --text: #0b0b0b;
  --text-2: #52514e;
  --series: #2a78d6;
  --series-2: #eb6834;
  --good: #137a4b;
  --bad: #b3302f;
  --notice-bg: #fdf3dc;
  --notice-text: #5f4300;
  --step-1: #85b3e9; --step-2: #5f9be2; --step-3: #2a78d6; --step-4: #1f5fb0; --step-5: #164586;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #111110;
    --surface: #1a1a19;
    --border: #30302d;
    --grid: #282825;
    --text: #f0efec;
    --text-2: #c3c2b7;
    --series: #3987e5;
    --series-2: #d95926;
    --good: #4cc38a;
    --bad: #f08080;
    --notice-bg: #33290f;
    --notice-text: #f3d68c;
    --step-1: #1f4f8c; --step-2: #2a68b5; --step-3: #3987e5; --step-4: #6ba6ec; --step-5: #a3c8f3;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.wrap { max-width: 1120px; margin: 0 auto; padding: 32px 24px 48px; }
.top { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: flex-end; margin-bottom: 20px; }
.eyebrow { margin: 0 0 2px; color: var(--text-2); font-size: 13px; }
h1 { margin: 0; font-size: 28px; line-height: 1.2; }
h2 { margin: 0; font-size: 16px; }
.sub { margin: 2px 0 14px; color: var(--text-2); font-size: 13px; }

.range { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 3px; }
.range button { border: 0; background: none; color: var(--text-2); font: inherit; font-size: 14px; padding: 6px 12px; border-radius: 6px; cursor: pointer; min-height: 36px; }
.range button[aria-pressed="true"] { background: var(--text); color: var(--surface); }

[hidden] { display: none !important; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs button { border: 0; background: none; color: var(--text-2); font: inherit; font-weight: 600; padding: 10px 14px; min-height: 44px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--text); }
.legend { display: flex; gap: 16px; margin-bottom: 8px; font-size: 13px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }
.empty { color: var(--text-2); font-size: 13px; margin: 0; }
.bars.wide .bar-row { grid-template-columns: 190px minmax(0, 1fr) 60px; }
.bars.wide .bar-name { direction: rtl; text-align: left; }
.notice { margin: 0 0 16px; padding: 10px 14px; border-radius: 8px; background: var(--notice-bg); color: var(--notice-text); font-size: 14px; }

.note { margin: -4px 0 16px; color: var(--text-2); font-size: 13px; }

.card, .tile { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.card { padding: 18px 20px; margin-bottom: 16px; min-width: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { padding: 14px 16px; }
.tile .label { color: var(--text-2); font-size: 13px; }
.tile .value { font-size: 30px; font-weight: 600; line-height: 1.25; font-variant-numeric: tabular-nums; }
.tile .delta { font-size: 13px; color: var(--text-2); }
.delta b { font-weight: 600; }
.delta .up { color: var(--good); }
.delta .down { color: var(--bad); }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

.plot svg { display: block; width: 100%; height: 260px; overflow: visible; }
.plot text { fill: var(--text-2); font-size: 12px; }
.plot .gridline { stroke: var(--grid); }
.plot .line { fill: none; stroke: var(--series); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.plot .cross { stroke: var(--text-2); stroke-dasharray: 3 3; }
.plot .dot { fill: var(--series); stroke: var(--surface); stroke-width: 2; }

.bar-row { display: grid; grid-template-columns: 112px minmax(0, 1fr) 84px; gap: 10px; align-items: center; padding: 5px 0; border-radius: 4px; }
.bar-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 14px; }
.bar { height: 100%; min-width: 2px; border-radius: 0 4px 4px 0; background: var(--series); }
.bar-val { font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-val span { color: var(--text-2); }

summary { cursor: pointer; font-weight: 600; min-height: 24px; }
.tablewrap { overflow-x: auto; margin-top: 12px; max-height: 340px; overflow-y: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
th, td { padding: 6px 10px; text-align: right; border-bottom: 1px solid var(--grid); white-space: nowrap; }
th { position: sticky; top: 0; background: var(--surface); color: var(--text-2); font-weight: 500; }
th:first-child, td:first-child { text-align: left; }

footer { color: var(--text-2); font-size: 13px; }

.tip { position: fixed; z-index: 10; pointer-events: none; background: var(--text); color: var(--surface); padding: 6px 10px; border-radius: 6px; font-size: 13px; white-space: nowrap; }

@media (max-width: 800px) {
  .bars.wide .bar-row { grid-template-columns: 130px minmax(0, 1fr) 56px; }
  .wrap { padding: 20px 16px 32px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .tile .value { font-size: 24px; }
}

.logout { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); }
.logout button, .login button { font: inherit; cursor: pointer; border-radius: 8px; min-height: 40px; }
.logout button { background: none; border: 1px solid var(--border); color: var(--text); padding: 6px 12px; }
.login { max-width: 400px; margin: 10vh auto; padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.login h1 { font-size: 22px; margin-bottom: 6px; }
.login p { color: var(--text-2); font-size: 14px; margin: 0 0 16px; }
.login label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 14px; }
.login input { display: block; width: 100%; margin-top: 4px; padding: 10px; font: inherit; font-weight: 400; color: var(--text); background: var(--page); border: 1px solid var(--border); border-radius: 8px; }
.login button { width: 100%; border: 0; background: var(--text); color: var(--surface); font-weight: 600; }
.login .error { color: var(--bad); }
