/* ============================================================
   TradeCopier Control Deck — Design Tokens
   ============================================================ */
:root {
  /* Color */
  --void:        #0B0E14;   /* app background */
  --panel:       #12161F;   /* card/panel surface */
  --panel-raise: #171C27;   /* hover/raised surface */
  --hairline:    #232838;   /* borders */
  --text:        #E7EAF0;
  --text-muted:  #7C8496;
  --text-dim:    #4E5566;

  /* Long/Short/Signal bewusst NICHT je Theme unterschiedlich - siehe
     Recherche zu TradingView (das Haupt-Charting-Tool der meisten Nutzer
     hier): deren Kauf-/Verkauf-Grün/Rot bleibt zwischen Hell- und
     Dunkel-Chart-Theme IDENTISCH, genau damit sich Trader nicht bei jedem
     Theme-Wechsel neu an die Farben gewöhnen müssen (Muskelgedächtnis).
     Werte sind TradingViews eigene, bei Tradern extrem wiedererkennbare
     Bullish/Bearish-Töne, --signal ist TradingViews "Dodger Blue". */
  --long:        #089981;   /* buy / profit - TradingView Bullish-Grün */
  --short:       #F23645;   /* sell / loss - TradingView Bearish-Rot */
  --amber:       #FFB020;   /* warning / instrument accent */
  --signal:      #2962FF;   /* active / live indicator - TradingView Blue */

  --sidebar-bg:  #0D1017;   /* etwas dunkler als --void, für die permanent dunkle Sidebar */

  /* Type */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius:    16px;  /* große Karten (KPI/Panel/Konto/Wochentag) - runder, weicher, siehe Chat-Referenzscreenshots */
  --radius-md: 12px;  /* mittlere Elemente (Kalendertage, Insight-Boxen) */
  --radius-sm: 10px;  /* kleine Elemente (Buttons, Inputs, Icon-Kacheln) */

  /* Karten schweben jetzt primär über einen weichen Schatten statt über eine
     harte Rahmenlinie (siehe Referenz: dort haben Karten im Hellmodus so gut
     wie keinen sichtbaren Rand). Im Dunkelmodus bleibt zusätzlich ein sehr
     dezenter Rahmen, weil ein reiner Schatten auf nahezu-schwarzem
     Hintergrund kaum wahrnehmbar wäre. */
  --card-border: var(--hairline);
  --card-shadow: 0 1px 2px rgba(0,0,0,.35), 0 10px 28px -14px rgba(0,0,0,.55);
  --card-shadow-hover: 0 1px 2px rgba(0,0,0,.4), 0 14px 32px -12px rgba(0,0,0,.6);
}

/* Light-Theme: überschreibt dieselben Design-Tokens, wenn <html data-theme="light">
   gesetzt ist (siehe Umschalter-Button in der Sidebar, dashboard.js:initTheme()).
   Der Rest der App verwendet ausschließlich diese CSS-Variablen, daher genügt
   diese eine Stelle, um das komplette Dashboard umzufärben. */
:root[data-theme="light"] {
  --void:        #F4F5F8;
  --panel:       #FFFFFF;
  --panel-raise: #ECEEF3;
  --hairline:    #DCDFE6;
  --text:        #1B1E27;
  --text-muted:  #5B6272;
  --text-dim:    #97A0B2;

  /* --long/--short/--signal bewusst NICHT hier überschrieben - siehe
     Kommentar bei :root oben (TradingView-Konsistenz zwischen den Themes). */
  --amber:       #B8720A;

  --sidebar-bg:  #FFFFFF;

  /* Im Hellmodus tragen die Karten die klassische "Elevation" nur noch über
     einen weichen, großflächigen Schatten (siehe Referenzscreenshots) - der
     Rand wird praktisch unsichtbar (fast gleiche Farbe wie die Karte selbst),
     statt wie vorher eine sichtbare graue Kontur um jede Karte zu ziehen. */
  --card-border: #EDEEF2;
  --card-shadow: 0 1px 2px rgba(20,24,43,.04), 0 10px 28px -14px rgba(20,24,43,.10);
  --card-shadow-hover: 0 2px 4px rgba(20,24,43,.05), 0 16px 36px -12px rgba(20,24,43,.14);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--void);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  /* Sicherheitsnetz: nichts soll die Seite je horizontal breiter machen als
     das Browserfenster - einzelne Inhalte (z.B. Tabellen) duerfen weiterhin
     ihren EIGENEN, in sich geschlossenen Scrollbereich haben (.table-wrap),
     aber die Seite als Ganzes nie seitlich scrollen. */
  overflow-x: hidden;
}

button, input, select { font-family: inherit; }

/* ============================================================
   Layout
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--hairline);
  box-shadow: var(--sidebar-shadow, none);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  /* Bleibt beim Scrollen des Hauptinhalts stehen - kein Mitscrollen mehr,
     eigener Scrollbereich nur falls die Navigation selbst mal zu lang für
     den Bildschirm wird. */
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
}
:root[data-theme="light"] .sidebar {
  /* Im Referenzdesign trennt im Hellmodus kein harter Strich die Sidebar
     vom Inhalt, sondern ein ganz leichter Schatten nach rechts. */
  border-right-color: transparent;
  box-shadow: 1px 0 0 rgba(20,24,43,.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 22px;
}
.brand-mark {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--signal), #2C5FCC);
  display: grid; place-items: center;
  color: #fff;
}
.brand-mark svg { width: 18px; height: 18px; display: block; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.01em;
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand-name .brand-tagline {
  font-family: var(--font-sans, inherit);
  font-weight: 400;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 15.5px;
  font-weight: 500;
  text-align: left;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--panel-raise); color: var(--text); }
/* Aktiver Eintrag: farbig getönte Pill statt flacher Panel-Fläche - deutlich
   erkennbarer "Wo bin ich gerade"-Indikator, angelehnt an die
   Referenzscreenshots (dort ist "Dashboard" als sanft blau/grün getönte
   Pille hervorgehoben statt nur leicht abgesetzt). */
.nav-item.is-active { background: rgba(41,98,255,.12); color: var(--signal); font-weight: 600; }
.nav-item.is-active .nav-icon { color: var(--signal); }
.nav-icon { width: 17px; height: 17px; color: var(--text-dim); flex-shrink: 0; }

/* Gruppenüberschriften + Trennlinien in der Sidebar - gliedert die
   Navigation in "Trading-Journal" / "Copy Trading" / "Trading", damit die
   inzwischen recht lange Liste an Menüpunkten nicht mehr wie eine
   undifferenzierte Wand wirkt. */
.nav-group-label {
  font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-dim); padding: 4px 10px 6px; margin-top: 2px;
}
.nav-group-divider { height: 1px; background: var(--hairline); margin: 10px 6px 8px; }

.sidebar-foot { padding-top: 14px; }
.conn-pill {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--text-muted);
  padding: 8px 10px;
  background: var(--panel);
  border-radius: 8px;
}
.conn-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-dim);
  box-shadow: 0 0 0 0 rgba(8,153,129,0);
}
.conn-pill.is-live .conn-dot {
  background: var(--long);
  animation: pulse 1.8s infinite;
}
.conn-pill.is-down .conn-dot { background: var(--short); }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(8,153,129,.5); }
  70%  { box-shadow: 0 0 0 6px rgba(8,153,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(8,153,129,0); }
}

/* ---- Konten-Status-Ampeln (Sidebar) ----
   Immer sichtbar, egal welche Ansicht gerade offen ist - damit ein
   Verbindungsproblem sofort auffaellt, statt erst beim Klick auf "Konten".
   Wird von renderAccountStatusSidebar() in dashboard.js befuellt. */
.acct-status { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--hairline); }
.acct-status-title {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-dim); padding: 0 10px 6px;
}
.acct-status-badge {
  font-size: 10.5px; font-weight: 600; letter-spacing: normal; text-transform: none;
  padding: 1px 7px; border-radius: 20px;
  background: rgba(242,54,69,.14); color: var(--short);
}
.acct-status-list {
  display: flex; flex-direction: column; gap: 1px;
  /* Eigener, in sich geschlossener vertikaler Scrollbereich bei vielen
     Konten - bewusst NICHT horizontal, damit hier nie seitliches Scrollen
     entstehen kann. */
  max-height: 240px; overflow-y: auto; overflow-x: hidden;
}
.acct-status-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px; border-radius: 6px;
  font-size: 13px; cursor: default;
}
.acct-status-row:hover { background: var(--panel-raise); }
.acct-status-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  background: var(--text-dim);
}
.acct-status-dot.is-ok {
  background: var(--long);
  animation: pulse 1.8s infinite;
}
.acct-status-dot.is-warn { background: var(--amber); }
.acct-status-dot.is-error { background: var(--short); }
.acct-status-name {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text);
}
.acct-status-state {
  font-size: 11px; color: var(--text-dim); flex-shrink: 0;
}

.main {
  padding: 22px 30px 40px; max-width: none; width: 100%;
  /* BUGFIX: Ein Grid-Item (die .main-Spalte von .app) kann sich ohne
     min-width:0 nie kleiner als der intrinsische Inhalt machen - z.B. eine
     KPI-Reihe mit vielen Karten sprengte dadurch bei schmalerem Fenster den
     verfuegbaren Platz und erzwang seitliches Scrollen der GESAMTEN Seite,
     statt dass die Karten einfach umbrechen/schrumpfen (gleicher Bug wie bei
     .account-card weiter unten, hier aber auf Ebene der ganzen Spalte). */
  min-width: 0;
}

/* ============================================================
   BUGFIX (siehe Chat: "latenz nicht anzeigen und linie weg" +
   "prüfe ob alles einwandfrei funktioniert") - die frühere Latenz-
   Oszilloskop-Leiste (.scope-bar und zugehörige Klassen) wurde aus
   index.html entfernt (Status läuft jetzt über Telegram /status,
   siehe TelegramCommandListenerService). Die Styles dafür waren hier
   als totes CSS stehen geblieben - ersatzlos entfernt.
   ============================================================ */

/* ============================================================
   Views
   ============================================================ */
.view { display: none; animation: fade .15s ease; }
.view.is-active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; } }

.view-head { margin-bottom: 22px; }
.view-head h1 {
  font-family: var(--font-display);
  font-size: 25.5px; font-weight: 600; margin: 0 0 4px;
}
.view-head p { margin: 0; color: var(--text-muted); font-size: 15.5px; }

.kpi-row {
  display: grid;
  /* Statt einer festen Spaltenzahl (frueher z.T. sogar 5-6 fest per Inline-
     Style auf einzelnen Views) passt sich die Reihe jetzt automatisch an:
     so viele 220px-Karten pro Zeile wie reinpassen, der Rest bricht in die
     naechste Zeile um. Dadurch bleiben Karten auf jeder Fensterbreite lesbar
     (kein Zusammenquetschen) UND es entsteht nie seitliches Scrollen. */
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.kpi-card {
  background: var(--panel);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex; align-items: flex-start; gap: 12px;
  box-shadow: var(--card-shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--card-shadow-hover); }
.kpi-card-icon {
  width: 34px; height: 34px; border-radius: var(--radius-sm); flex-shrink: 0;
  background: rgba(76,141,255,.12);
  display: flex; align-items: center; justify-content: center;
  color: var(--signal);
}
.kpi-card-icon svg { width: 17px; height: 17px; display: block; }
.kpi-card-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.kpi-label { font-size: 13px; color: var(--text-muted); }
.kpi-value { font-family: var(--font-mono); font-size: 30px; font-weight: 600; }
/* Kleinere Variante für KPI-Karten mit zusätzlichem Prozent-Wert in Klammern
   (siehe Chat: "Schrift zu groß, überlappt Rahmen") - .kpi-value bei 30px war
   für "$1.024 (2,05%)" in einer schmalen Karte zu groß und lief über den
   Kartenrand hinaus. Bricht zur Not sauber um, statt zu überlaufen. */
.kpi-value-sm {
  font-family: var(--font-mono); font-size: 17px; font-weight: 600;
  line-height: 1.3; overflow-wrap: anywhere; word-break: break-word;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
}
.panel-pad { padding: 20px; }
.panel-head { padding: 16px 20px; border-bottom: 1px solid var(--hairline); display: flex; align-items: center; gap: 10px; }
.panel-head h2 { margin: 0; font-family: var(--font-display); font-size: 18px; font-weight: 600; }
.panel-head-icon {
  width: 26px; height: 26px; border-radius: var(--radius-sm); flex-shrink: 0;
  background: rgba(76,141,255,.12); color: var(--signal);
  display: flex; align-items: center; justify-content: center;
}
.panel-head-icon svg { width: 14px; height: 14px; display: block; }

.table-wrap { overflow-x: auto; }

/* Zweispaltige Panel-Paare (Chart + Tabelle, zwei Charts nebeneinander usw.).
   Fallen unten (Responsive-Bereich) bei schmalem Fenster automatisch auf
   eine Spalte, statt die Karten seitlich zu quetschen. */
.split-panel { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; }
.split-panel-even { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.data-table th {
  text-align: left;
  padding: 10px 16px;
  color: var(--text-dim);
  font-weight: 500;
  font-size: 12.5px;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--hairline);
}
.data-table td {
  padding: 9px 16px;
  border-bottom: 1px solid var(--hairline);
  color: var(--text);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--panel-raise); }
.mono-table td, .mono-table th { font-family: var(--font-mono); }
.empty-row td { color: var(--text-dim); text-align: center; padding: 26px; }

.side-buy  { color: var(--long); font-weight: 600; }
.side-sell { color: var(--short); font-weight: 600; }
/* .data-table td hat durch das Element+Klasse-Selektor-Paar (0,1,1) höhere
   Spezifität als .side-buy/.side-sell allein (0,1,0) und hat die Farbe
   bisher stillschweigend überschrieben - P&L-Zellen blieben dadurch immer
   in der normalen Textfarbe statt grün/rot. Diese Regel gewinnt jetzt. */
.data-table td.side-buy  { color: var(--long); }
.data-table td.side-sell { color: var(--short); }
.status-pill {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-size: 12.5px; font-weight: 500;
}
.status-Filled, .status-Sent, .status-Accepted { background: rgba(8,153,129,.12); color: var(--long); }
.status-Rejected, .status-Error { background: rgba(242,54,69,.12); color: var(--short); }
.status-Pending { background: rgba(255,176,32,.12); color: var(--amber); }

/* Konto-Status-Pills auf der Kontokarte (Analytics-Formatierung als
   deutscher Text statt der rohen Enum-Zahl, siehe accountStateLabel() in
   dashboard.js) und der zusaetzliche, ehrliche Verbindungs-Status daneben
   (dieselben Stufen wie die Sidebar-Ampel, siehe getAccountStatusInfo()). */
.status-account-Aktiv { background: rgba(8,153,129,.12); color: var(--long); }
.status-account-Pausiert { background: rgba(255,176,32,.12); color: var(--amber); }
.status-account-Deaktiviert, .status-account-Unbekannt { background: rgba(124,132,150,.16); color: var(--text-muted); }
.status-account-Gesperrt { background: rgba(242,54,69,.12); color: var(--short); }
.status-conn-is-ok { background: rgba(8,153,129,.12); color: var(--long); }
.status-conn-is-warn { background: rgba(255,176,32,.12); color: var(--amber); }
.status-conn-none { background: rgba(124,132,150,.16); color: var(--text-muted); }

/* ============================================================
   Accounts
   ============================================================ */
.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 14px;
}
.account-btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.account-btn-grid button { width: 100%; }
.account-card {
  background: var(--panel);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--card-shadow);
  /* BUGFIX: Ohne min-width:0 kann ein Grid-Item nie kleiner werden als der
     intrinsische Inhalt (z.B. das lange, nicht umbrechende Konto-ID-Feld) -
     auf schmalen Bildschirmen sprengte das dadurch die Kartenbreite ueber
     den Grid-Track hinaus, sichtbar als abgeschnittener Rand rechts an
     Buttons/Dropdowns. */
  min-width: 0;
  overflow: hidden;
}
.account-card-head { display: flex; justify-content: space-between; align-items: start; margin-bottom: 10px; }
.account-name { font-family: var(--font-display); font-weight: 600; font-size: 19px; }
.account-platform { font-size: 13px; color: var(--text-muted); }
.role-badge {
  font-size: 11.5px; padding: 2px 8px; border-radius: 20px;
  background: rgba(76,141,255,.14); color: var(--signal);
}
.account-actions { display: flex; gap: 6px; margin-top: 12px; }
.empty-state { color: var(--text-dim); padding: 30px; text-align: center; grid-column: 1 / -1; }

/* ============================================================
   Controls
   ============================================================ */
.log-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.input {
  background: var(--panel);
  border: 1px solid var(--hairline);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 15px;
  /* Ohne feste Höhe rendern <select>/<input>/<textarea> im Browser leicht
     unterschiedlich hoch (Standard-Zeilenhöhe, Rahmen-Box-Modell je nach
     Feldtyp) - selbst wenn ihre Zellen im Grid exakt gleich hoch sind,
     wirkten die Felder dadurch "nicht ganz in einer Flucht". Feste Höhe +
     box-sizing sorgen dafür, dass jedes .input exakt gleich hoch ist. */
  height: 38px;
  box-sizing: border-box;
  line-height: 1.3;
}
textarea.input { height: auto; } /* Textarea braucht mehrere Zeilen - eigene Höhe per Inline-Style/CSS-Klasse */
.input:focus { outline: 2px solid var(--signal); outline-offset: 1px; }
#logSearch { flex: 1; }
.select { min-width: 140px; }
.export-group { display: flex; gap: 6px; }
.btn-ghost {
  background: var(--panel-raise);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 14.5px;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.btn-ghost:hover { background: var(--panel); border-color: var(--signal); color: var(--text); }
.btn-ghost:focus-visible { outline: 2px solid var(--signal); outline-offset: 1px; }

.btn-primary {
  background: var(--signal);
  border: 1px solid var(--signal);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 15px; font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px -2px rgba(76,141,255,.45);
  transition: filter .12s, transform .12s, box-shadow .12s;
}
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); box-shadow: 0 4px 12px -2px rgba(76,141,255,.55); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
/* BUGFIX: input/select/textarea haben ohne explizite Breite eine winzige
   Browser-Standardbreite (~20 Zeichen) - unabhängig davon, wie breit ihre
   Grid-Zelle eigentlich ist. Das machte z.B. die Symbol-Mapping-Felder
   ("xauusd.r" lief aus dem sichtbaren Feld) und die Felder im "Trade
   bearbeiten"-Formular unnötig schmal, obwohl reichlich Platz da war. */
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; }
.form-grid label {
  display: block;
  font-size: 14px; color: var(--text-muted); line-height: 1.4;
}
/* Info-Icon fließt direkt hinter dem Label-Text (normaler Inline-Fluss,
   kein Flex-Layout mehr) - vermeidet die früher separate, unsichtbare
   dritte Zeile pro Feld mit Tooltip. Das Eingabefeld selbst bleibt im
   normalen Dokumentfluss (KEIN position:absolute) - das ist bewusst
   konservativ: bei Mehrfachauswahl-Feldern (Setup/Fehler/Tags, siehe
   msField() in dashboard.js) ist die Struktur anders aufgebaut als bei
   einem einfachen <label><input></label> - eine Verankerung an der
   Label-Unterkante hätte dort im Zweifel zu Überlappungen führen können.
   Normaler Fluss garantiert, dass sich Felder NIE überlappen können, auch
   nicht bei unerwartet langem Text/vielen ausgewählten Tags. */
.form-grid label input, .form-grid label select, .form-grid label textarea {
  display: block; margin-top: 6px;
}
.form-grid .input { width: 100%; }

/* ---- Info-Tooltip: kleines "i"-Icon neben einem Label/Feld, zeigt bei
   Hover (nach kurzer Verzögerung, siehe initInfoTooltips in dashboard.js)
   eine Erklärung - für Felder wie API-Zugangsdaten, wo nicht sofort klar
   ist, was genau einzutragen ist und woher man es bekommt. ---- */
.info-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--panel-raise); border: 1px solid var(--hairline);
  color: var(--text-muted); font-size: 10px; font-weight: 700; font-style: normal;
  cursor: help; flex-shrink: 0; margin-left: 4px; user-select: none;
  line-height: 1;
}
.info-icon:hover, .info-icon:focus-visible { color: var(--signal); border-color: var(--signal); }
.info-tooltip {
  /* BUGFIX (siehe Chat: "Tooltip ist hinter dem Popup, muss immer ganz vorne
     sein") - lag vorher bei z-index 600, alle Modal-Overlays (Trade
     bearbeiten/anlegen etc., siehe dashboard.js) haben aber z-index 1000.
     Ein "i"-Tooltip INNERHALB eines offenen Modals (z.B. beim P&L-Feld)
     landete dadurch dahinter statt davor. Jetzt bewusst höher als jeder
     aktuell im Code vorkommende z-index (siehe auch .cal-hover-tip unten,
     gleicher Fix) - ein Tooltip soll IMMER ganz vorne erscheinen, egal
     worüber er gerade schwebt. */
  position: fixed; z-index: 2000; max-width: 320px;
  background: var(--panel); border: 1px solid var(--hairline); border-radius: 8px;
  padding: 10px 12px; box-shadow: 0 10px 30px rgba(0,0,0,.45);
  font-size: 13px; line-height: 1.5; color: var(--text);
  pointer-events: none; display: none;
}

.field-error {
  color: var(--short); font-size: 14.5px; margin-top: 8px;
}

/* ---- Risk gauges on account cards ---- */
/* ---- Chart-Container mit fester Höhe (Chart.js braucht das, um mit
   maintainAspectRatio:false zuverlässig responsive zu bleiben, OHNE bei
   breiten Fenstern/Bildschirmen unbegrenzt hoch zu wachsen - vorher gab es
   nur ein festes SEITENVERHÄLTNIS ohne Höhenobergrenze, wodurch der Chart
   auf breiten Bildschirmen z.B. 600-800px hoch werden konnte). Die Höhe ist
   bewusst über eine CSS-Variable gesetzt, damit sie sich an einer einzigen
   Stelle für alle drei Equity-Kurven-Vorkommen (Analytics/Dashboard/
   KI-Analyse) auf einmal anpassen lässt. ---- */
.chart-wrap { position: relative; height: var(--chart-height, 260px); width: 100%; }
.chart-wrap canvas { max-width: 100%; }

.gauge-row { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.gauge-label {
  display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-muted);
  margin-bottom: 3px;
}
.gauge-track {
  height: 5px; border-radius: 4px; background: var(--hairline); overflow: hidden;
}
.gauge-fill { height: 100%; border-radius: 4px; background: var(--signal); transition: width .3s; }
.gauge-fill.warn { background: var(--amber); }
.gauge-fill.danger { background: var(--short); }

.group-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--panel-raise); border: 1px solid var(--hairline);
  border-radius: 8px; padding: 8px 12px; margin: 0 8px 8px 0; font-size: 14.5px;
}
.group-chip .count { color: var(--text-dim); }
.group-chip button {
  background: none; border: none; color: var(--signal); cursor: pointer; font-size: 13px;
}

/* Gruppen-Karten: zeigen (anders als der fruehere reine Zahlen-Chip) auch,
   WELCHE Konten der Gruppe zugeordnet sind, inkl. ihres Verbindungs-Status -
   dieselben Punktfarben wie die Sidebar-Ampel (siehe getAccountStatusInfo()). */
.group-card {
  background: var(--panel-raise); border: 1px solid var(--hairline);
  border-radius: 8px; padding: 12px 14px; margin: 0 0 10px;
}
.group-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 8px;
}
.group-card-name { font-weight: 600; font-size: 15px; }
.group-card-head .count { color: var(--text-dim); font-size: 13px; }
.group-card-members {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px;
}
.group-member-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel); border: 1px solid var(--hairline);
  border-radius: 20px; padding: 3px 10px 3px 8px; font-size: 13px;
}
.group-card-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.group-card-actions button {
  background: none; border: none; color: var(--signal); cursor: pointer; font-size: 13px; padding: 0;
}

.group-select { font-size: 13px; margin-top: 8px; }

/* ---- Auth overlay ---- */
.auth-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: var(--void);
  display: flex; align-items: center; justify-content: center;
}
.auth-box {
  width: 340px;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 32px 28px;
}
.auth-box h2 {
  font-family: var(--font-display); font-size: 22px; margin: 0 0 4px; text-align: center;
}

.mono { font-family: var(--font-mono); }
.muted { color: var(--text-muted); }
/* Gleiche Spezifitäts-Falle wie bei .side-buy/.side-sell/.trend-* (siehe
   dort) - wird "muted" direkt auf eine <td> gesetzt (z.B. Lade-Platzhalter
   in Tabellen), gewinnt sonst .data-table td und die Zelle bleibt in
   normaler statt gedämpfter Textfarbe. */
.data-table td.muted { color: var(--text-muted); }

/* ============================================================
   Responsive
   ============================================================ */
/* Zwischenschritt fuer schmalere Laptop-/Tablet-Fenster, bevor die Sidebar
   ganz nach oben klappt: etwas weniger Aussenabstand, und die zweispaltigen
   Panel-Paare fallen schon hier auf eine Spalte, damit Chart + Tabelle (bzw.
   zwei Charts) nicht zu schmal werden, um noch lesbar zu sein. */
@media (max-width: 1200px) {
  .split-panel, .split-panel-even { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky; top: 0; z-index: 10;
    flex-direction: row; align-items: center; flex-wrap: wrap;
    padding: 10px 14px; border-right: none; border-bottom: 1px solid var(--hairline);
    height: auto; overflow-y: visible;
  }
  .brand { padding: 0 10px 0 0; }
  /* BUGFIX: "overflow-x: auto" liess die Navigation bei schmalem Fenster zu
     einem seitlich scrollbaren Streifen werden - man musste wischen/scrollen,
     um an die hinteren Menüpunkte zu kommen. Jetzt bricht die Navigation
     stattdessen einfach in mehrere Zeilen um, alles bleibt ohne Scrollen
     sofort sichtbar und klickbar. */
  .nav { flex-direction: row; flex-wrap: wrap; overflow-x: visible; flex-basis: 100%; }
  .acct-status { flex-basis: 100%; margin-top: 8px; }
  .sidebar-foot { padding: 10px 0 0; flex-basis: 100%; }
  .main { padding: 18px 16px 30px; }
  /* BUGFIX (Mobile): Eingabefelder waren unter 16px Schriftgroesse (15px/13px).
     iOS Safari zoomt beim Antippen eines Feldes automatisch rein, sobald dessen
     font-size < 16px ist - das machte z.B. das Trade-Formular (Eingeben/Bearbeiten)
     am iPhone unbedienbar/verzoomt. Ab 16px unterbleibt der Auto-Zoom. */
  .input, .group-select, select, textarea { font-size: 16px !important; }
}

@media (max-width: 480px) {
  .nav-item { font-size: 14px; padding: 8px; }
  /* Unterhalb von 480px passt keine 360px-Mindestbreite pro Kontokarte mehr
     ins Fenster - ohne diese Anpassung wuerde genau das das seitliche
     Scrollen auf dem Telefon verursachen. Eine Karte pro Zeile stattdessen. */
  .account-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .conn-pill.is-live .conn-dot { animation: none; }
  .view { animation: none; }
}

/* ============================================================
   Risiko-/Sizing-Schieberegler (Konto bearbeiten -> Sizing)
   ============================================================ */
.slider-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--hairline);
}
.slider-card:last-child { border-bottom: none; }
.slider-card-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(76,141,255,.12);
  display: flex; align-items: center; justify-content: center;
  color: var(--signal); flex-shrink: 0;
  margin-top: 1px;
}
.slider-card-icon svg { width: 18px; height: 18px; display: block; }
.slider-card-body { flex: 1; min-width: 0; }
.slider-card-label { font-size: 15.5px; font-weight: 600; color: var(--text); margin: 0 0 3px; }
.slider-card-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin: 0 0 12px; }
.slider-card-row {
  display: flex; align-items: center; gap: 14px;
}
.slider-card-row .slider-track { flex: 1; min-width: 0; }
.slider-card-value {
  font-family: var(--font-mono, monospace);
  font-size: 17px; font-weight: 700; color: var(--signal);
  text-align: right; width: 76px; flex-shrink: 0;
  padding: 7px 10px !important;
}
.slider-track {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px; border-radius: 2px;
  background: var(--hairline);
  outline: none; cursor: pointer;
}
.slider-track::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: transparent; }
.slider-track::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--signal); border: 2px solid var(--panel);
  margin-top: -6px; cursor: pointer;
  box-shadow: 0 0 0 3px rgba(76,141,255,.18);
}
.slider-track::-moz-range-track { height: 4px; border-radius: 2px; background: var(--hairline); }
.slider-track::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--signal); border: 2px solid var(--panel); cursor: pointer;
  box-shadow: 0 0 0 3px rgba(76,141,255,.18);
}
.pill-choice-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pill-choice {
  padding: 7px 14px; border-radius: 8px; border: 1px solid var(--hairline);
  background: var(--panel-raise); color: var(--text-muted);
  font-size: 14.5px; font-family: var(--font-mono, monospace); cursor: pointer;
}
.pill-choice.is-active { border-color: var(--signal); color: var(--signal); background: rgba(76,141,255,.1); }

/* ============================================================
   Journal-Erweiterung — Dashboard / Kalender / MTF / KI-Analyse
   (übernommen aus WIPA Trading Journal, umgestylt auf die
   bestehenden Design-Tokens dieser App - keine neuen Farben)
   ============================================================ */

/* ---- Settings: Sub-Tabs (Allgemein/Assets/Setups/Tags/Fehler) ---- */
.settings-tabs {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 1px solid var(--hairline);
}
.settings-tab {
  padding: 7px 14px; border-radius: 8px; border: 1px solid var(--hairline);
  background: var(--panel); color: var(--text-muted);
  font-size: 14.5px; font-weight: 600; cursor: pointer; font-family: var(--font-body);
}
.settings-tab:hover { color: var(--text); border-color: var(--signal); }
.settings-tab.is-active { background: var(--signal); border-color: var(--signal); color: #fff; }

/* ---- Kalender ---- */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr) 110px;
  gap: 6px;
}
.cal-head {
  font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-muted); padding: 4px 6px;
}
.cal-day {
  min-height: 74px; border: 1px solid var(--card-border); border-radius: var(--radius-md);
  background: var(--panel-raise); padding: 10px; position: relative;
  box-shadow: var(--card-shadow);
}
.cal-day.is-outside { opacity: .35; box-shadow: none; }
.cal-day.is-today { border-color: var(--signal); }
.cal-day .cal-num { font-size: 14px; font-weight: 700; color: var(--text); }
.cal-day .cal-pnl { margin-top: 8px; font-family: var(--font-mono); font-size: 14.5px; font-weight: 700; }
.cal-day .cal-count { font-size: 11.5px; color: var(--text-dim); margin-top: 2px; }
.cal-day.cal-pos { background: rgba(8,153,129,.08); border-color: rgba(8,153,129,.3); }
.cal-day.cal-neg { background: rgba(242,54,69,.08); border-color: rgba(242,54,69,.3); }
.cal-day .cal-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.cal-consistency-badge {
  font-size: 10.5px; font-weight: 700; padding: 2px 6px; border-radius: 5px;
  background: rgba(8,153,129,.16); color: var(--long); white-space: nowrap;
}
.cal-consistency-badge.is-over-limit { background: rgba(242,54,69,.16); color: var(--short); }
.cal-week-summary {
  min-height: 74px; border: 1px solid var(--card-border); border-radius: var(--radius-md);
  background: var(--panel); padding: 10px; display: flex; flex-direction: column; justify-content: center; gap: 3px;
  box-shadow: var(--card-shadow);
}
.cal-week-summary .cal-ws-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-dim); }
.cal-week-summary .cal-ws-val { font-family: var(--font-mono); font-size: 15px; font-weight: 700; }
.cal-week-summary .cal-ws-count { font-size: 11.5px; color: var(--text-dim); }

/* ---- Wochentag-Performance-Karten (Dashboard/Kalender) ---- */
.weekday-card {
  border: 1px solid var(--card-border); border-radius: var(--radius);
  background: var(--panel); padding: 14px 16px;
  box-shadow: var(--card-shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.weekday-card:hover { transform: translateY(-2px); box-shadow: var(--card-shadow-hover); }
.weekday-card .wd-label { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); font-weight: 700; }
.weekday-card .wd-pnl { font-family: var(--font-mono); font-size: 18.5px; font-weight: 700; margin-top: 6px; }
.weekday-card .wd-sub { font-size: 12px; color: var(--text-dim); margin-top: 3px; }

/* ---- MTF trend badges ---- */
.trend-badge { font-family: var(--font-mono); font-size: 13px; font-weight: 700; }
.trend-bull { color: var(--long); }
.trend-bear { color: var(--short); }
.trend-neu  { color: var(--text-dim); }
/* Gleiche Spezifitäts-Falle wie bei .side-buy/.side-sell (siehe dort) -
   .data-table td (Element+Klasse, 0-1-1) hat sonst Vorrang vor diesen
   Klassen allein (0-1-0) und überschreibt die Farbe stillschweigend. */
.data-table td.trend-bull { color: var(--long); }
.data-table td.trend-bear { color: var(--short); }
.data-table td.trend-neu  { color: var(--text-dim); }

/* ---- KI-Analyse insight lists ---- */
.ai-insight-list { display: flex; flex-direction: column; gap: 10px; }
.ai-insight-item {
  border: 1px solid var(--card-border); border-radius: var(--radius-md); padding: 12px 14px;
  background: var(--panel-raise); font-size: 14.5px; line-height: 1.5;
  box-shadow: var(--card-shadow);
}
.ai-insight-item strong { display: block; font-size: 14.5px; margin-bottom: 3px; color: var(--text); }
.ai-rank-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid var(--hairline); font-size: 14.5px;
}
.ai-rank-row:last-child { border-bottom: none; }

/* ============================================================
   Handelssitzungen — schlanke Ein-Zeilen-Variante fürs Dashboard
   (siehe Chat: "Handelssitzungen ... aber schlanker" - Gegenstück zur
   großen Kartenvariante, die früher auf Copy-Status stand)
   ============================================================ */
.session-pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.session-pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--panel); border: 1px solid var(--card-border); border-radius: 20px;
  padding: 6px 12px; font-size: 13px; box-shadow: var(--card-shadow);
}
.session-pill-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-dim); flex-shrink: 0; }
.session-pill.is-open .session-pill-dot { background: var(--long); animation: pulse 1.8s infinite; }
.session-pill-name { font-weight: 600; }
.session-pill-time { font-family: var(--font-mono); color: var(--text-muted); font-size: 12px; }

/* ============================================================
   Prop-Regeln — Phase-Umschalter + Live-Verdict-Zeilen
   ============================================================ */
.btn-ghost.is-active-tab { background: var(--signal); color: #fff; border-color: var(--signal); }
.prop-verdict-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 14px; line-height: 1.45;
  background: var(--panel-raise);
}
.prop-verdict-icon { flex-shrink: 0; font-weight: 700; width: 18px; text-align: center; }
.prop-verdict-ok { border-left: 3px solid var(--long); }

/* ============================================================
   KI-Analyse — Problem/Lösung-Karten (siehe Chat: "genau die
   Probleme sagen und mögliche Lösungen" statt nur Statistik-Listen) */
.ai-ps-card {
  border-radius: var(--radius-sm); background: var(--panel-raise);
  padding: 12px 14px; border-left: 3px solid var(--card-border);
}
.ai-ps-card.sev-high { border-left-color: var(--short); }
.ai-ps-card.sev-medium { border-left-color: var(--amber); }
.ai-ps-card.sev-low { border-left-color: var(--long); }
.ai-ps-problem { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.ai-ps-problem .ai-ps-badge {
  font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 5px;
  margin-right: 8px; vertical-align: middle; text-transform: uppercase; letter-spacing: .02em;
}
.sev-high .ai-ps-badge { background: rgba(242,54,69,.16); color: var(--short); }
.sev-medium .ai-ps-badge { background: rgba(255,176,32,.16); color: var(--amber); }
.sev-low .ai-ps-badge { background: rgba(8,153,129,.16); color: var(--long); }
.ai-ps-solution { font-size: 13.5px; line-height: 1.5; color: var(--text-muted); }
.ai-ps-solution strong { color: var(--text); }
.prop-verdict-ok .prop-verdict-icon { color: var(--long); }
.prop-verdict-warn { border-left: 3px solid var(--amber); }
.prop-verdict-warn .prop-verdict-icon { color: var(--amber); }
.prop-verdict-danger { border-left: 3px solid var(--short); }
.prop-verdict-danger .prop-verdict-icon { color: var(--short); }
.prop-verdict-muted { border-left: 3px solid var(--hairline); color: var(--text-muted); }
.prop-verdict-muted .prop-verdict-icon { color: var(--text-dim); }

/* ============================================================
   Dashboard-Verweiskarten (Copy-Status / Journal-Performance)
   ============================================================ */
.dash-link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.dash-link-card {
  display: flex; align-items: center; gap: 16px;
  background: var(--panel);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--card-shadow);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: transform .15s ease, box-shadow .15s ease;
}
.dash-link-card:hover { transform: translateY(-2px); box-shadow: var(--card-shadow-hover); }
.dash-link-card:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.dash-link-card-icon {
  width: 44px; height: 44px; border-radius: var(--radius-sm); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.dash-link-card-icon svg { width: 22px; height: 22px; display: block; }
.dash-link-card-body { flex: 1; min-width: 0; }
.dash-link-card-body h3 { margin: 0 0 4px; font-family: var(--font-display); font-size: 16.5px; font-weight: 600; }
.dash-link-card-body p { margin: 0; font-size: 13.5px; color: var(--text-muted); line-height: 1.45; }
.dash-link-card-arrow { font-size: 20px; color: var(--text-dim); flex-shrink: 0; transition: transform .15s ease, color .15s ease; }
.dash-link-card:hover .dash-link-card-arrow { transform: translateX(3px); color: var(--signal); }
.kpi-card-chart { flex-direction: column; align-items: stretch; }
.kpi-card-chart .kpi-label { display: block; margin-bottom: 2px; }

/* ---- Halbkreis-Gauge ---- */
.wc-gauge { display: flex; flex-direction: column; align-items: center; margin-top: 4px; }
.wc-gauge-svg { width: 100%; max-width: 150px; height: auto; overflow: visible; }
.wc-gauge-track { fill: none; stroke: var(--panel-raise); stroke-width: 9; stroke-linecap: round; }
.wc-gauge-fill { fill: none; stroke-width: 9; stroke-linecap: round; transition: d .3s ease; }
.wc-gauge-dot { stroke: var(--panel); stroke-width: 2.5; }
.wc-gauge-value { font-family: var(--font-mono); font-size: 24px; font-weight: 700; margin-top: -8px; }
.wc-gauge-caption { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ---- Donut ---- */
.wc-donut { position: relative; display: flex; align-items: center; justify-content: center; margin-top: 4px; }
.wc-donut-svg { width: 100%; max-width: 120px; height: auto; }
.wc-donut-segment { fill: none; transition: stroke-dasharray .3s ease; }
.wc-donut-empty { fill: none; stroke: var(--panel-raise); stroke-width: 14; }
.wc-donut-center {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  text-align: center; pointer-events: none;
}
.wc-donut-center-value { font-family: var(--font-mono); font-size: 17px; font-weight: 700; }
.wc-donut-center-label { font-size: 10.5px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; }

/* ---- Dual-Bar (z.B. Ø Gewinn vs. Ø Verlust) ---- */
.wc-dualbar-track {
  display: flex; width: 100%; height: 8px; border-radius: 4px; overflow: hidden;
  background: var(--panel-raise);
}
.wc-dualbar-fill { height: 100%; transition: width .3s ease; }
.wc-dualbar-labels {
  display: flex; justify-content: space-between; margin-top: 8px;
  font-family: var(--font-mono); font-size: 15px; font-weight: 700;
}
.wc-dualbar-compact .wc-dualbar-track { height: 5px; }
.wc-dualbar-compact .wc-dualbar-labels { font-size: 11.5px; margin-top: 5px; }

/* ---- Hourly-Liste ---- */
.wc-hourly-list { display: flex; flex-direction: column; }
.wc-hourly-row {
  display: grid; grid-template-columns: 52px 1fr 90px 56px;
  align-items: center; gap: 10px;
  padding: 7px 0; border-bottom: 1px solid var(--hairline);
  font-size: 13.5px;
}
.wc-hourly-row:last-child { border-bottom: none; }
.wc-hourly-time { font-family: var(--font-mono); color: var(--text-muted); }
.wc-hourly-bar-wrap {
  height: 6px; border-radius: 3px; background: var(--panel-raise); overflow: hidden;
}
.wc-hourly-bar { display: block; height: 100%; border-radius: 3px; transition: width .3s ease; }
.wc-hourly-bar.is-pos { background: var(--long); }
.wc-hourly-bar.is-neg { background: var(--short); }
.wc-hourly-value { font-family: var(--font-mono); font-weight: 600; text-align: right; }
.wc-hourly-value.is-pos { color: var(--long); }
.wc-hourly-value.is-neg { color: var(--short); }
.wc-hourly-share { color: var(--text-dim); font-size: 12px; text-align: right; }
.ms-dropdown { position: relative; }
.ms-summary {
  display: block; cursor: pointer; user-select: none;
  list-style: none; white-space: normal; word-break: break-word; line-height: 1.4;
  padding-right: 22px; position: relative; min-height: 20px;
}
.ms-summary::-webkit-details-marker { display: none; }
.ms-summary::after { content: '▾'; position: absolute; right: 12px; top: 8px; color: var(--text-dim); }
.ms-dropdown[open] .ms-summary::after { content: '▴'; }
.ms-panel {
  position: absolute; z-index: 50; top: calc(100% + 4px); left: 0; right: 0;
  max-height: 220px; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--card-border); border-radius: var(--radius-sm);
  padding: 6px; box-shadow: var(--card-shadow-hover);
}
.ms-option {
  display: flex; align-items: flex-start; gap: 9px; padding: 7px 8px; border-radius: 6px;
  font-size: 14.5px; line-height: 1.35; cursor: pointer;
}
.ms-option input[type="checkbox"] {
  width: 15px; height: 15px; margin-top: 2px; flex-shrink: 0;
  accent-color: var(--signal);
  cursor: pointer;
}
.ms-option:hover { background: var(--panel-raise); }

/* ---- Kalender: Hover-Tooltip mit Tages-Trades ---- */
.cal-hover-tip {
  /* BUGFIX: gleicher Grund/gleiche Lösung wie bei .info-tooltip oben - lag
     vorher bei z-index 500, unter jedem Modal-Overlay (z-index 1000). */
  position: fixed; z-index: 2000; min-width: 220px; max-width: 320px;
  background: var(--panel); border: 1px solid var(--hairline); border-radius: 8px;
  padding: 10px 12px; box-shadow: 0 10px 30px rgba(0,0,0,.45);
  font-size: 14px; pointer-events: none; display: none;
}
.cal-hover-tip .cht-date { font-weight: 700; font-size: 14.5px; margin-bottom: 6px; color: var(--text); }
.cal-hover-tip .cht-row {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 3px 0; border-bottom: 1px solid var(--hairline);
}
.cal-hover-tip .cht-row:last-child { border-bottom: none; }
.cal-day { cursor: default; }

/* ---- Trade-Journal: kompakte Tabelle (keine horizontale Scrollbar mehr
   bei normaler Fensterbreite - Konto+Master-Konto zusammengelegt, kürzere
   Werte, kleinere Schrift/Padding nur für diese eine Tabelle) ---- */
.table-compact { font-size: 13px; table-layout: auto; }
.table-compact th, .table-compact td { padding: 7px 8px; }
.table-compact th { font-size: 11px; }
.journal-note-cell {
  max-width: 140px; font-size: 12.5px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.journal-edit-btn {
  font-size: 15px; line-height: 1; padding: 5px 8px; min-width: 30px;
}

/* ---- Makro-Cockpit ---- */
.mk-profile-btn.is-active { border-color: var(--signal); color: var(--signal); background: rgba(76,141,255,.1); }
.mk-country-card {
  border: 1px solid var(--hairline); border-radius: var(--radius); padding: 14px;
  background: var(--panel-raise);
}
.mk-country-card .mk-country-title {
  font-family: var(--font-display); font-weight: 600; font-size: 15px;
  color: var(--signal); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 8px;
}
.mk-country-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; border-bottom: 1px solid var(--hairline); font-size: 14px;
}
.mk-country-row:last-child { border-bottom: none; }
.mk-country-row .mk-val { font-weight: 700; font-family: var(--font-mono); font-size: 14px; }

/* ---- News-Feed ---- */
.nf-pill {
  padding: 6px 12px; border-radius: 20px; border: 1px solid var(--hairline);
  background: var(--panel); color: var(--text-muted);
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.nf-pill.is-active { background: var(--signal); border-color: var(--signal); color: #fff; }
.nf-card {
  border: 1px solid var(--hairline); border-radius: var(--radius); background: var(--panel);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 6px;
}
.nf-card:hover { border-color: var(--signal); }
.nf-card-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-dim); }
.nf-card-source {
  padding: 2px 8px; border-radius: 4px; background: var(--panel-raise);
  font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--signal);
}
.nf-card-title { font-size: 15.5px; font-weight: 600; color: var(--text); text-decoration: none; }
.nf-card-title:hover { color: var(--signal); }
.nf-card-desc { font-size: 14px; color: var(--text-muted); line-height: 1.5; }

/* ---- Tages-Checkliste (Dashboard) ---- */
.dc-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid var(--hairline); font-size: 15px;
}
.dc-item:last-child { border-bottom: none; }
.dc-item input[type="checkbox"] { width: 16px; height: 16px; flex-shrink: 0; }
.dc-item.is-checked span { color: var(--text-dim); text-decoration: line-through; }
.dc-progress-bar {
  height: 6px; border-radius: 3px; background: var(--panel-raise); overflow: hidden; margin-top: 4px;
}
.dc-progress-fill { height: 100%; background: var(--long); border-radius: 3px; transition: width .25s ease; }

/* ---- Monatsziele (Dashboard) ---- */
.goal-row { margin-bottom: 14px; }
.goal-row:last-child { margin-bottom: 0; }
.goal-row-head { display: flex; justify-content: space-between; font-size: 14.5px; margin-bottom: 5px; }
.goal-row-head .goal-label { color: var(--text-muted); }
.goal-row-head .goal-val { font-family: var(--font-mono); font-weight: 700; }
.goal-track { height: 8px; border-radius: 4px; background: var(--panel-raise); overflow: hidden; }
.goal-fill { height: 100%; border-radius: 4px; transition: width .25s ease; }

/* ---- Wiederverwendbares Mikro-Label über Unterabschnitten (z.B. "DETAILS",
   "LIVE COPY-STATUS") - vereinheitlicht, was vorher an mehreren Stellen als
   Inline-Style dupliziert war, für einen ruhigeren, konsistenteren Rhythmus. ---- */
.section-label {
  font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-dim); font-weight: 600; margin: 0 0 10px;
}

/* Journal-Modus (siehe Chat: "2 komplett getrennte Programme" - Journal
   soll nichts mit der Copy-Engine zu tun haben). Wird per JS in
   dashboard.js beim Start anhand von GET /api/app-mode gesetzt (body-Klasse
   "journal-only-mode") - blendet ALLE Elemente mit dem Attribut
   [data-copier-only] aus (Nav-Einträge Copy-Status/Live Trades/Logs,
   Symbol-Mapping/Signal-Filter/Risiko-Profil/Verbindung testen/Diagnose/
   Pause-Aktiv-Deaktivieren pro Konto, "Copier-Funktion"- und "Engine"-
   Bereich in den Einstellungen). "Konten" selbst bleibt sichtbar/nutzbar
   (Name/Typ/Anlegen/Löschen), da Journal-Einträge weiterhin einem Konto
   zugeordnet werden können sollen. */
.journal-only-mode [data-copier-only] {
  display: none !important;
}

/* Umgekehrtes Prinzip zu [data-copier-only] oben: Felder, die NUR im
   Journal-Modus sichtbar sein sollen (z.B. das freie "Broker"-Textfeld statt
   der technischen Plattform-Dropdown, siehe Chat: "Broker soll ein
   Eingabefenster sein, keine Dropdown"). Standardmäßig versteckt (Full/
   Copier-Modus), nur im Journal-Modus sichtbar. */
.journal-only-field {
  display: none;
}
.journal-only-mode .journal-only-field {
  display: block;
}

/* Gamma-Exposure-Seite - bewusst eigenes dunkles Farbschema (unabhängig vom
   Hell/Dunkel-Umschalter der restlichen App), das dem Vorbild (dunkles
   Navy, kräftiges Grün/Rot) so nah wie möglich kommt - siehe Chat: "die
   Seite soll komplett gleich sein, auch die Farben". */
.gex-panel {
  background: #0d1424;
  border-radius: 12px;
  padding: 16px;
  color: #cdd6e8;
}
.gex-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.gex-symbol-input {
  background: #131c30;
  border: 1px solid #232f47;
  color: #e8edf7;
  border-radius: 8px;
  padding: 8px 12px;
  width: 90px;
  text-transform: uppercase;
  font-family: var(--font-mono, monospace);
}
.gex-range-group, .gex-view-group {
  display: flex;
  background: #131c30;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.gex-range-btn, .gex-view-btn {
  background: transparent;
  border: none;
  color: #8b96ac;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
}
.gex-range-btn.active, .gex-view-btn.active {
  background: #d99a3d;
  color: #1a1305;
}
.gex-range-btn:hover:not(.active), .gex-view-btn:hover:not(.active) {
  color: #cdd6e8;
}
.gex-expiration-select {
  background: #131c30;
  border: 1px solid #232f47;
  color: #cdd6e8;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
}
.gex-preset-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.gex-preset-row .btn-ghost {
  color: #8b96ac;
  border-color: #232f47;
}
.gex-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 1px;
  background: #232f47;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 14px;
}
.gex-kpi {
  background: #131c30;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.gex-kpi-label {
  font-size: 10.5px;
  letter-spacing: .04em;
  color: #6b7690;
  text-transform: uppercase;
}
.gex-kpi-value {
  font-family: var(--font-mono, monospace);
  font-size: 17px;
  font-weight: 700;
  color: #e8edf7;
}
.gex-kpi-sub {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  color: #6b7690;
}
.gex-amber { color: #d99a3d; }
.gex-green { color: #22c55e; }
.gex-red { color: #f5495c; }
#view-gamma-exposure #gammaChartWrap,
#view-gamma-exposure #gammaProfileWrap {
  background: #0d1424;
  border-radius: 10px;
  padding: 8px;
}

/* Hell-Modus (siehe Chat: "mache den Hintergrund auch hell im Hell-Modus
   und dunkel im Dunkel-Modus") - dieselben Elemente wie oben, nur mit
   hellen statt dunklen Farben. Die Chart.js-Farben (Tooltip/Achsen/Grid)
   werden separat in journal-extra.js per JS erkannt (gexIsLightTheme()),
   da Chart.js eigene Optionen statt CSS nutzt. */
:root[data-theme="light"] .gex-panel {
  background: #f4f6fb;
  color: #1a2436;
}
:root[data-theme="light"] .gex-symbol-input {
  background: #ffffff;
  border-color: #d7dce6;
  color: #1a2436;
}
:root[data-theme="light"] .gex-range-group,
:root[data-theme="light"] .gex-view-group {
  background: #e7ebf3;
}
:root[data-theme="light"] .gex-range-btn,
:root[data-theme="light"] .gex-view-btn {
  color: #5b6478;
}
:root[data-theme="light"] .gex-expiration-select {
  background: #ffffff;
  border-color: #d7dce6;
  color: #1a2436;
}
:root[data-theme="light"] .gex-preset-row .btn-ghost {
  color: #5b6478;
  border-color: #d7dce6;
}
:root[data-theme="light"] .gex-kpi-row {
  background: #d7dce6;
}
:root[data-theme="light"] .gex-kpi {
  background: #ffffff;
}
:root[data-theme="light"] .gex-kpi-label,
:root[data-theme="light"] .gex-kpi-sub,
:root[data-theme="light"] .gex-kpi-ref {
  color: #6b7387;
}
:root[data-theme="light"] .gex-kpi-value {
  color: #1a2436;
}
:root[data-theme="light"] #view-gamma-exposure #gammaChartWrap,
:root[data-theme="light"] #view-gamma-exposure #gammaProfileWrap {
  background: #f4f6fb;
}
:root[data-theme="light"] .gex-reference-hint {
  background: #ffffff;
  border-color: #d7dce6;
  color: #5b6478;
}
:root[data-theme="light"] .gex-profile-head {
  border-top-color: #d7dce6;
}
:root[data-theme="light"] .gex-profile-head h3 {
  color: #1a2436;
}
:root[data-theme="light"] .gex-profile-sub {
  color: #5b6478;
}
:root[data-theme="light"] .gex-guide {
  background: #f4f6fb;
  border-color: #d7dce6;
  color: #1a2436;
}
:root[data-theme="light"] .gex-guide h2,
:root[data-theme="light"] .gex-guide h3 {
  color: #1a2436;
}
:root[data-theme="light"] .gex-guide p,
:root[data-theme="light"] .gex-guide li {
  color: #3a4256;
}

.gex-profile-head {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #232f47;
}
.gex-profile-head h3 {
  font-family: var(--font-display);
  font-size: 15px;
  margin: 0 0 6px;
  color: #e8edf7;
}
.gex-profile-sub {
  font-size: 12.5px;
  color: #8b96ac;
  margin: 0;
}

.gex-reference-hint {
  background: #131c30;
  border: 1px solid #232f47;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12.5px;
  color: #8b96ac;
  margin-bottom: 14px;
}
.gex-reference-hint strong {
  color: #d99a3d;
}

.gex-kpi-ref {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: #6b7690;
}

.gex-guide {
  background: #0d1424;
  border: 1px solid #232f47;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 18px;
  color: #cdd6e8;
}
.gex-guide h2 {
  font-family: var(--font-display);
  font-size: 16px;
  margin: 0 0 14px;
  color: #e8edf7;
}
.gex-guide h3 {
  font-family: var(--font-display);
  font-size: 13.5px;
  margin: 16px 0 6px;
  color: #e8edf7;
}
.gex-guide h3:first-of-type {
  margin-top: 0;
}
.gex-guide p, .gex-guide li {
  font-size: 13px;
  line-height: 1.55;
  color: #cdd6e8;
}
.gex-guide ul {
  margin: 4px 0 0;
  padding-left: 20px;
}
