/* ClusterDeck – Statistikseite */
.stats-page {
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a;          /* Betriebsarten: Kategorie-Slots 1–3 (validiert) */
  --ink-2: var(--muted);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .stats-page { --s1: #3987e5; --s2: #d95926; --s3: #199e70; }
}
.st-main { padding: 4px clamp(16px, 3vw, 32px) 32px; display: flex; flex-direction: column; gap: 18px; max-width: 1400px; width: 100%; margin: 0 auto; }
.st-bar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.st-bar .hint { margin: 0; color: var(--muted); font-size: .88rem; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-s); overflow: hidden; }
.seg button { appearance: none; border: 0; background: var(--panel); color: var(--muted); padding: 7px 12px; font-weight: 600; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--amber-soft); color: var(--text); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m); padding: 12px 14px; }
.tile .tv { font: 700 1.9rem/1.1 var(--font-data); font-variant-numeric: tabular-nums; }
.tile .tl { color: var(--muted); font-size: .88rem; margin-top: 2px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m); padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.card h2 { margin-bottom: 10px; }
.card .ch { font-size: .9rem; color: var(--muted); font-weight: 600; margin: 10px 0 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }
.chart { width: 100%; position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--muted); font: 500 11px var(--font-data); }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .line { fill: none; stroke: var(--amber); stroke-width: 2; stroke-linejoin: round; }
.chart .area { fill: color-mix(in srgb, var(--amber) 14%, transparent); }
.chart .xh { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .dot { fill: var(--amber); stroke: var(--panel); stroke-width: 2; }
.chart .bar { fill: var(--amber); }
.chart .hm { stroke: var(--panel); stroke-width: 2; }
.chart .hit { fill: transparent; }
.chart .k-q { fill: #4f9d4a; } .chart .k-u { fill: #c9a227; } .chart .k-s { fill: #c8452c; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .88rem; color: var(--text); margin: -4px 0 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.hbars { display: flex; flex-direction: column; gap: 4px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 40%) 1fr auto; gap: 8px; align-items: center; font: 500 .88rem/1.2 var(--font-data); }
.hbar .lb { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.hbar .lb small { color: var(--muted); margin-left: 4px; }
.hbar .tr { display: block; height: 12px; background: var(--panel-2); border-radius: 0 4px 4px 0; overflow: hidden; }
.hbar .fl { display: block; width: 0; height: 100%; background: var(--amber); border-radius: 0 4px 4px 0; }
.hbar .vl { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 4.5em; text-align: right; }
.tip { position: fixed; z-index: 80; pointer-events: none; background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: var(--r-s); padding: 6px 9px; font: 500 .85rem/1.35 var(--font-data); box-shadow: var(--shadow); max-width: 240px; }
.tip b { font-weight: 700; }

.st-copy { margin: 18px 0 0; font-size: .74rem; color: var(--muted); opacity: .8; }
.st-copy.foot-thanks { margin-top: 2px; opacity: .7; }
