/* ============================================================
   chart-spacing.css – Abstände um Grafiken, Buttons und Zeilen
   ============================================================
   Ersetzt chart-spacing-fix.js. Das Skript hat dieselben Werte per
   jQuery als Inline-Styles gesetzt und dafür bei JEDER Änderung im
   DOM (MutationObserver auf body) alle Elemente neu durchsucht – das
   kostete bei jedem Neuzeichnen der Grafiken spürbar Rechenzeit.

   Warum :where( ... ) und !important:
   Inline-Styles schlagen jede normale Regel, verlieren aber gegen jede
   Regel mit !important. Genau dieses Verhalten bilden die Regeln hier
   nach: !important schlägt alle normalen Regeln, und :where() setzt die
   Spezifität auf 0, sodass jede andere !important-Regel (fonds.css,
   mobile.css, Inline mit !important) weiterhin gewinnt.
   Die Datei wird VOR fonds.css geladen.
   ============================================================ */

/* Grafik-Container und Grafik-Ausgaben ohne Außenabstände */
:where(.highcharts-container, [id*="plot"]) {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* Hülle mit role="figure" um jede Grafik */
:where(div[role="figure"]) {
  margin-bottom: 8px !important;
  padding-bottom: 0 !important;
}

/* Buttons "Datentabelle anzeigen/verbergen" */
:where(.btn-action,
       #datatbl_riskmkt_btn, #strat1-datatbl_cost_btn, #strat1-datatbl_perf_btn,
       #datatbl_subcat_btn, #datatbl_curr_btn) {
  margin-top: 8px !important;
  margin-bottom: 8px !important;
}

/* Zeilen der Seite */
:where(.container-fluid > .row) {
  margin-bottom: 10px !important;
}
:where(.container-fluid > .row + .row) {
  margin-top: 0 !important;
}

/* Spalten mit Grafiken */
:where(.col-sm-6:has(div[role="figure"], [id*="plot"]),
       .col-md-6:has(div[role="figure"], [id*="plot"]),
       .row .col-sm-5) {
  padding-bottom: 10px !important;
}
:where(.row .col-sm-10) {
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}
