/* Übersicht des Reichweitenmonitors (templates/) */
:root {
  --bg: #f6f7f9; --card: #fff; --text: #1d2330; --muted: #6b7280; --border: #e5e7eb;
  --accent: #4f6bed; --bar-v: #4f6bed; --bar-pv: #b4c1f7; --accent-soft: rgba(79, 107, 237, .14); --live: #16a34a; --down: #dc2626;
  --warn: #b45309; --warn-soft: rgba(245, 158, 11, .1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418; --card: #1a1f26; --text: #e6e8eb; --muted: #9aa3ae; --border: #2a313a;
    --accent: #7b93ff; --bar-v: #4f6bed; --bar-pv: #a9b8ff; --accent-soft: rgba(123, 147, 255, .18); --live: #4ade80; --down: #f87171;
    --warn: #fbbf24; --warn-soft: rgba(251, 191, 36, .1);
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 48px; }
header { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 20px; }
h1 { font-size: 1.25rem; margin: 0; }
h2 { font-size: .95rem; margin: 0 0 12px; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.grid { display: grid; gap: 16px; }
.cards { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 16px; }
.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); margin-top: 16px; }
.stat .k { font-size: .8rem; color: var(--muted); }
.stat .v { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .s { font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.live .v { color: var(--live); }
.alert { border-color: var(--warn); background: var(--warn-soft); margin-bottom: 16px; }
.alert h2 { color: var(--warn); }
.alert ul { margin: 0 0 8px; padding-left: 20px; }
.alert p { margin: 0; font-size: .85rem; }
.demo-note { border-color: var(--accent); background: var(--accent-soft); margin-bottom: 16px; font-size: .9rem; }
.trend {font-size: .8rem; font-weight: 600; color: var(--muted); vertical-align: middle; cursor: help; }
.trend.up { color: var(--live); }
.trend.down { color: var(--down); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--live); margin-right: 6px; animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
/* Y-Achse links, Balken rechts, Beschriftung darunter */
.plot { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 8px; }
.plot > .axis { grid-column: 2; }
/* Werte gleichmäßig verteilt; der negative Rand setzt die Textmitte auf die Hilfslinien */
.yaxis { display: flex; flex-direction: column; justify-content: space-between; margin: -.6em 0; font-size: .75rem; line-height: 1.2; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.chart { position: relative; display: flex; align-items: flex-end; gap: 3px; height: 140px; }
.chart .gridline { position: absolute; left: 0; right: 0; border-top: 1px solid var(--border); transform: translateY(50%); }
.chart .col { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; }
.chart a.col:hover .pv { opacity: .7; }
/* Aufrufe hell, Besucher dunkel darin; die Höhe der Besucher ist relativ zum Aufruf-Balken */
.chart .pv { display: flex; align-items: flex-end; width: 100%; min-height: 2px; background: var(--bar-pv); border-radius: 3px 3px 0 0; }
.chart .v { display: block; width: 100%; background: var(--bar-v); border-radius: 3px 3px 0 0; }
.chart-head { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.chart-head h2 { margin: 0; }
.legend { display: flex; gap: 12px; font-size: .75rem; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.legend .v::before { background: var(--bar-v); }
.legend .pv::before { background: var(--bar-pv); }
/* Beschriftung je Balken; zentriert darf sie beidseitig über den Balken hinausragen, linksbündig nach rechts */
.axis { display: flex; gap: 3px; font-size: .75rem; line-height: 1.2; color: var(--muted); margin-top: 6px; }
.axis > span { flex: 1 1 0; min-width: 0; display: flex; justify-content: center; text-align: center; white-space: nowrap; }
.axis.left > span { justify-content: flex-start; text-align: left; }
.axis:not(.left) > span:first-child { justify-content: flex-start; }
.axis:not(.left) > span:last-child { justify-content: flex-end; }
@media (max-width: 600px) { .axis .minor { visibility: hidden; } }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: .8rem; padding: 0 6px 6px; }
td { padding: 5px 6px; border-top: 1px solid var(--border); }
.num { text-align: right; width: 80px; font-variant-numeric: tabular-nums; }
td.label { position: relative; }
td.label .bar { position: absolute; left: 0; top: 3px; bottom: 3px; background: var(--accent-soft); border-radius: 4px; }
td.label .text { position: relative; word-break: break-all; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs a { padding: 5px 12px; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; color: var(--text); font-size: .85rem; }
.tabs a.active { background: var(--accent); border-color: var(--accent); color: #fff; }
form.login { max-width: 320px; margin: 15vh auto 0; }
input[type=password] { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; margin: 8px 0 12px; }
button { padding: 10px 16px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font: inherit; cursor: pointer; width: 100%; }
.error { color: #dc2626; }
.snippet { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px; overflow-x: auto; font-size: .85rem; }
