/* Design des Trading-Bots: dunkel als Standard, hell zum Umschalten.
   Alle Farben stehen als Rollen ganz oben. Die Textfarben sind auf beiden Flächen gut lesbar. */

:root {
  color-scheme: dark;
  --seite: #0d0d0d;
  --flaeche: #1a1a19;
  --flaeche-hover: #232321;
  --rand: rgba(255, 255, 255, 0.10);
  --feld-rand: rgba(255, 255, 255, 0.24);
  --linie: #2c2c2a;
  --text: #f0efec;
  --text-2: #c3c2b7;
  --text-leise: #898781;
  --plus: #0ca30c;
  --minus: #e66767;
  --akzent-text: #6da7ec;
  --akzent: #256abf;
  --gut: #0ca30c;
  --warnung: #fab219;
  --warnung-text: #fab219;
  --kritisch: #d03b3b;
  --kritisch-text: #e66767;
  --warnung-flaeche: rgba(250, 178, 25, 0.12);
  --akzent-flaeche: rgba(37, 106, 191, 0.16);
  --kritisch-flaeche: rgba(208, 59, 59, 0.16);
  /* Charts: geprüft auf Unterscheidbarkeit, auch bei Farbsehschwäche */
  --kerze-hoch: #199e70;
  --kerze-runter: #e66767;
  --linie-1: #3987e5;
  --linie-2: #c3c2b7;
  --bezug: #898781;
  --chart-gitter: #2c2c2a;
}

:root[data-theme="light"] {
  color-scheme: light;
  --seite: #f9f9f7;
  --flaeche: #fcfcfb;
  --flaeche-hover: #f0efec;
  --rand: rgba(11, 11, 11, 0.10);
  --feld-rand: rgba(11, 11, 11, 0.32);
  --linie: #e1e0d9;
  --text: #0b0b0b;
  --text-2: #52514e;
  --text-leise: #52514e;
  --plus: #006300;
  --minus: #b42d2d;
  --akzent-text: #1c5cab;
  --akzent: #256abf;
  --warnung-text: #8a5a00;
  --kritisch-text: #b42d2d;
  --warnung-flaeche: rgba(250, 178, 25, 0.18);
  --akzent-flaeche: rgba(37, 106, 191, 0.10);
  --kritisch-flaeche: rgba(208, 59, 59, 0.10);
  --kerze-hoch: #199e70;
  --kerze-runter: #e34948;
  --linie-1: #2a78d6;
  --linie-2: #52514e;
  --bezug: #898781;
  --chart-gitter: #e1e0d9;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--seite);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

.unsichtbar { position: absolute; width: 0; height: 0; overflow: hidden; }
.versteckt { display: none !important; }
/* Eine englische Seite bleibt unsichtbar, bis gemeinsam.js die Texte übersetzt hat. So blitzt kein Deutsch auf. */
html[lang="en"]:not(.uebersetzt) body { visibility: hidden; }

/* ---------- Kopf ---------- */

.kopf {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 24px;
  background: var(--flaeche);
  border-bottom: 1px solid var(--rand);
  position: sticky;
  top: 0;
  z-index: 10;
}

.marke { font-weight: 650; font-size: 17px; white-space: nowrap; }

.schild.echt { color: var(--gut); border-color: var(--gut); }
.schild {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--warnung);
  color: var(--warnung-text);
  font-size: 12px;
  font-weight: 600;
  vertical-align: 2px;
}

.navigation { display: flex; gap: 4px; flex: 1; }
.navigation a, .navigation .bald {
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--text-2);
  text-decoration: none;
}
.navigation a.aktiv { color: var(--text); background: var(--flaeche-hover); font-weight: 600; }
.navigation .bald { color: var(--text-leise); cursor: default; }

.aktionen { display: flex; gap: 8px; }

/* ---------- Knöpfe ---------- */

.knopf {
  font: inherit;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--rand);
  cursor: pointer;
  min-height: 38px;
}
.knopf:focus-visible, .auswahl:focus-visible { outline: 2px solid var(--akzent-text); outline-offset: 2px; }
.knopf.leise { background: transparent; color: var(--text); }
.knopf.leise:hover { background: var(--flaeche-hover); }
.knopf.haupt { background: var(--akzent); border-color: var(--akzent); color: #ffffff; }
.knopf.notaus { background: var(--kritisch); border-color: var(--kritisch); color: #ffffff; letter-spacing: 0.02em; }
.knopf.notaus:hover { filter: brightness(1.08); }
/* Gesperrt heißt meist „gerade nichts zu tun“, zum Beispiel Speichern, wenn alles gespeichert ist. Darum der normale Pfeil.
   Bis zum 18.11.2026 stand hier der Wartekreis, Sven hielt das Profil deshalb für hängengeblieben. */
.knopf:disabled { opacity: 0.6; cursor: default; }

/* ---------- Inhalt ---------- */

.inhalt { max-width: 1280px; margin: 0 auto; padding: 20px 24px 32px; display: grid; gap: 16px; }

.statuszeile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: 10px;
  font-weight: 600;
}
.statuszeile .status-symbol { display: inline-flex; }
.statuszeile.laeuft .status-symbol { color: var(--gut); }
.statuszeile.gestoppt { background: var(--warnung-flaeche); border-color: var(--warnung); }
.statuszeile.gestoppt .status-symbol { color: var(--warnung); }
.statuszeile.aus { background: var(--kritisch-flaeche); border-color: var(--kritisch); }
.statuszeile.aus .status-symbol { color: var(--kritisch); }
.statuszeile .knopf { margin-left: auto; }
.status-zusatz { font-weight: 400; color: var(--text-2); }

.warnungen { display: grid; gap: 8px; }
.warnung {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 16px;
  background: var(--warnung-flaeche);
  border: 1px solid var(--warnung);
  border-radius: 10px;
}
.warnung svg { color: var(--warnung); flex: none; margin-top: 2px; }
.warnung .seit { color: var(--text-2); margin-left: 6px; }

/* ---------- Kennzahlen ---------- */

.kennzahlen { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 16px; }
.kennzahlen.fuenf { grid-template-columns: 2fr repeat(4, 1fr); }

.kachel {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
  min-width: 0;
}
.kachel-label { color: var(--text-2); font-size: 14px; }
.kachel-wert { font-size: 28px; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.kachel.held .kachel-wert { font-size: 48px; }
.kachel-delta, .kachel-unten { color: var(--text-2); font-size: 14px; }
.kachel-delta.plus { color: var(--plus); font-weight: 600; }
.kachel-delta.minus { color: var(--minus); font-weight: 600; }

/* ---------- Karten ---------- */

.spalten { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; align-items: start; }

.karte {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: 10px;
  padding: 16px 18px;
  min-width: 0;
}
.karte h2 { margin: 0 0 12px; font-size: 16px; font-weight: 650; }
.leer { color: var(--text-2); margin: 0; }

.position, .strategie { padding: 12px 0; border-top: 1px solid var(--linie); }
.position:first-child, .strategie:first-child { border-top: none; padding-top: 0; }

.position-knopf { margin-top: 10px; }
.echt-position { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.nebeninfo { color: var(--text-2); font-size: 14px; }

.werte { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px 16px; margin-top: 8px; }
.wert-paar { display: flex; flex-direction: column; }
.wert-paar .label { color: var(--text-2); font-size: 13px; }
.wert-paar .zahl { font-variant-numeric: tabular-nums; font-weight: 600; }

.plus { color: var(--plus); }
.minus { color: var(--minus); }

.regel-text { margin: 4px 0 0; color: var(--text-2); font-size: 14px; }
.regel-text b { color: var(--text); font-weight: 600; }

/* ---------- Charts ---------- */

.spalte { display: grid; gap: 16px; align-content: start; min-width: 0; }
.chart-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.chart-kopf h2 { margin: 0; }
.chart-kopf .nebeninfo { font-weight: 400; margin-left: 4px; }
.markt-auswahl { display: flex; gap: 6px; flex-wrap: wrap; }
.markt-auswahl button {
  font: inherit; font-size: 13px; padding: 4px 10px; border-radius: 6px;
  border: 1px solid var(--rand); background: transparent; color: var(--text-2); cursor: pointer;
}
.markt-auswahl button[aria-pressed="true"] { background: var(--flaeche-hover); color: var(--text); font-weight: 600; }
.legende { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--text-2); min-height: 20px; margin-bottom: 6px; }
.legende .eintrag { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.legende .wert { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 600; }
.legende .klein { white-space: normal; }
.legende .muster { display: inline-block; width: 16px; border-top: 2px solid currentColor; }
.legende .muster.gestrichelt { border-top-style: dashed; }
.legende .muster.kerze-hoch { width: 8px; height: 12px; border: 2px solid var(--kerze-hoch); background: transparent; }
.legende .muster.kerze-runter { width: 8px; height: 12px; border: none; background: var(--kerze-runter); }
.chart { width: 100%; height: 480px; }
.chart.klein { height: 220px; }
.tabellen-ansicht { margin-top: 10px; font-size: 14px; }
.tabellen-ansicht summary { cursor: pointer; color: var(--text-2); }
.tabellen-ansicht .tabelle { margin-top: 8px; }

/* ---------- Tabelle ---------- */

.tabelle-rahmen { overflow-x: auto; }
.tabelle { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabelle th { text-align: left; color: var(--text-2); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--linie); white-space: nowrap; }
.tabelle td { padding: 8px 10px; border-bottom: 1px solid var(--linie); vertical-align: top; }
.tabelle tr:last-child td { border-bottom: none; }
.tabelle .zahl { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabelle tbody tr:hover td { background: var(--flaeche-hover); }

.fuss { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; color: var(--text-2); font-size: 13px; }

/* ---------- Not-Aus-Dialog ---------- */

.dialog {
  max-width: 520px;
  width: calc(100% - 32px);
  background: var(--flaeche);
  color: var(--text);
  border: 1px solid var(--rand);
  border-radius: 12px;
  padding: 20px 22px;
}
.dialog::backdrop { background: rgba(0, 0, 0, 0.55); }
.dialog h2 { margin: 0 0 6px; font-size: 20px; }
.dialog p { margin: 0 0 14px; color: var(--text-2); }

.auswahl {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--rand);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  cursor: pointer;
}
.auswahl:hover { background: var(--flaeche-hover); }
.auswahl strong { display: block; font-size: 16px; margin-bottom: 2px; }
.auswahl span { color: var(--text-2); font-size: 14px; }
.auswahl.gefahr { border-color: var(--kritisch); }
.auswahl.gefahr strong { color: var(--kritisch-text); }

.dialog-knoepfe { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

/* ---------- Meldung unten ---------- */

.meldung {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  max-width: min(640px, calc(100% - 32px));
  background: var(--flaeche);
  color: var(--text);
  border: 1px solid var(--rand);
  border-left: 4px solid var(--akzent);
  border-radius: 10px;
  padding: 12px 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  z-index: 20;
}
.meldung.fehler { border-left-color: var(--kritisch); }
.meldung.erfolg { border-left-color: var(--gut); }

/* ---------- Strategien-Seite ---------- */

.karte-kopf { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; margin-bottom: 12px; }
.karte-kopf h2 { margin: 0; }
.karte-kopf .nebeninfo { margin: 0; }
.karte-text { margin: 0 0 12px; }
.karte h3 { margin: 0; font-size: 15px; font-weight: 650; }

/* Lämpchen für die Regeln */
.regel-stand { margin: 6px 0 4px; }
.regel-stand-titel { margin: 8px 0 2px; font-weight: 650; font-size: 14px; }
.regel-stand-satz { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
.regel-lichter { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.regel-licht { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: 14px; }
.regel-licht .licht { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--text-leise); }
.regel-licht.an .licht { background: var(--gut); box-shadow: 0 0 6px var(--gut); }
.regel-licht.offen .licht { background: transparent; border: 1.5px solid var(--text-leise); }
.regel-licht .nebeninfo { font-size: 13px; }

/* Echtes Geld bei Bitvavo */
.echtgeld { border-left: 3px solid var(--gut); }
.echtgeld-status { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 14px; }
.echtgeld-status.laeuft svg { color: var(--gut); }
.echtgeld-status.gestoppt svg { color: var(--warnung); }
.echtgeld-status.aus svg { color: var(--kritisch); }
.echtgeld h3 { margin-top: 16px; }
.echtgeld #echtgeld-inhalt > h3:first-child { margin-top: 0; }
.echtgeld .nebeninfo, .echtgeld .regel-text, .echtgeld .leer { margin: 8px 0 0; }
.echtgeld .tabelle .leer { margin: 0; }
.echtgeld .tabelle-rahmen { margin-top: 8px; }
.bereich-kopf h2 { margin: 8px 0 0; font-size: 16px; font-weight: 650; }
.bereich-kopf .nebeninfo { margin: 2px 0 0; }
.echtgeld .warnung { margin-bottom: 12px; }

.strategie-suche { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 14px; }
.strategie-suche input[type="search"] {
  font: inherit;
  color: var(--text);
  background: var(--seite);
  border: 1px solid var(--feld-rand);
  border-radius: 8px;
  padding: 7px 10px;
  min-height: 38px;
  flex: 1 1 260px;
  max-width: 420px;
}
.strategie-suche input[type="search"]:focus-visible { outline: 2px solid var(--akzent-text); outline-offset: 2px; }
.strategie-suche .nebeninfo { margin: 0; }
.coin-gruppe + .coin-gruppe { margin-top: 14px; }
#str-anzahl { margin-left: auto; }
.karte .coin-titel { display: flex; align-items: baseline; gap: 8px; margin: 0 0 8px; }
.coin-titel .nebeninfo { margin: 0; font-weight: 400; }
#datei-fehler { margin-bottom: 12px; }
.vorformatiert { white-space: pre-wrap; }

.karte-fuss { margin-top: auto; padding-top: 10px; display: flex; gap: 8px; }

/* Schalter: ein Kontrollkästchen, das wie ein Kippschalter aussieht */
.schalter { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; color: var(--text-2); user-select: none; }
.schalter input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.schalter-bahn {
  position: relative;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: var(--linie);
  border: 1px solid var(--rand);
  transition: background 0.15s;
  flex: none;
}
.schalter-bahn::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-2);
  transition: transform 0.15s, background 0.15s;
}
.schalter input:checked + .schalter-bahn { background: var(--akzent); border-color: var(--akzent); }
.schalter input:checked + .schalter-bahn::after { transform: translateX(18px); background: #ffffff; }
.schalter input:focus-visible + .schalter-bahn { outline: 2px solid var(--akzent-text); outline-offset: 2px; }
.schalter input:disabled + .schalter-bahn { opacity: 0.5; cursor: default; }
.schalter input:checked ~ .schalter-text { color: var(--text); font-weight: 600; }

.test-auswahl { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 12px; }
.feld { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.feld-name { color: var(--text-2); font-size: 13px; }
.feld select {
  font: inherit;
  color: var(--text);
  background: var(--seite);
  border: 1px solid var(--feld-rand);
  border-radius: 8px;
  padding: 7px 10px;
  min-height: 38px;
  max-width: 100%;
}
.feld select:focus-visible { outline: 2px solid var(--akzent-text); outline-offset: 2px; }

.test-ergebnis { display: grid; gap: 16px; margin-top: 4px; }
.test-kopf { display: grid; gap: 2px; }
.test-kopf .nebeninfo { margin: 0 0 4px; }
.test-ergebnis .kachel { background: var(--seite); }
.test-teil { display: grid; gap: 8px; min-width: 0; }

.hinweis-kasten {
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--rand);
  border-left: 4px solid var(--warnung);
  border-radius: 8px;
  background: var(--warnung-flaeche);
  font-size: 14px;
}

.tabelle-rahmen.begrenzt { max-height: 420px; overflow-y: auto; }
.tabelle-rahmen.begrenzt thead th { position: sticky; top: 0; background: var(--flaeche); }

.frage-text p { margin: 0 0 10px; color: var(--text-2); }

/* ---------- Baukasten ---------- */

.kopf-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; }
.vorlage-wahl {
  font: inherit;
  font-weight: 600;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--rand);
  border-radius: 8px;
  padding: 6px 10px;
  min-height: 38px;
  cursor: pointer;
}
.vorlage-wahl:hover { background: var(--flaeche-hover); }
.vorlage-wahl:focus-visible { outline: 2px solid var(--akzent-text); outline-offset: 2px; }
.vorlage-wahl option { background: var(--flaeche); color: var(--text); font-weight: 400; }

/* Hilfe-Seite: gut lesbare Zeilen und klare Abstände zwischen den Abschnitten */
.hilfe-text { max-width: 82ch; line-height: 1.6; }
.hilfe-text h2 { margin: 0 0 12px; font-size: 22px; }
.hilfe-text h3 { margin: 30px 0 8px; font-size: 18px; }
.hilfe-text h4 { margin: 24px 0 6px; font-size: 16px; }
.hilfe-text p { margin: 8px 0; }
.hilfe-text ul, .hilfe-text ol { margin: 8px 0; padding-left: 22px; }
.hilfe-text li { margin: 4px 0; }
.hilfe-text .tabelle-rahmen { margin: 12px 0; }
.hilfe-text .tabelle th { white-space: normal; }
.hilfe-vorlage { margin: 12px 0 4px; }
.hilfe-abbildung { margin: 14px 0; }
/* Auf schmalen Bildschirmen wird das ganze Bild kleiner, damit nichts abgeschnitten ist. Vergrößern geht mit zwei Fingern. */
.hilfe-bild {
  display: block;
  width: 100%;
  max-width: 560px;
  height: auto;
  border: 1px solid var(--rand);
  border-radius: 8px;
  background: var(--seite);
}
.hilfe-vorlage .knopf { display: inline-flex; align-items: center; text-decoration: none; }
.knopf.klein { min-height: 32px; padding: 5px 12px; font-size: 14px; }
.feld input[type="text"], .feld input[type="number"], .feld input[type="email"], .feld input[type="password"] {
  font: inherit;
  color: var(--text);
  background: var(--seite);
  border: 1px solid var(--feld-rand);
  border-radius: 8px;
  padding: 7px 10px;
  min-height: 38px;
  max-width: 100%;
}
.feld input:focus-visible, .regel-zeile select:focus-visible, .regel-zeile input:focus-visible,
.wahl-zeile input:focus-visible, .haekchen input:focus-visible {
  outline: 2px solid var(--akzent-text);
  outline-offset: 2px;
}
.feld.zeile { flex-direction: row; align-items: center; gap: 8px; }

/* Anmeldung */
.anmelde-seite { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; box-sizing: border-box; }
.anmelde-karte { width: 100%; max-width: 440px; display: grid; gap: 14px; }
.anmelde-marke { margin: 0; font-size: 18px; font-weight: 700; }
.anmelde-schritt { display: grid; gap: 12px; }
.anmelde-schritt h1 { margin: 0; font-size: 20px; font-weight: 650; }
.anmelde-schritt p { margin: 0; }
.anmelde-schritt .feld input:not([type="checkbox"]) { width: 100%; box-sizing: border-box; }
.anmelde-schritt .feld.zeile { justify-content: flex-start; }
.anmelde-schritt .knopf:disabled { cursor: not-allowed; }
.anmelde-liste { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.qr-bild { justify-self: center; width: 225px; height: 225px; border-radius: 8px; background: #ffffff; }
.schluessel-text { font-family: ui-monospace, Consolas, monospace; font-size: 15px; letter-spacing: 0.04em; word-break: break-all; user-select: all; }
.ersatzcodes { margin: 0; padding-left: 30px; columns: 2; font-family: ui-monospace, Consolas, monospace; font-size: 15px; }
.ersatzcodes li { margin: 0 0 6px; break-inside: avoid; }
.anmelde-hinweis { color: var(--text-2); font-size: 13px; margin: 0; }
.verlust-atr { display: flex; align-items: center; gap: 8px; }
.verlust-atr input[type="number"] { width: 5.5em; }
.feld-hilfe { color: var(--text-2); font-size: 12px; }
.feld-kopf { display: flex; align-items: center; gap: 6px; }
.feld-kopf .frage-knopf { margin-block: -4px; } /* so bleibt die Zeile so hoch wie bei den Feldern daneben */

/* Fragezeichen im Baukasten und die Erklärung, die es öffnet */
.frage-knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--feld-rand);
  border-radius: 50%;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.frage-knopf:hover { color: var(--text); border-color: var(--text-2); }
.frage-knopf[aria-expanded="true"] { background: var(--akzent); border-color: var(--akzent); color: #ffffff; }
.frage-knopf:focus-visible { outline: 2px solid var(--akzent-text); outline-offset: 2px; }
.erklaerung {
  margin: 8px 0 0;
  padding: 10px 14px;
  border: 1px solid var(--rand);
  border-left: 4px solid var(--akzent);
  border-radius: 8px;
  background: var(--akzent-flaeche);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
.erklaerung-titel { display: block; margin-bottom: 2px; }
.erklaerung-absatz { display: block; max-width: 120ch; }
.erklaerung-absatz + .erklaerung-absatz { margin-top: 6px; }
.feld-fehler { color: var(--kritisch-text); font-size: 13px; }
.feld-fehler:empty { display: none; }

.baukasten-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 16px; }
.baukasten-teil { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 20px; }
.baukasten-teil > .baukasten-raster, .baukasten-teil > .regel-liste { align-self: stretch; }
.baukasten-teil .nebeninfo { margin: 0; }
.regel-liste { display: grid; gap: 8px; }

.regel-zeile { padding: 8px 10px; border: 1px solid var(--rand); border-radius: 8px; background: var(--seite); }
.regel-felder { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.regel-felder > .knopf { margin-left: auto; }
.regel-nummer { min-width: 1.6em; color: var(--text-2); font-variant-numeric: tabular-nums; }
.wert-gruppe { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.regel-zeile select, .regel-zeile input {
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--flaeche);
  border: 1px solid var(--feld-rand);
  border-radius: 6px;
  padding: 5px 8px;
  min-height: 34px;
}
.regel-zeile input { width: 5.5em; }
.regel-zeile input.breit { width: 8.5em; }
.param { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-2); }
.regel-satz { margin: 6px 0 0; font-size: 13px; color: var(--text-2); }
.regel-satz.fehler { color: var(--kritisch-text); }
.regel-satz:empty { display: none; }
.regel-bedeutung { margin: 4px 0 0; max-width: 120ch; font-size: 13px; line-height: 1.5; color: var(--text-2); }
.regel-bedeutung b { color: var(--text); font-weight: 600; }
.regel-bedeutung:empty { display: none; }

.baukasten-vorschau {
  display: grid;
  gap: 6px;
  margin-top: 20px;
  padding: 12px 14px;
  border: 1px solid var(--rand);
  border-radius: 8px;
  background: var(--seite);
}
#bk-fehler:empty { display: none; }
.gebuehren { display: grid; gap: 4px; margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--linie); }
.gebuehren-titel { margin: 0; font-size: 14px; font-weight: 650; }
.gebuehren .regel-text { margin: 0; }
.gebuehren-schwelle {
  margin: 4px 0 6px;
  padding: 10px 14px;
  border: 1px solid var(--rand);
  border-left: 4px solid var(--akzent);
  border-radius: 8px;
  background: var(--akzent-flaeche);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}
.gebuehren-schwelle b { color: var(--akzent-text); font-size: 18px; font-weight: 700; white-space: nowrap; }
.gebuehren .warnung { margin-top: 6px; }
.baukasten-knoepfe { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.baukasten-knoepfe .abstand { flex: 1; }
.karte-fuss { flex-wrap: wrap; }
.warnung .knopf { margin-left: auto; flex: none; }
.test-kopf > .knopf { justify-self: start; margin-bottom: 6px; }

/* ---------- Profil ---------- */

.vorlagen-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.vorlage {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--rand);
  border-radius: 10px;
  background: var(--seite);
}
.vorlage .nebeninfo { margin: 0; }
.vorlage ul { margin: 6px 0 0; padding-left: 18px; color: var(--text-2); font-size: 14px; }
.vorlage li b { color: var(--text); font-weight: 600; }
fieldset.feld { border: none; margin: 0; padding: 0; min-width: 0; }
fieldset.feld legend { padding: 0; margin-bottom: 4px; }
.wahl-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; cursor: pointer; }
.wahl-zeile input[type="number"] { width: 8em; }
.wahl-zeile input:disabled { opacity: 0.5; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--akzent); width: 18px; height: 18px; margin: 0; }
.haekchen { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.profil-teil .haekchen { display: flex; width: fit-content; }
.profil-teil .haekchen + .haekchen { margin-top: 8px; }
.feld-wert { font-size: 20px; font-weight: 600; padding: 4px 0; font-variant-numeric: tabular-nums; }
.profil-info { margin: 0; color: var(--text-2); font-size: 14px; }
.profil-info:empty { display: none; }
.profil-fehler { margin-top: 16px; }
.profil-fehler:empty { display: none; }

.verweis { color: var(--akzent-text); text-decoration: none; font-weight: 600; font-size: 14px; }
.verweis:hover { text-decoration: underline; }
.verweis-zeile { margin: 10px 0 0; }

/* ---------- Dashboard ---------- */

.inhalt.breit { max-width: 2000px; }
.ansicht-leiste {
  display: flex; flex-wrap: wrap; align-items: stretch; gap: 12px 16px;
  position: sticky; top: 63px; z-index: 5; background: var(--seite); padding: 8px 0; margin: -8px 0;
}
.ansicht-leiste .statuszeile { flex: 1 1 320px; }
.ansicht-umschalter { display: inline-flex; gap: 4px; padding: 4px; background: var(--flaeche); border: 1px solid var(--rand); border-radius: 10px; }
.ansicht-knopf {
  font: inherit; font-size: 16px; font-weight: 650; display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 22px; border: none; border-radius: 7px; background: transparent; color: var(--text-2); cursor: pointer;
}
.ansicht-knopf:hover { color: var(--text); }
.ansicht-knopf:focus-visible { outline: 2px solid var(--akzent-text); outline-offset: 2px; }
.ansicht-knopf.echt[aria-selected="true"] { background: var(--flaeche-hover); color: var(--text); box-shadow: inset 0 -3px 0 var(--gut); }
.ansicht-knopf.spiel[aria-selected="true"] { background: var(--flaeche-hover); color: var(--text); box-shadow: inset 0 -3px 0 var(--warnung); }
.punkt { width: 9px; height: 9px; border-radius: 50%; background: var(--text-leise); flex: none; }
.punkt.laeuft { background: var(--gut); }
.punkt.gestoppt { background: var(--warnung); }
.punkt.aus { background: var(--kritisch); }
.ansicht-hinweis { margin: 0; }
#dashboard[data-ansicht="echtgeld"] .kachel.held { border-left: 3px solid var(--gut); }
#dashboard[data-ansicht="spielgeld"] .kachel.held { border-left: 3px solid var(--warnung); }

.chart.gross { height: clamp(420px, 64vh, 880px); }
.zoom-hinweis { margin: 6px 0 0; font-size: 13px; }
@media (hover: none) { .zoom-hinweis { display: none; } }
.chart-wahl { display: inline-flex; align-items: center; gap: 8px; }
.chart-wahl select {
  font: inherit; color: var(--text); background: var(--seite); border: 1px solid var(--feld-rand);
  border-radius: 8px; padding: 6px 10px; min-height: 38px; min-width: 220px;
}
.chart-wahl select:focus-visible { outline: 2px solid var(--akzent-text); outline-offset: 2px; }
.spalten.gleich { grid-template-columns: 1fr 1fr; align-items: stretch; }

.klapp-zeile { border-top: 1px solid var(--linie); }
.klapp-zeile:first-child { border-top: none; }
.klapp-zeile > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-radius: 6px; cursor: pointer; }
.klapp-zeile > summary::-webkit-details-marker { display: none; }
.klapp-zeile > summary:hover { background: var(--flaeche-hover); }
.klapp-zeile > summary:focus-visible { outline: 2px solid var(--akzent-text); outline-offset: 1px; }
.pfeil { flex: none; width: 0; height: 0; border-left: 7px solid var(--text-2); border-top: 5px solid transparent; border-bottom: 5px solid transparent; transition: transform 0.12s; }
.klapp-zeile[open] > summary .pfeil { transform: rotate(90deg); }
.zeile-links { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.zeile-links .nebeninfo { font-size: 13px; }
.zeile-rechts { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.zeile-rechts .nebeninfo { font-size: 13px; }
.zeile-rechts .nebeninfo.plus { color: var(--plus); }
.zeile-rechts .nebeninfo.minus { color: var(--minus); }
.zeile-zahl { font-weight: 650; font-variant-numeric: tabular-nums; }
.zeile-details { padding: 2px 6px 14px 30px; }
.zeile-details > .nebeninfo { margin: 0; }
.zeile-knoepfe { margin-top: 10px; }
.zustand-klein { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--text-2); }
.zustand-klein .licht { width: 9px; height: 9px; border-radius: 50%; background: var(--text-leise); }
.zustand-klein.an { color: var(--text); font-weight: 600; }
.zustand-klein.an .licht { background: var(--gut); }
.zustand-klein.wartet .licht { background: var(--text-leise); }
.zustand-klein.aus .licht { background: transparent; border: 1.5px solid var(--text-leise); }
#boersen-liste .zeile-links { flex: 0 0 170px; }
#boersen-liste .zeile-rechts { flex: 1 1 0; align-items: stretch; }
.boerse-werte { margin-top: 0; grid-template-columns: repeat(3, minmax(140px, 1fr)); }
#boersen-liste .zeile-details .nebeninfo { margin: 8px 0 0; }
.trades-fuss { margin: 10px 0 0; }
.trades-fuss:has(.versteckt) { display: none; }

/* ---------- Strategien ---------- */

.strategie-zeile { border-top: 1px solid var(--linie); }
.strategie-zeile:first-child { border-top: none; }
/* Kopf und aufgeklappter Teil haben dieselben Spalten, so steht alles zum Spielgeld unter dem Spielgeld-Schalter */
.strategie-zeile-kopf, .strategie-details {
  display: grid; grid-template-columns: minmax(260px, 1.2fr) minmax(170px, 1fr) minmax(170px, 1fr) 84px; gap: 8px 24px; padding-left: 6px; padding-right: 6px;
}
.ohne-spielgeld .strategie-zeile-kopf, .ohne-spielgeld .strategie-details { grid-template-columns: minmax(260px, 1.2fr) minmax(170px, 1fr) 84px; }
.strategie-zeile-kopf { align-items: center; padding-top: 8px; padding-bottom: 8px; border-radius: 6px; cursor: pointer; }
.strategie-zeile-kopf:hover { background: var(--flaeche-hover); }
.strategie-zeile-kopf > .knopf { justify-self: end; }
.ohne-spielgeld .nur-spielgeld { display: none; }
.strategie-klappen {
  display: flex; align-items: center; gap: 12px; min-width: 0; padding: 0;
  font: inherit; color: inherit; text-align: left; background: none; border: none; cursor: pointer;
}
.strategie-klappen:focus-visible { outline: 2px solid var(--akzent-text); outline-offset: 2px; }
.strategie-zeile.offen .pfeil { transform: rotate(90deg); }
.schalter-spalte { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.schalter-spalte .nebeninfo { margin: 0; font-size: 13px; }
.echt-schalter input:checked + .schalter-bahn { background: var(--gut); border-color: var(--gut); }
.strategie-details { padding-top: 2px; padding-bottom: 14px; }
.strategie-regeln { padding-left: 24px; min-width: 0; }
.strategie-details .regel-text:first-child, .strategie-details .regel-stand:first-child, .strategie-details .regel-stand:first-child .regel-stand-titel { margin-top: 0; }
.strategie-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Schmale Bildschirme, zum Beispiel das Handy ---------- */

@media (max-width: 900px) {
  .kennzahlen, .kennzahlen.fuenf { grid-template-columns: 1fr 1fr; }
  .kachel.held { grid-column: 1 / -1; }
  .spalten, .spalten.gleich { grid-template-columns: 1fr; }
  .ansicht-leiste { position: static; margin: 0; padding: 0; }
  .boerse-werte { grid-template-columns: 1fr; }
  .klapp-zeile > summary { flex-wrap: wrap; }
  .kopf { flex-wrap: wrap; gap: 12px; padding: 12px 16px; }
  .navigation { order: 3; flex-basis: 100%; }
  .inhalt { padding: 16px; }
  .kennzahlen:not(.fuenf) .kachel:last-child { grid-column: 1 / -1; }
  .aktionen { margin-left: auto; }
  .strategie-zeile-kopf { grid-template-columns: 1fr 1fr auto; }
  .ohne-spielgeld .strategie-zeile-kopf { grid-template-columns: 1fr auto; }
  .strategie-klappen { grid-column: 1 / -1; }
  .strategie-details, .ohne-spielgeld .strategie-details { grid-template-columns: 1fr; }
  .strategie-regeln { padding-left: 0; }
}

@media (max-width: 520px) {
  .aktionen { margin-left: 0; }
  .strategie-zeile-kopf { grid-template-columns: 1fr 1fr; }
  .strategie-zeile-kopf > .knopf { justify-self: start; }
}

/* Der Code zum Verbinden von Telegram, gut lesbar zum Abtippen */
.tg-code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 1.6rem;
  letter-spacing: 0.15em;
  margin: 0.4rem 0 0.8rem;
}

/* Telegram und Börsen verbinden: Knöpfe und Text sauber untereinander, der Knopf liegt nicht auf dem Text */
.baukasten-teil > .baukasten-knoepfe { align-self: stretch; margin-top: 8px; }
.tg-ausgabe { align-self: stretch; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.tg-ausgabe p { margin: 0; }
.tg-ausgabe .tg-code { margin: 4px 0; }

/* Profil: Unterüberschrift je Börse bei der Auftragsart (Etappe 7b) */
.karte h4.profil-unterkopf { margin: 6px 0 0; font-size: 14px; font-weight: 650; }
.limit-info { display: flex; flex-direction: column; gap: 4px; }
/* Dashboard: wartende Auftraege unter den offenen Positionen (Etappe 7b) */
.wartend { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.wartend h3 { margin: 0; font-size: 14px; }
.wartend-zeile { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
/* Hilfe: Inhaltsverzeichnis mit Sprungmarken. Die Kopfzeile bleibt oben stehen, deshalb Abstand beim Springen. */
.hilfe-text h2, .hilfe-text h3, .hilfe-text h4 { scroll-margin-top: 84px; }
.hilfe-inhaltsverzeichnis { margin: 16px 0 8px; padding: 12px 18px; border: 1px solid var(--rand); border-radius: 10px; }
.hilfe-inhaltsverzeichnis .inhalt-titel { margin: 0 0 6px; font-weight: 650; }
.hilfe-inhaltsverzeichnis .inhalt-liste { margin: 0; padding-left: 22px; }
.hilfe-inhaltsverzeichnis .inhalt-liste ul { margin: 2px 0 6px; padding-left: 18px; font-size: 14px; }
.hilfe-inhaltsverzeichnis li { margin: 2px 0; }

/* Verwaltung: Morgenblick als Ampel und Kundenliste (Etappe 8) */
.vw-probleme { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.vw-ampel { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--rand); }
.vw-ampel .punkt { align-self: center; }
.vw-ampel.gelb { background: var(--warnung-flaeche); }
.vw-ampel.rot { background: var(--kritisch-flaeche); }
.vw-bot { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.vw-gesperrt { color: var(--kritisch-text); font-size: 13px; }
.vw-kunden td { vertical-align: top; }
.vw-kunden tr.vw-inaktiv td { color: var(--text-leise); }
.vw-kunden tr.vw-inaktiv .nebeninfo { color: var(--text-leise); }

/* Verwaltung: Seite je Kunde (Etappe 8, Schritt 3) */
.vw-link { color: var(--akzent-text); font-weight: 600; }
.vw-k-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.vw-k-knoepfe + .karte-text { margin-top: 12px; }
.vw-k-bot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 10px 0; border-bottom: 1px solid var(--linie); }
.vw-k-bot:last-child { border-bottom: none; }
.vw-k-paket { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 0; border-bottom: 1px solid var(--linie); }
.vw-k-paket:last-child { border-bottom: none; }
.vw-k-boerse { min-width: 6em; font-weight: 600; }
.vw-k-wahl { margin-bottom: 12px; }
.dialog .feld { margin-bottom: 10px; }
.dialog textarea {
  font: inherit;
  color: var(--text);
  background: var(--seite);
  border: 1px solid var(--feld-rand);
  border-radius: 8px;
  padding: 7px 10px;
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
}
.dialog textarea:focus-visible { outline: 2px solid var(--akzent-text); outline-offset: 2px; }

/* Verwaltung: freigegebene Daten eines Kunden (Etappe 8, Schritt 4) */
.vw-k-freigabe-daten h3 { margin: 26px 0 8px; font-size: 17px; }
.vw-k-freigabe-daten h4 { margin: 16px 0 6px; font-size: 15px; color: var(--text-2); }
.vw-k-freigabe-daten .baukasten-teil { margin-bottom: 12px; }
.vw-k-freigabe-daten .baukasten-teil p { margin: 3px 0; }
.fg-liste { margin: 6px 0 0; padding-left: 20px; }
.fg-liste li { margin: 3px 0; }

/* Verwaltung: Kunde einladen (Etappe 8, Schritt 5) */
.vw-e-formular { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; margin-bottom: 12px; }
.vw-e-formular .feld { flex: 1 1 260px; }
.vw-e-link { margin-bottom: 12px; }
.vw-e-zeile { display: flex; gap: 8px; margin-bottom: 8px; }
.vw-e-zeile input {
  flex: 1;
  min-width: 0;
  font: inherit;
  color: var(--text);
  background: var(--seite);
  border: 1px solid var(--feld-rand);
  border-radius: 8px;
  padding: 7px 10px;
  min-height: 38px;
}
.vw-e-aktionen { display: inline-flex; flex-wrap: wrap; gap: 6px; }

/* Verwaltung: Zustand des Systems und Meldungen per Telegram (Etappe 8, Schritt 6) */
.vw-banner { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.vw-banner:empty { display: none; }
.vw-banner .knopf { margin-left: auto; }
.vw-banner .knopf + .knopf { margin-left: 0; }
.vw-m-teil + .vw-m-teil { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--linie); }
.vw-m-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 6px 0; }
.vw-m-name { min-width: 6em; font-weight: 600; }
.werte .minus { color: var(--kritisch-text); }
