:root {
  color-scheme: light;
  --surface-1:      #fcfcfb;
  --page:           #f9f9f7;
  --text-primary:   #0b0b0b;
  --text-secondary: #52514e;
  --text-muted:     #898781;
  --gridline:       #e1e0d9;
  --baseline:       #c3c2b7;
  --border:         rgba(11,11,11,0.10);
  --good:           #006300;

  --series-1: #2a78d6; /* blue     — Услуги-пакеты */
  --series-2: #1baf7a; /* aqua     — Консультации/менторство */
  --series-3: #eda100; /* yellow   — Партнёрки */
  --series-4: #008300; /* green    — Цифровые продукты */
  --series-5: #4a3aa7; /* violet   — Контент-завод агентствам */
  --series-6: #e34948; /* red      — pSEO-витрины */
  --series-7: #e87ba4; /* magenta  — Доход с аудитории */
  --series-8: #eb6834; /* orange   — Лиды ITMagic (вне зачёта) */

  --status-good: #0ca30c;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --surface-1:      #1a1a19;
    --page:           #0d0d0d;
    --text-primary:   #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted:     #898781;
    --gridline:       #2c2c2a;
    --baseline:       #383835;
    --border:         rgba(255,255,255,0.10);
    --good:           #0ca30c;

    --series-1: #3987e5;
    --series-2: #199e70;
    --series-3: #c98500;
    --series-4: #008300;
    --series-5: #9085e9;
    --series-6: #e66767;
    --series-7: #d55181;
    --series-8: #d95926;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-1:      #1a1a19;
  --page:           #0d0d0d;
  --text-primary:   #ffffff;
  --text-secondary: #c3c2b7;
  --text-muted:     #898781;
  --gridline:       #2c2c2a;
  --baseline:       #383835;
  --border:         rgba(255,255,255,0.10);
  --good:           #0ca30c;

  --series-1: #3987e5;
  --series-2: #199e70;
  --series-3: #c98500;
  --series-4: #008300;
  --series-5: #9085e9;
  --series-6: #e66767;
  --series-7: #d55181;
  --series-8: #d95926;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

header.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

header.top h1 {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}

header.top .updated {
  font-size: 13px;
  color: var(--text-muted);
}

.notice {
  border: 1px solid var(--border);
  background: var(--surface-1);
  border-radius: 10px;
  padding: 16px 18px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 20px;
}
.notice code {
  background: var(--gridline);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 13px;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
@media (max-width: 720px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
}

.tile {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.tile .label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.tile .value {
  font-size: 26px;
  font-weight: 600;
  font-variant-numeric: proportional-nums;
}
.tile.hero .value { font-size: 40px; }
.tile .delta {
  font-size: 12px;
  margin-top: 4px;
  color: var(--text-muted);
}
.tile .delta.good { color: var(--good); }

.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px 12px;
  margin-bottom: 20px;
}
.card h2 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--text-primary);
}
.card .subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin: -8px 0 12px;
}

.chart-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 800px) {
  .chart-row { grid-template-columns: 1fr; }
}

svg.chart { display: block; width: 100%; height: auto; overflow: visible; }
svg.chart text { fill: var(--text-muted); font-size: 11px; font-family: inherit; }
svg.chart .axis-line { stroke: var(--baseline); stroke-width: 1; }
svg.chart .gridline { stroke: var(--gridline); stroke-width: 1; }
svg.chart .value-label { fill: var(--text-secondary); font-size: 11px; }
svg.chart .bar { transition: opacity .1s; cursor: pointer; }
svg.chart .bar:hover, svg.chart .bar.hovered { opacity: 0.75; }
svg.chart .bar.muted { opacity: 0.45; }
svg.chart .line-path { fill: none; stroke: var(--series-1); stroke-width: 2; }
svg.chart .crosshair { stroke: var(--baseline); stroke-width: 1; pointer-events: none; }
svg.chart .ladder-line { stroke: var(--text-muted); stroke-width: 1; stroke-dasharray: 3 3; }
svg.chart .ladder-label { fill: var(--text-muted); font-size: 10px; }

.tooltip {
  position: fixed;
  pointer-events: none;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  z-index: 20;
  display: none;
  min-width: 140px;
}
.tooltip .t-title { color: var(--text-muted); margin-bottom: 4px; }
.tooltip .t-row { display: flex; justify-content: space-between; gap: 12px; }
.tooltip .t-row .v { font-weight: 600; color: var(--text-primary); }
.tooltip .t-row .k { color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }
.tooltip .swatch { width: 10px; height: 2px; display: inline-block; }

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data-table th, table.data-table td {
  text-align: left;
  padding: 6px 10px;
  border-bottom: 1px solid var(--gridline);
  white-space: nowrap;
}
table.data-table td.num { font-variant-numeric: tabular-nums; text-align: right; }
table.data-table th { color: var(--text-muted); font-weight: 500; font-size: 12px; }
table.data-table tr.expense td.num.amount { color: var(--text-secondary); }
table.data-table tr.out-of-scope { opacity: 0.5; }
.table-scroll { overflow-x: auto; }

.toggle-table {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}
.toggle-table:hover { color: var(--text-primary); }

footer {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 12px;
}
footer a { color: inherit; }
