/* Oasis UI-Prototyp — Regeln für den Tab "Dynamische Simulation" (#tab-simulation).
   Ausgelagert aus prototype.css: die Datei stand bei 776 Zeilen, dieser Block hätte sie
   über das 800-Zeilen-Limit gehoben. Fachlich gehört er ohnehin zusammen — Zeitreihen-Karte,
   Vorschau-Kennzeichnung und das Ereignis-Paar sind EIN Feature. Wird NACH prototype.css
   geladen; es sind ausschließlich neue Klassen, keine Overrides. */

/* ── ZEITREIHEN-KARTE (der Hero des Sim-Tabs) ─────────────────────────────── */
/* Vorher: 320-px-Container mit einem unbemalten 300x150-Canvas darin = weisses Loch.
   Jetzt steht ab dem Tab-Oeffnen der Referenzlauf drin (render/sim-view.js) — die Karte
   darf entsprechend Praesenz haben: hoeher als die Nachbarn und leicht angehoben. */
.sim-chart-card { margin-bottom: 20px; box-shadow: var(--shadow-md); }
.sim-chart-card .card-title { margin-bottom: 12px; }
.sim-chart-box { height: 380px; position: relative; }
.chart-tab-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }

/* Vorschau- vs. Live-Kennzeichnung: Sand = statische Referenz, Gruen = dein Lauf.
   Farbe ist hier NICHT Dekoration, sondern die Aussage "wessen Zahlen sind das". */
.sim-badge--ref { background: var(--sand-bg); color: var(--orange); border: 1px solid var(--sand-lt); }
.sim-badge--live { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-lt); }

.sim-chart-banner {
  font-size: 12px; line-height: 1.55; color: var(--text-dim);
  border-radius: 10px; padding: 10px 14px; margin-bottom: 16px;
  border-left: 3px solid var(--border); background: var(--surface2);
}
.sim-chart-banner strong { color: var(--text); }
.sim-chart-banner code {
  font-family: var(--mono); font-size: 11px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; white-space: nowrap;
}
.sim-chart-banner.is-ref { border-left-color: var(--sand); background: var(--sand-bg); }
.sim-chart-banner.is-live { border-left-color: var(--green); background: var(--green-bg); }

/* ── EREIGNIS-KARTEN: Live-Ereignisprotokoll + Alarm-Zentrum (je GANZFLÄCHIG) ──
   Nutzer-Wunsch: beide gestapelt, jeweils VOLLE Breite, direkt unter die Zeitreihen —
   das Protokoll zuerst (Roh-Verlauf an den Kurven, die es erklärt), das Alarm-Zentrum
   darunter (gebündelte Auswertung). Nicht mehr als 2-Spalten-Paar (.sim-eventrow ist
   damit abgelöst; die alte minmax-Grid-Regel entfiel). */
.sim-eventcard { display: flex; flex-direction: column; }
.sim-fullwide { margin-bottom: 20px; }
.sim-fullwide .alarm-list { max-height: 260px; }
.sim-fullwide .term-console { height: 240px; }

/* ── ZEIT-STEUERUNG: Dauer ⇄ Backtesting (kompakt, oben in der Kopfleiste) ─────
   Ersetzt die frühere große Backtesting-Box. Segmented-Toggle wählt den Modus;
   der Aktiv-Zustand der Kennzeichnungs-Zeile nutzt den Grün-Akzent (= "echte ERA5-
   Daten eingespeist"). Warm/erdig wie der Rest der App. */
.sim-hb-time { gap: 7px; }
.sim-time-toggle {
  display: inline-flex; padding: 2px; gap: 2px; width: max-content;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 8px;
}
.sim-tmode {
  font-family: var(--sans); font-size: 11.5px; font-weight: 700; letter-spacing: .02em;
  padding: 4px 13px; border: 0; border-radius: 6px; cursor: pointer;
  background: transparent; color: var(--text-dim); transition: all .15s ease;
}
.sim-tmode:hover { color: var(--text); }
.sim-tmode.active { background: var(--surface); color: var(--green); box-shadow: var(--shadow-sm); }
.sim-time-pane[hidden] { display: none; }
.sim-bt-inline { display: flex; align-items: center; gap: 6px; }
.sim-date { min-width: 138px; }
.sim-bt-dash { color: var(--text-dim); font-weight: 700; }
.sim-hb-time .sim-bt-btn { width: auto; padding: 8px 13px; font-size: 12px; }

/* Kompakte Kennzeichnungs-Zeile unter der Kopfleiste (ersetzt die große Box).
   Zustände: hint (Modus aktiv, nicht angewendet) · load · err · ok. */
.sim-bt-readout {
  font-size: 12.5px; line-height: 1.55; border-radius: 10px; padding: 9px 13px;
  border: 1px solid var(--border); background: var(--surface2); color: var(--text-dim);
  margin: 0 0 16px;
}
.sim-bt-readout[hidden] { display: none; }
.sim-bt-readout strong { color: var(--text); }
.sim-bt-readout--hint,
.sim-bt-readout--load { color: var(--text); background: var(--sand-bg); border-color: var(--sand-lt); }
.sim-bt-readout--err { color: #9C3B2E; background: #FBEDE9; border-color: #E8C4BB; }
.sim-bt-readout--err strong { color: #9C3B2E; }
.sim-bt-readout--ok { color: var(--text); background: var(--green-bg); border-color: var(--green-lt); }
.sim-bt-line { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 14px; }
.sim-bt-tag { font-weight: 700; color: var(--green); }
.sim-bt-line b { font-family: var(--mono); color: var(--green); }
.sim-bt-details { margin-top: 9px; }
.sim-bt-details > summary {
  cursor: pointer; user-select: none; font-size: 11.5px; font-weight: 600; color: var(--text-dim);
}
.sim-bt-details > summary:hover { color: var(--text); }
.sim-bt-details[open] > summary { margin-bottom: 9px; }

.bt-params { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.bt-params td { padding: 4px 8px 4px 0; vertical-align: top; font-size: 12.5px; }
.bt-params td:first-child { white-space: nowrap; color: var(--text-dim); font-weight: 600; width: 1%; }
.bt-params b { font-family: var(--mono); color: var(--green); }
.bt-src { font-style: italic; color: var(--orange); font-size: 11px; }
.bt-honest {
  font-size: 11.5px; line-height: 1.6; color: var(--text-dim); background: var(--surface);
  border-left: 3px solid var(--orange); border-radius: 6px; padding: 9px 12px; margin-bottom: 10px;
}
.bt-honest strong { color: var(--orange); }
.bt-honest u { text-decoration-color: var(--orange); }
.bt-cta-hint { font-size: 12px; color: var(--text); font-weight: 600; }

/* Aufklappbares Rohprotokoll (offen als Default — es faellt nichts weg). */
.sim-fold > summary { cursor: pointer; user-select: none; list-style: none; margin-bottom: 0; }
.sim-fold > summary::-webkit-details-marker { display: none; }
.sim-fold-head { display: flex; align-items: center; gap: 8px; }
.sim-fold-head .term-console-title { flex: 1; }
.sim-fold-chevron { font-size: 11px; color: var(--text-dim); transition: transform .2s ease; }
.sim-fold[open] > summary .sim-fold-chevron { transform: rotate(180deg); }
.sim-fold[open] > summary { margin-bottom: 10px; }
.sim-fold > summary:hover .term-console-title { color: var(--text); }
