/* Gemeinsame native Diagrammansicht: dieselben Farben, Schriften und Bedienelemente wie die GUI.
   Der Plot wächst im vorhandenen Diagrammrahmen; Größenwechsel benötigen keine Datenabfrage. */
.diagramm-ansicht { height:100%; min-height:0; display:flex; flex-direction:column; gap:12px; }
.diagramm-ansicht .page-tools { margin:0; }
.diagramm-legende { display:flex; flex-wrap:wrap; gap:6px 10px; }
.diagramm-legende button { display:inline-flex; align-items:center; gap:7px; padding:6px 9px; color:var(--ink); background:transparent; border:1px solid var(--line); border-radius:8px; font:inherit; cursor:pointer; }
.diagramm-legende i { width:14px; height:3px; border-radius:2px; background:var(--reihe); }
.diagramm-legende button[aria-pressed="false"] { color:var(--muted); opacity:.6; }
.diagramm-legende button[aria-pressed="false"] i { background:var(--muted); }
.diagramm-werkzeuge { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px; }
.diagramm-zeitraum { display:flex; padding:3px; border-radius:9px; background:var(--accent-soft); gap:2px; }
.diagramm-zeitraum button { color:var(--muted); font:inherit; background:transparent; border:0; border-radius:6px; padding:5px 10px; cursor:pointer; }
.diagramm-zeitraum button[aria-pressed="true"] { background:var(--surface); color:var(--ink); box-shadow:0 1px 4px rgba(0,0,0,.08); }
/* Die Pfeile bilden nur bei aktivem Stundenzoom eine eigene, schmale Bediengruppe. */
.diagramm-navigation { display:flex; gap:2px; margin-inline-end:auto; }
.diagramm-navigation[hidden] { display:none; }
.diagramm-navigation button { min-width:34px; padding:5px 8px; border:1px solid var(--line); border-radius:6px; background:var(--surface); color:var(--ink); font:inherit; cursor:pointer; }
.diagramm-navigation button:disabled { opacity:.4; cursor:default; }
/* Original behält seine bisherige Werkzeugauswahl ohne die neuen Zoomwerkzeuge. */
html[data-appearance="original"] .diagramm-zeitraum button[data-stunden="3"],
html[data-appearance="original"] .diagramm-navigation { display:none!important; }
.diagramm-plot { flex:1; min-height:210px; position:relative; --ofen:#b85338; --oben:#188b7a; --unten:#347cba; --ladung:#8763b5; --brenner:#71838e; --pumpe:#c39038; --entnahme:#3d9870; --ruecklauf:#bf6b39; }
html[data-theme="dark"] .diagramm-plot { --ofen:#f1a082; --oben:#76d1b3; --unten:#85bde8; --ladung:#c6a6f0; --brenner:#bcc7cc; --pumpe:#dfb75e; --entnahme:#78c79e; --ruecklauf:#edb47a; }
.diagramm-svg { display:block; width:100%; height:100%; overflow:visible; touch-action:pan-y; font:inherit; }
.diagramm-svg text { fill:var(--muted); font-size:12px; font-family:inherit; }
.diagramm-gitter { stroke:var(--line); stroke-opacity:.55; stroke-dasharray:2 5; }
.diagramm-linie { fill:none; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round; }
.diagramm-faden { stroke:var(--muted); stroke-width:1; stroke-dasharray:3 4; }
.diagramm-wertfenster { position:absolute; top:30px; z-index:4; width:205px; max-width:calc(100% - 16px); padding:12px; border:1px solid var(--line); border-radius:12px; background:color-mix(in srgb,var(--surface) 95%,transparent); backdrop-filter:blur(16px); box-shadow:0 8px 24px rgba(0,0,0,.16); pointer-events:none; color:var(--ink); }
.diagramm-wertfenster[hidden],.diagramm-leer[hidden] { display:none; }
.diagramm-wertfenster strong { display:block; margin-bottom:7px; }
.diagramm-wertfenster dl { margin:0; display:grid; gap:5px; }
.diagramm-wertfenster dl > div { display:flex; justify-content:space-between; gap:12px; }
.diagramm-wertfenster dd { margin:0; font-weight:600; white-space:nowrap; }
.diagramm-leer { color:var(--muted); text-align:center; }
@media(max-width:650px) {
    .diagramm-ansicht { gap:8px; }
    .diagramm-legende { gap:5px; }
    .diagramm-legende button { padding:5px 7px; }
    .diagramm-zeitraum button { padding:5px 8px; }
    .diagramm-navigation button { min-width:32px; padding:5px 7px; }
    #diagramm-neuladen span { display:none; }
}

/* Betriebszustände sind vollflächige, zurückhaltende Hintergründe mit exakten
   senkrechten Schaltkanten. Überlappende Zustände bleiben gemeinsam erkennbar. */
.diagramm-betriebsflaeche { opacity:.1; }
.diagramm-schaltkante { fill:none; stroke-width:1; opacity:.38; }
.diagramm-legende button[data-zustand="true"] i { height:10px; width:12px; opacity:.7; }
/* Derselbe Renderer übernimmt in den historischen Oberflächen deren kantige
   Bedienelemente, Schriften und festen Systemfarben. Terminal benutzt ihn nicht. */
html:not([data-appearance="modern"]) .diagramm-ansicht :is(button,.diagramm-zeitraum,.diagramm-wertfenster) {
    border-radius:0; box-shadow:none; backdrop-filter:none; font:inherit;
}
html:not([data-appearance="modern"]) .diagramm-ansicht button { border:2px outset #ddd; background:#ddd; color:#000; }
html:not([data-appearance="modern"]) .diagramm-ansicht button[aria-pressed="true"] { border-style:inset; }
html:not([data-appearance="modern"]) .diagramm-plot { --ofen:#a00000; --oben:#007000; --unten:#0000b0; --ladung:#800080; --brenner:#666; --pumpe:#ad7900; --entnahme:#007000; --ruecklauf:#a00000; }

/* Die Vergleichsoption bleibt unabhängig vom Zeitraum erreichbar und benötigt
   auf schmalen Displays keine horizontale Werkzeugleiste. */
.diagramm-vergleich { display:flex; align-items:center; flex-wrap:wrap; gap:7px 12px; }
.diagramm-vergleich small { color:var(--muted); flex:1; min-width:180px; }

/* Halbtransparente Verbrauchsflächen lassen beide Reihen und das Raster erkennen. */
.diagramm-verbrauchsflaeche { opacity:.23; stroke:none; }
