/* Design tokens. The palette follows the dark trading-terminal convention:
   near-black surfaces, one accent, and green/red reserved for direction. */
:root {
  --bg:          #0e1117;
  --surface:     #131722;
  --surface-2:   #1a1f2e;
  --surface-3:   #222738;
  --border:      #2a2e39;
  --border-soft: #21242f;

  --text:        #e6e9ef;
  --text-dim:    #b2b5be;
  --text-faint:  #787b86;

  --accent:      #2962ff;
  --accent-soft: rgba(41, 98, 255, 0.14);
  --up:          #089981;
  --down:        #f23645;
  --warn:        #f6c177;

  --radius:   8px;
  --radius-s: 4px;
  --shadow:   0 8px 28px rgba(0, 0, 0, 0.45);

  --header-h: 56px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

#app { height: 100%; display: flex; flex-direction: column; }

button { font-family: inherit; font-size: inherit; cursor: pointer; }
input  { font-family: inherit; font-size: inherit; }
a { color: inherit; text-decoration: none; }

/* ---------- header ---------- */
.header {
  height: var(--header-h);
  flex: 0 0 var(--header-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 40;
}

.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-s);
  color: var(--text-dim);
  transition: background .12s, color .12s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }

.burger { display: flex; flex-direction: column; gap: 4px; }
.burger span {
  display: block; width: 17px; height: 2px;
  background: currentColor; border-radius: 2px;
}

.brand {
  font-weight: 650;
  letter-spacing: -0.2px;
  font-size: 15px;
}
.brand .dim { color: var(--text-faint); font-weight: 500; }

.header-spacer { flex: 1; }

.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 650;
  color: #fff;
  border: none;
  background: var(--accent);
}
.avatar.guest { background: var(--surface-3); color: var(--text-faint); }

/* ---------- popovers ---------- */
.popover {
  position: absolute;
  top: calc(var(--header-h) - 6px);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 232px;
  padding: 6px;
  z-index: 50;
}
.popover.left  { left: 10px; }
.popover.right { right: 10px; }

.popover-head {
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 6px;
}
.popover-head .name { font-weight: 600; }
.popover-head .sub  { color: var(--text-faint); font-size: 12px; margin-top: 2px; }

.menu-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 9px 12px;
  background: transparent; border: none;
  color: var(--text-dim);
  border-radius: var(--radius-s);
  text-align: left;
}
.menu-item:hover { background: var(--surface-3); color: var(--text); }
.menu-item.active { background: var(--accent-soft); color: var(--accent); }
.menu-item .badge {
  margin-left: auto;
  background: var(--down); color: #fff;
  font-size: 11px; font-weight: 650;
  padding: 1px 6px; border-radius: 9px;
}
.menu-sep { height: 1px; background: var(--border-soft); margin: 6px 4px; }

/* ---------- generic ---------- */
.page { flex: 1; overflow: auto; }
.center-wrap {
  min-height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 48px 20px 64px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-s);
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  transition: filter .12s, background .12s;
}
.btn:hover { filter: brightness(1.1); }
.btn:disabled { opacity: .55; cursor: not-allowed; filter: none; }
.btn.ghost { background: transparent; border-color: var(--border); color: var(--text-dim); }
.btn.ghost:hover { background: var(--surface-3); color: var(--text); }
.btn.danger { background: var(--down); }
/* A ghost button stays a ghost even when it is the destructive one: solid
   red for "remove one of several accounts" shouts louder than the action. */
.btn.ghost.danger {
  background: transparent; color: var(--down); border-color: var(--down);
}
.btn.ghost.danger:hover { background: rgba(242, 54, 69, .14); }
.btn.small { padding: 6px 12px; font-size: 12.5px; font-weight: 500; }

.link { color: var(--accent); cursor: pointer; }
.link:hover { text-decoration: underline; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12.5px; color: var(--text-dim); }
.field input {
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  color: var(--text);
  outline: none;
}
.field input:focus { border-color: var(--accent); }

.notice {
  padding: 10px 12px;
  border-radius: var(--radius-s);
  font-size: 13px;
  margin-bottom: 14px;
  border: 1px solid transparent;
}
.notice.error { background: rgba(242,54,69,.12); border-color: rgba(242,54,69,.4); color: #ff9aa2; }
.notice.ok    { background: rgba(8,153,129,.12); border-color: rgba(8,153,129,.4); color: #6ee7b7; }
.notice.info  { background: var(--surface-2); border-color: var(--border); color: var(--text-dim); }

/* ---------- landing ---------- */
.hero { text-align: center; max-width: 760px; }
.hero h1 {
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.1;
  margin: 0 0 14px;
  letter-spacing: -1px;
  font-weight: 680;
}
.hero p { color: var(--text-dim); font-size: 16px; margin: 0 0 40px; line-height: 1.55; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  width: min(100%, 960px);
  margin-bottom: 44px;
}
@media (max-width: 760px) { .feature-grid { grid-template-columns: 1fr; } }

.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: left;
  transition: border-color .15s, transform .15s;
}
.feature:hover { border-color: #39405a; transform: translateY(-2px); }
.feature .ico {
  width: 38px; height: 38px;
  border-radius: var(--radius-s);
  display: grid; place-items: center;
  margin-bottom: 14px;
  background: var(--accent-soft); color: var(--accent);
}
.feature h3 { margin: 0 0 8px; font-size: 15.5px; font-weight: 620; }
.feature p  { margin: 0; color: var(--text-faint); font-size: 13.5px; line-height: 1.55; }
.feature.muted { opacity: .55; }
.feature .soon {
  display: inline-block; margin-top: 12px;
  font-size: 11px; letter-spacing: .4px; text-transform: uppercase;
  color: var(--text-faint); border: 1px solid var(--border);
  padding: 2px 7px; border-radius: 3px;
}

.cta { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.cta .btn { min-width: 220px; }
.cta .sub { color: var(--text-faint); font-size: 13px; }

/* ---------- auth card ---------- */
.card {
  width: min(100%, 400px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 28px;
}
.card h2 { margin: 0 0 6px; font-size: 20px; font-weight: 640; }
.card .lead { color: var(--text-faint); font-size: 13.5px; margin: 0 0 22px; }
.card .foot { margin-top: 18px; text-align: center; color: var(--text-faint); font-size: 13px; }

/* ---------- settings / admin ---------- */
.settings { display: flex; flex: 1; width: 100%; height: 100%; min-height: 0; }
.settings-tabs {
  width: 212px; flex: 0 0 212px;
  border-right: 1px solid var(--border);
  background: var(--surface);
  padding: 14px 8px;
  overflow: auto;
}
.settings-tabs .group {
  font-size: 10.5px; letter-spacing: .6px; text-transform: uppercase;
  color: var(--text-faint); padding: 10px 12px 6px;
}
.settings-body { flex: 1; overflow: auto; padding: 26px 30px 60px; }
.settings-body h2 { margin: 0 0 4px; font-size: 19px; font-weight: 640; }
.settings-body .lead { color: var(--text-faint); font-size: 13.5px; margin: 0 0 24px; }

/* Auf dem Telefon oben eine Leiste statt links eine Spalte.
 *
 * 212 px Seitenspalte sind auf 375 px Bildschirm 57 % der Breite, und zwar
 * dauerhaft: die Reiterauswahl stand offen ueber dem halben Bildschirm,
 * waehrend der Inhalt daneben auf eine Spalte von anderthalb Woertern
 * zusammenfiel. Die Reiter gehoeren in eine Zeile, die seitlich rollt;
 * die Gruppentitel fallen dabei weg, denn die Namen tragen sich selbst.
 */
@media (max-width: 760px) {
  .settings { flex-direction: column; }
  .settings-tabs {
    width: 100%; flex: 0 0 auto;
    display: flex; gap: 4px;
    border-right: none; border-bottom: 1px solid var(--border);
    padding: 6px 8px;
    overflow-x: auto; overflow-y: hidden;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .settings-tabs::-webkit-scrollbar { height: 0; }
  .settings-tabs .group { display: none; }
  .settings-tabs .menu-item {
    /* `width: 100 %` aus der Grundregel macht jeden Reiter so breit wie
       die Leiste; in einer Zeile sollen sie so breit sein wie ihr Text. */
    width: auto; flex: 0 0 auto; white-space: nowrap;
    padding: 9px 13px; border-radius: var(--radius-s);
  }
  .settings-body { padding: 16px 14px 48px; }
}

/* Eine Tabelle, die breiter ist als der Bereich, rollt in sich selbst.
   Ohne den Behaelter rollte der ganze Bereich seitlich mit, und
   Ueberschrift wie Einleitung wanderten aus dem Bild, obwohl nur die
   Tabelle zu breit war. */
.data-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 26px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.stat .label {
  font-size: 11.5px; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px;
}
.stat .value { font-size: 25px; font-weight: 640; font-variant-numeric: tabular-nums; }
.stat .value.accent { color: var(--accent); }
.stat .value.up { color: var(--up); }
.stat .value.warn { color: var(--warn); }
.stat .hint { font-size: 12px; color: var(--text-faint); margin-top: 5px; }

table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left; font-weight: 550; color: var(--text-faint);
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg);
}
table.data td { padding: 11px 12px; border-bottom: 1px solid var(--border-soft); }
table.data tr:hover td { background: var(--surface); }

.pill {
  display: inline-block; padding: 2px 9px; border-radius: 10px;
  font-size: 11.5px; font-weight: 550;
}
.pill.admin   { background: rgba(41,98,255,.18);  color: #7aa2ff; }
.pill.high    { background: rgba(246,193,119,.16); color: var(--warn); }
.pill.user    { background: var(--surface-3);      color: var(--text-dim); }
.pill.active  { background: rgba(8,153,129,.16);  color: #4ec9a5; }
.pill.pending { background: rgba(246,193,119,.16); color: var(--warn); }
.pill.blocked { background: rgba(242,54,69,.16);  color: #ff8a93; }

.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot.on  { background: var(--up); box-shadow: 0 0 0 3px rgba(8,153,129,.16); }
.dot.off { background: var(--border); }

.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

select.input {
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-s);
  padding: 5px 8px; font-size: 12.5px;
}

.spark { display: flex; align-items: flex-end; gap: 2px; height: 34px; margin-top: 8px; }
.spark i { flex: 1; background: var(--accent); border-radius: 1px; min-height: 2px; opacity: .75; }

/* ---------- charts ----------
   Die Seite als Arbeitsfläche aus Panels: Leiste, Werkzeuge, Chart und
   Handel sind abgerundete Flächen mit schmalen Fugen auf dem dunklen
   Grund — die Formensprache der Signal-Trading-Seite, übertragen auf ein
   Werkzeug, das jeden Pixel für den Chart braucht. Am Telefon fallen
   Fugen und Rundungen weg (siehe unten). */
.chart-page {
  display: flex; flex-direction: column; height: 100%; min-height: 0;
  gap: 6px; padding: 6px; background: var(--bg);
}
.symbol-bar {
  flex: 0 0 auto; position: relative;
  display: flex; align-items: center; gap: 8px;
  min-height: 52px; padding: 7px 10px;
  background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px;
}
.bar-spacer { flex: 1; min-width: 8px; }

/* Börse und Symbol in einem Feld, mit Lupe davor. */
.sym-group {
  display: flex; align-items: center; height: 36px; min-width: 0; flex: 0 1 auto;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  transition: border-color .12s, box-shadow .12s;
}
.sym-group:hover { border-color: #3a4256; }
.sym-group:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sym-group .exchange-select {
  height: 100%; padding: 0 6px 0 11px;
  background: transparent; border: none; border-right: 1px solid var(--border);
  border-radius: 10px 0 0 10px; color: var(--text-dim); font-weight: 600;
}
.sym-icon { display: grid; place-items: center; padding-left: 10px; color: var(--text-faint); }
.symbol-input {
  height: 34px; width: 150px; padding: 0 12px 0 8px;
  background: transparent; border: none; border-radius: 0 10px 10px 0;
  color: var(--text); outline: none;
  font-weight: 700; letter-spacing: .3px;
}
.symbol-input::placeholder { color: var(--text-faint); font-weight: 500; }

/* Zeitrahmen als Segment: die Favoriten in einer Schiene, der gewählte
   blau hinterlegt, rechts der Pfeil zur ganzen Liste. */
.tf-group { display: flex; gap: 2px; }
.tf {
  height: 28px; padding: 0 10px; border-radius: 7px;
  background: transparent; border: none; color: var(--text-dim);
  font-size: 12.5px; font-weight: 600;
  transition: background .12s, color .12s;
}
.tf:hover { background: var(--surface-3); color: var(--text); }
.tf.on { background: var(--accent); color: #fff; box-shadow: 0 1px 8px rgba(41, 98, 255, .35); }

.suggest {
  position: absolute; top: 44px; left: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow);
  width: 260px; max-height: 320px; overflow: auto; z-index: 30; padding: 6px;
}
.suggest button {
  display: flex; width: 100%; gap: 10px; align-items: baseline;
  padding: 9px 12px; background: transparent; border: none; border-radius: 8px;
  color: var(--text); text-align: left;
}
.suggest button:hover, .suggest button.cursor { background: var(--surface-3); }
.suggest .q { color: var(--text-faint); font-size: 12px; margin-left: auto; }

.chart-host {
  flex: 1; min-height: 0; min-width: 0; position: relative;
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
}
/* Gerundet wird die Zeichenfläche selbst, nicht der Behälter: ein
   `overflow: hidden` dort schnitte Menüs ab, die aus dem Chart ragen. */
.chart-host canvas { display: block; position: absolute; inset: 0; border-radius: 11px; }

.chart-legend {
  position: absolute; left: 12px; top: 10px;
  display: flex; align-items: center; gap: 0;
  font-size: 12px; color: var(--text-dim);
  z-index: 5; font-variant-numeric: tabular-nums;
  padding: 3px 6px; border-radius: var(--radius-s);
  /* Only the gear reacts; the text must not swallow chart drags. */
  pointer-events: none;
}
.chart-legend > * { pointer-events: none; }
.chart-legend.boxed {
  background: color-mix(in srgb, var(--surface) calc(var(--legend-alpha, .6) * 100%), transparent);
}
.chart-legend .sym { font-weight: 650; color: var(--text); margin-right: 8px; }
.legend-logo {
  width: 9px; height: 9px; border-radius: 50%;
  margin-right: 7px; flex: 0 0 9px;
}
.legend-gear {
  width: 22px; height: 20px; margin-left: 8px; flex: 0 0 22px;
  display: grid; place-items: center;
  background: transparent; border: none; border-radius: var(--radius-s);
  color: var(--text-faint);
  opacity: 0; transition: opacity .12s, color .12s;
  pointer-events: none;
}
/* The gear appears when the pointer is over the whole status line. */
.chart-legend:hover .legend-gear { opacity: 1; pointer-events: auto; }
.legend-gear:hover { color: var(--text); background: var(--surface-3); }
.chart-legend:hover { pointer-events: auto; }

.scale-btns { display: flex; gap: 4px; }
.scale-btns.always { opacity: 1; }
.scale-btns.never { display: none; }
.scale-btn {
  width: 22px; height: 20px;
  display: grid; place-items: center;
  font-size: 10.5px; font-weight: 650;
  /* Opaque: these sit over the axis, where tick labels run behind them. */
  background: var(--surface-2); color: var(--text-faint);
  border: 1px solid var(--border); border-radius: 6px;
}
.scale-btn:hover { background: var(--surface-3); color: var(--text); }
.scale-btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }

.empty {
  display: grid; place-items: center; height: 100%;
  color: var(--text-faint); font-size: 14px;
}
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--border); border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- chart shell ---------- */
.chart-body { flex: 1; min-height: 0; display: flex; }
/* Abstand per Rand statt `gap`: die geschlossene Handelsleiste ist null
   breit, bekäme mit `gap` aber trotzdem eine Fuge. */
.toolbar-slot { flex: 0 0 auto; display: flex; margin-right: 6px; }

.bar-sep { width: 1px; height: 22px; background: var(--border); }

.exchange-select {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-s); color: var(--text);
  padding: 7px 8px; outline: none; font-size: 12.5px; font-weight: 550;
}
.exchange-select:focus { border-color: var(--accent); }
/* Im Symbolfeld leuchtet das ganze Feld, nicht nur der Trennstrich. */
.sym-group .exchange-select:focus { border-color: var(--border); }

.symbol-box { position: relative; display: flex; align-items: center; min-width: 0; }

.chart-status {
  color: var(--text-faint); font-size: 12px; font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px;
}
/* „lädt…" oder ein Fehler: als Abzeichen, nicht als loser Text. */
.chart-status:not(:empty) {
  padding: 5px 11px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border-soft);
}
.chart-legend .ex {
  color: var(--text-faint); font-size: 11px; margin-right: 3px;
  text-transform: uppercase; letter-spacing: .4px;
}
/* Die Leerzeichen in „ H " gehen verloren: in einer Flex-Zeile wird
   Weißraum am Rand jedes Elements entfernt, und O, H, L, C klebten an
   den Zahlen davor. Der Abstand kommt deshalb vom Rand. */
.chart-legend .ohlc-k { color: var(--text-faint); margin: 0 3px 0 8px; }

.chart-toast {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%);
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow);
  padding: 9px 15px; font-size: 12.5px; color: var(--text);
  z-index: 20; max-width: 70%;
}

/* ---------- timeframe picker ---------- */
.tf-picker {
  position: relative; display: flex; align-items: center; gap: 2px;
  height: 36px; padding: 3px;
  background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 10px;
}
.tf-caret {
  height: 28px; padding: 0 8px; border: none; border-radius: 7px;
  background: transparent; color: var(--text-dim); font-size: 13px;
}
.tf-caret:hover { background: var(--surface-3); color: var(--text); }
.tf.transient { opacity: .9; }

.tf-dropdown {
  position: absolute; top: 42px; left: 0; z-index: 30;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow);
  /* Nur senkrecht scrollen: seitlich verschob sich das Menü (25.11.). */
  width: 200px; max-height: 420px; overflow-x: hidden; overflow-y: auto; padding: 6px;
}
.tf-group-title {
  padding: 8px 12px 4px; font-size: 10.5px; font-weight: 700;
  color: var(--text-faint); letter-spacing: .6px;
}

/* Auf das Menü eingegrenzt: `tf-` gibt es zweimal, einmal hier für den
   Zeitrahmen-Wähler und einmal weiter unten für die Trading-Einstellungen.
   Ohne die Eingrenzung gewann die spätere Regel und gab diesen Zeilen
   Rahmen und Polsterung, für die sie nicht gebaut sind. */
.tf-dropdown .tf-row {
  display: flex; align-items: center; flex-wrap: nowrap; gap: 0;
  /* Die Zeilen der Trading-Einstellungen heißen ebenfalls .tf-row und
     brachten Rahmen, Polster und Hintergrund mit — jede Zeile stand als
     eigener Kasten im Menü. */
  padding: 0; margin: 0; border: 0; background: transparent; border-radius: 8px;
}
.tf-dropdown .tf-row:hover { background: var(--surface-3); }
.tf-dropdown .tf-row.active .tf-row-main { color: var(--accent); font-weight: 650; }
.tf-dropdown .tf-row-main {
  /* `min-width: 0` gegen die gleichnamige Regel der Trading-Einstellungen
     (180 px), die die Zeile breiter als das Menü machte. */
  flex: 1; min-width: 0; text-align: left; padding: 7px 12px;
  background: transparent; border: none; color: var(--text); font-size: 13px;
}
.star {
  width: 26px; height: 26px; margin-right: 5px;
  background: transparent; border: none; border-radius: var(--radius-s);
  color: var(--text-faint); font-size: 13px; line-height: 1;
}
.star.on { color: var(--warn); }
.star:hover { background: var(--surface-3); }

/* ---------- drawing tool rail ---------- */
.tool-rail {
  width: 46px; height: 100%;
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 6px 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  overflow-y: auto; overflow-x: hidden;
  /* Dünn, aber da: ist der Chart niedrig (Strategie-Test offen), liegen
     Rückgängig und Löschen unterhalb, und ohne Leiste weiß niemand das. */
  scrollbar-width: thin;
}
.tool-btn {
  width: 34px; height: 32px; flex: 0 0 32px;
  display: grid; place-items: center;
  background: transparent; border: 1px solid transparent;
  border-radius: 9px; color: var(--text-dim);
  transition: background .12s, color .12s;
}
.tool-btn:hover { background: var(--surface-3); color: var(--text); }
.tool-btn.on { background: var(--accent-soft); border-color: rgba(41, 98, 255, .45); color: #8fa9ff; }
.tool-btn.on.strong { background: var(--accent); border-color: var(--accent); color: #fff; }
.tool-btn:disabled { opacity: .3; cursor: default; }
.tool-btn:disabled:hover { background: transparent; color: var(--text-dim); }
.tool-sep { width: 24px; height: 1px; background: var(--border); margin: 5px 0; flex: 0 0 1px; }

/* ---------- selected-drawing bar ---------- */
/* Spec §2.1: top centre of the chart area, draggable, ~40 px tall. */
.draw-props {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 5px;
  padding: 5px 8px; z-index: 15; height: 42px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow);
}
.props-grip {
  display: flex; align-items: center; justify-content: center;
  width: 20px; height: 28px; padding: 0; cursor: grab;
  background: transparent; border: none; color: var(--text-dim);
  touch-action: none;
}
.props-grip:active { cursor: grabbing; }
.prop-wrap { position: relative; display: flex; }
.prop-btn.wide {
  display: flex; align-items: center; gap: 3px; width: auto; padding: 0 7px;
}
.prop-label { font-size: 12px; white-space: nowrap; }
.prop-group { display: flex; align-items: center; gap: 4px; }
.menu-pop.prop-pop { top: 34px; min-width: 150px; }
.menu-pop.prop-pop.wide-pop { min-width: 210px; }
.menu-pop.prop-pop .menu-pop-item {
  display: flex; align-items: center; gap: 9px;
}
.menu-pop.prop-pop .menu-pop-item.on { color: var(--accent); }
.width-sample { display: block; width: 34px; border-radius: 1px; }
.style-sample { color: var(--text-dim); font-family: ui-monospace, monospace; }
.draw-props .swatches { display: flex; gap: 3px; }
.swatch {
  width: 17px; height: 17px; border-radius: 50%;
  border: 2px solid transparent; padding: 0;
}
.swatch.on { border-color: var(--text); }
.color-input {
  width: 26px; height: 24px; padding: 0;
  background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius-s); cursor: pointer;
}
.width-input { width: 74px; accent-color: var(--accent); }
.style-group { display: flex; gap: 2px; }
.style-btn, .prop-btn {
  min-width: 26px; height: 26px; padding: 0 5px;
  background: transparent; border: 1px solid transparent;
  border-radius: 7px; color: var(--text-dim); font-size: 11.5px;
}
.style-btn:hover, .prop-btn:hover { background: var(--surface-3); color: var(--text); }
.style-btn.on, .prop-btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.prop-btn.danger:hover { background: rgba(242, 54, 69, .16); color: var(--down); }
.props-sep { width: 1px; height: 18px; background: var(--border); }

/* ---------- layout menu ---------- */
.layout-menu { position: relative; }
.layout-trigger {
  display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px; max-width: 230px;
  background: transparent; border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font-size: 12.5px; font-weight: 600;
  transition: background .12s, border-color .12s;
}
.layout-trigger:hover { background: var(--surface-3); border-color: #3a4256; }
.layout-trigger > svg { color: var(--text-faint); flex: 0 0 auto; }
/* Das Menü hängt rechts unter dem Knopf: der sitzt am rechten Rand. */
.layout-menu > .menu-pop { left: auto; right: 0; }
.layout-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layout-trigger .caret { color: var(--text-faint); font-size: 10px; }
.layout-dot { width: 6px; height: 6px; border-radius: 50%; flex: 0 0 6px; }
.layout-dot.clean  { background: var(--up); }
.layout-dot.dirty  { background: var(--warn); }
.layout-dot.saving { background: var(--accent); }
.layout-dot.error  { background: var(--down); }

/* Deliberately not `.popover`: that class belongs to the header menus, and
   sharing it made the profile menu inherit a left offset and stretch. */
.menu-pop {
  position: absolute; top: 42px; left: 0; z-index: 35;
  min-width: 215px; padding: 6px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow);
}
.menu-pop-item {
  display: block; width: 100%; text-align: left;
  padding: 8px 12px; background: transparent; border: none; border-radius: 8px;
  color: var(--text); font-size: 13px;
}
.menu-pop-item:hover { background: var(--surface-3); }
.menu-pop-item.danger { color: var(--down); }
.menu-pop-sep { height: 1px; background: var(--border); margin: 5px 4px; }
.menu-pop-check {
  display: flex; align-items: center; gap: 9px; border-radius: 8px;
  padding: 8px 12px; font-size: 13px; color: var(--text-dim); cursor: pointer;
}
.menu-pop-check input { accent-color: var(--accent); }

/* ---------- modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(8, 10, 14, .62);
  display: grid; place-items: center;
  backdrop-filter: blur(4px);
}
.modal {
  width: 460px; max-width: calc(100vw - 32px); max-height: 80vh;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow);
}
.modal-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 650; flex: 1; }
.modal-x {
  width: 28px; height: 28px; border: none; border-radius: 8px;
  background: transparent; color: var(--text-faint); font-size: 19px; line-height: 1;
}
.modal-x:hover { background: var(--surface-3); color: var(--text); }
.modal-tabs { display: flex; gap: 2px; padding: 9px 12px 0; border-bottom: 1px solid var(--border); }
.modal-tab {
  padding: 7px 13px; background: transparent; border: none;
  border-bottom: 2px solid transparent; color: var(--text-faint); font-size: 13px;
}
.modal-tab:hover { color: var(--text); }
.modal-tab.on { color: var(--text); border-bottom-color: var(--accent); }
.modal-body { padding: 8px 16px 14px; overflow: auto; }
.modal-foot {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 16px; border-top: 1px solid var(--border);
}
.modal-search {
  margin: 12px 16px 6px; padding: 9px 12px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); outline: none;
}
.modal-search:focus { border-color: var(--accent); }

.setting-row {
  display: flex; align-items: center; gap: 14px;
  padding: 9px 0; border-bottom: 1px solid var(--border-soft);
}
.setting-row:last-child { border-bottom: none; }
.setting-label { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.setting-label small { color: var(--text-faint); font-size: 11.5px; }
.check-input { accent-color: var(--accent); width: 16px; height: 16px; }
.num-input {
  width: 62px; padding: 5px 7px; text-align: right;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-s); color: var(--text); outline: none;
}
.num-input:focus { border-color: var(--accent); }

/* ---------- layout browser ---------- */
.layout-browser { width: 520px; }
.layout-list { overflow: auto; padding: 4px 8px 12px; min-height: 120px; }
.layout-list .empty { height: 120px; }
.layout-row {
  display: flex; align-items: center; gap: 2px;
  border-radius: var(--radius-s);
}
.layout-row:hover { background: var(--surface-2); }
.layout-row.active { background: var(--accent-soft); }
.layout-row-main {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px;
  padding: 9px 6px; text-align: left;
  background: transparent; border: none; color: var(--text);
}
.layout-row-name {
  font-size: 13.5px; font-weight: 550;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.layout-row-meta { font-size: 11.5px; color: var(--text-faint); }
.row-icon {
  width: 28px; height: 28px; flex: 0 0 28px;
  background: transparent; border: none; border-radius: var(--radius-s);
  color: var(--text-faint); font-size: 13px;
}
.row-icon:hover { background: var(--surface-3); color: var(--text); }
.row-icon.danger:hover { background: rgba(242, 54, 69, .16); color: var(--down); }

/* The suggestion list now hangs off the symbol box, not the whole bar. */
.symbol-box .suggest { top: 36px; left: 0; }
.text-input {
  width: 150px; padding: 4px 7px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-s); color: var(--text); outline: none; font-size: 12.5px;
}
.text-input:focus { border-color: var(--accent); }

.tf-add {
  display: block; width: 100%; text-align: left;
  padding: 8px 12px; background: transparent; border: none;
  color: var(--accent); font-size: 12.5px; font-weight: 550;
}
.tf-add:hover { background: var(--surface-3); }
/* Die Trennlinie des Menüs. Wurde von der gleichnamigen Regel der
   Einstellungen überschrieben und war dadurch unsichtbar. */
.tf-dropdown .tf-sep { height: 1px; background: var(--border); margin: 4px 0; }
.tf-remove {
  width: 22px; height: 24px; margin-right: 4px;
  background: transparent; border: none; border-radius: var(--radius-s);
  color: var(--text-faint); font-size: 14px; line-height: 1;
}
.tf-remove:hover { background: rgba(242, 54, 69, .16); color: var(--down); }


/* ---------- settings dialog ---------- */
.set-modal { width: 750px; height: 620px; max-height: 86vh; }
.set-main { flex: 1; min-height: 0; display: flex; }
.set-nav {
  flex: 0 0 186px; padding: 12px 10px;
  display: flex; flex-direction: column; gap: 2px;
  border-right: 1px solid var(--border);
}
.set-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: var(--radius-s);
  background: transparent; border: 1px solid transparent;
  color: var(--text-dim); font-size: 13px; text-align: left;
}
.set-nav-item:hover { background: var(--surface-2); color: var(--text); }
.set-nav-item.on {
  background: var(--surface-2); border-color: var(--border); color: var(--text);
}
.set-body { flex: 1; min-width: 0; overflow-y: auto; padding: 14px 20px 20px; }

.set-section {
  font-size: 10.5px; font-weight: 700; letter-spacing: .7px;
  color: var(--text-faint); text-transform: uppercase;
  margin: 18px 0 8px;
}
.set-section:first-child { margin-top: 2px; }
.set-gap { height: 14px; }
.set-indent { padding-left: 26px; }

.set-row {
  display: flex; align-items: center; gap: 14px;
  min-height: 38px; padding: 3px 0;
}
.set-label { flex: 1; min-width: 0; font-size: 13px; color: var(--text); }
.set-controls { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.set-check-label {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text); cursor: pointer;
}
.set-check { width: 16px; height: 16px; accent-color: var(--accent); flex: 0 0 16px; }

/* The app's own colour field, not the browser's input. */
.set-color.cf-btn {
  width: 34px; height: 28px; padding: 3px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-s); cursor: pointer;
}
.set-color.cf-btn:hover { background: var(--surface-3); }
.set-select {
  min-width: 108px; max-width: 230px; padding: 7px 9px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-s); color: var(--text); font-size: 12.5px; outline: none;
}
.set-select.wide { min-width: 190px; }
.set-select:focus { border-color: var(--accent); }
.set-number {
  width: 78px; padding: 7px 9px; text-align: left;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-s); color: var(--text); font-size: 12.5px; outline: none;
}
.set-number:focus { border-color: var(--accent); }
.set-unit { display: flex; align-items: center; gap: 8px; }
.set-unit span { color: var(--text-faint); font-size: 12.5px; }
.set-slider { width: 150px; accent-color: var(--accent); }

.preset-menu { position: relative; }
.menu-pop.presets { top: auto; bottom: 36px; max-height: 330px; overflow: auto; }
.menu-pop-item.accent { color: var(--accent); }
.preset-head {
  padding: 9px 13px 4px; font-size: 10.5px; font-weight: 700;
  letter-spacing: .6px; color: var(--text-faint); text-transform: uppercase;
}
.preset-row { display: flex; align-items: center; }
.preset-row:hover { background: var(--surface-3); }
.preset-main {
  flex: 1; min-width: 0; text-align: left; padding: 8px 13px;
  background: transparent; border: none; color: var(--text); font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- indicators ---------- */
.bar-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 12px; border-radius: 10px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-dim); font-size: 12.5px; font-weight: 600; white-space: nowrap;
  transition: background .12s, color .12s, border-color .12s;
}
.bar-btn:hover { background: var(--surface-3); color: var(--text); border-color: #3a4256; }
.bar-btn-icon { display: grid; place-items: center; }

.ind-modal { width: 620px; height: 520px; }
.ind-modal .set-nav { flex: 0 0 170px; }
.ind-modal .modal-search { margin-bottom: 10px; }
.ind-list { flex: 1; overflow-y: auto; padding: 8px 10px 14px; }
.ind-row { display: flex; align-items: center; border-radius: var(--radius-s); }
.ind-row:hover { background: var(--surface-2); }
.ind-main {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px;
  padding: 9px 6px; text-align: left;
  background: transparent; border: none; color: var(--text);
}
.ind-name { font-size: 13.5px; font-weight: 550; }
.ind-meta { font-size: 11.5px; color: var(--text-faint); }
.ind-settings { width: 520px; max-height: 76vh; }
.ind-settings .set-body { padding: 10px 18px 18px; }
.empty-inline {
  padding: 14px 2px; color: var(--text-faint); font-size: 12.5px; line-height: 1.5;
}

/* ---------- pane legends ---------- */
.pane-legends { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
.pane-legend {
  position: absolute; left: 12px;
  display: flex; flex-direction: column; gap: 1px;
}
.leg-row {
  display: flex; align-items: center; gap: 7px;
  padding: 1px 5px; border-radius: 3px;
  font-size: 11.5px; color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  pointer-events: auto; cursor: default;
}
.leg-row:hover { background: color-mix(in srgb, var(--surface) 70%, transparent); }
.leg-row.on { box-shadow: inset 0 0 0 1px var(--border); }
.leg-row.dim { opacity: .45; }
.leg-title { font-weight: 650; color: var(--text); }
.leg-inputs { color: var(--text-faint); }
.leg-error { color: var(--warn); }
.leg-actions { display: flex; gap: 1px; margin-left: 4px; opacity: 0; transition: opacity .1s; }
.leg-row:hover .leg-actions { opacity: 1; }
.leg-btn {
  width: 22px; height: 20px;
  display: grid; place-items: center;
  background: transparent; border: none; border-radius: 3px;
  color: var(--text-faint);
}
.leg-btn:hover { background: var(--surface-3); color: var(--text); }
.menu-pop.leg-more { top: 24px; left: 12px; pointer-events: auto; }

/* ---------- markets ---------- */
.markets-page { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.markets-body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px; }
.markets-top { display: flex; gap: 14px; align-items: stretch; margin-bottom: 16px; }
.heat-wrap { flex: 1; min-width: 0; }
.heat-host {
  position: relative; width: 100%; height: 440px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.heat-tile {
  position: absolute; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  border: none; border-radius: 3px; padding: 0;
  color: #fff; overflow: hidden; transition: filter .1s;
}
.heat-tile:hover { filter: brightness(1.25); z-index: 2; }
.heat-sym { font-weight: 700; letter-spacing: .3px; white-space: nowrap; }
.heat-change { font-size: 11px; opacity: .92; font-variant-numeric: tabular-nums; }

.fng-card {
  flex: 0 0 230px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.fng-head { font-size: 12px; color: var(--text-faint); font-weight: 600; }
.fng-dial {
  position: relative; width: 170px; height: 85px;
  border-radius: 170px 170px 0 0; margin-top: 10px;
  -webkit-mask: radial-gradient(circle at 50% 100%, transparent 54px, #000 55px);
  mask: radial-gradient(circle at 50% 100%, transparent 54px, #000 55px);
}
.fng-needle {
  position: absolute; left: 50%; bottom: 0;
  width: 2px; height: 72px; margin-left: -1px;
  background: var(--text); transform-origin: 50% 100%;
  border-radius: 2px; transition: transform .35s ease;
}
.fng-hub {
  position: absolute; left: 50%; bottom: -5px;
  width: 10px; height: 10px; margin-left: -5px;
  border-radius: 50%; background: var(--text);
}
.fng-value { font-size: 30px; font-weight: 700; line-height: 1; margin-top: 4px; }
.fng-label { font-size: 12.5px; color: var(--text-dim); }
.fng-history {
  display: flex; align-items: flex-end; gap: 3px; height: 46px; margin-top: 8px;
}
.fng-history i { width: 9px; border-radius: 2px; display: block; }

.coin-table {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.coin-row {
  display: grid;
  grid-template-columns: 44px minmax(160px, 1.6fr) 1fr 1fr 1fr 1fr;
  align-items: center; gap: 10px;
  padding: 9px 14px; font-size: 12.5px;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
}
.coin-row:last-child { border-bottom: none; }
.coin-row:hover { background: var(--surface-2); }
.coin-row.head {
  color: var(--text-faint); font-size: 11.5px; font-weight: 600;
  cursor: default; background: var(--surface-2);
}
.coin-row.head:hover { background: var(--surface-2); }
.coin-row .th {
  background: transparent; border: none; color: inherit;
  font: inherit; text-align: left; padding: 0;
}
.coin-row .th.on { color: var(--accent); }
.coin-row .num { text-align: right; font-variant-numeric: tabular-nums; }
.coin-row .rank { color: var(--text-faint); }
.coin-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.coin-name img { border-radius: 50%; flex: 0 0 18px; }
.coin-name .dim {
  color: var(--text-faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

@media (max-width: 900px) {
  .markets-top { flex-direction: column; }
  .fng-card { flex: 0 0 auto; }
  .coin-row { grid-template-columns: 36px 1.4fr 1fr 1fr; }
  .coin-row > :nth-child(5), .coin-row > :nth-child(6) { display: none; }
}

/* ---------- AI Analysen ---------- */
.ai-page { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.ai-body {
  flex: 1; min-height: 0; overflow-y: auto; padding: 14px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px;
  align-content: start;
}
.ai-body > .empty { grid-column: 1 / -1; min-height: 240px; }
.ai-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
}
.ai-card.wide { grid-column: 1 / -1; }
.ai-card h4 { margin: 0 0 12px; font-size: 13px; font-weight: 650; }
.ai-card h5 { margin: 0 0 5px; font-size: 12px; font-weight: 600; color: var(--text-dim); }

.ai-setup-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.ai-setup-head h4 { margin: 0; flex: 1; }
.badge-status {
  padding: 3px 10px; border-radius: 20px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .4px;
}
.badge-status.ok { background: rgba(8, 153, 129, .18); color: var(--up); }
.badge-status.bad { background: rgba(242, 54, 69, .18); color: var(--down); }
.badge-status.warn { background: rgba(246, 193, 119, .18); color: var(--warn); }

.ai-kpis {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
  gap: 10px 14px;
}
.ai-kpi { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ai-kpi-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-faint);
}
.ai-kpi-value { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ai-kpi-value.ok { color: var(--up); }
.ai-kpi-value.bad { color: var(--down); }
.ai-kpi-value.warn { color: var(--warn); }
.ai-summary { margin: 14px 0 0; font-size: 13px; line-height: 1.6; color: var(--text-dim); }

.ai-table { font-size: 12px; }
.ai-tr {
  display: grid; grid-template-columns: 54px 1fr 1.7fr 1fr 1.1fr 1.3fr;
  gap: 8px; align-items: center; padding: 7px 0;
  border-bottom: 1px solid var(--border-soft);
}
.ai-tr:last-child { border-bottom: none; }
.ai-tr.head { color: var(--text-faint); font-size: 11px; font-weight: 600; }
.ai-tr span { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ai-tr .tf-cell { font-weight: 650; color: var(--text); }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; display: block; }
.dot.ok { background: var(--up); }
.dot.bad { background: var(--down); }
.dot.warn { background: var(--warn); }
.dot.idle { background: var(--text-faint); }

.vp-rows { margin-top: 12px; display: flex; flex-direction: column; gap: 2px; }
.vp-row { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.vp-row.poc { background: rgba(41, 98, 255, .10); border-radius: 3px; }
.vp-row.va .vp-price { color: var(--text); }
.vp-price {
  flex: 0 0 92px; text-align: right; color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.vp-bar { display: flex; height: 11px; border-radius: 2px; overflow: hidden; min-width: 1px; }
.vp-buy { background: var(--up); display: block; }
.vp-sell { background: var(--down); display: block; }
.vp-tag {
  font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 3px;
  letter-spacing: .4px;
}
.vp-tag.hvn { background: rgba(41, 98, 255, .2); color: #6e9bff; }
.vp-tag.lvn { background: rgba(246, 193, 119, .18); color: var(--warn); }

.cvd-chart { height: 110px; margin-top: 12px; color: var(--accent); }
.cvd-chart svg { width: 100%; height: 100%; display: block; }
.ai-note { margin-top: 8px; font-size: 12px; color: var(--warn); }

.ai-block { margin-bottom: 14px; }
.ai-block:last-child { margin-bottom: 0; }
.ai-block ul { margin: 0; padding-left: 18px; }
.ai-block li, .ai-block p {
  font-size: 12.5px; line-height: 1.65; color: var(--text-dim); margin: 0 0 4px;
}
.set-check-label .dim { color: var(--text-faint); }

@media (max-width: 1000px) {
  .ai-body { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- tool rail: groups, flyouts, favourites ---------- */
.tool-btn.group { position: relative; }
.tool-caret {
  position: absolute; right: 2px; bottom: 2px;
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-bottom: 4px solid currentColor;
  opacity: .55;
}
.tool-btn.group:hover .tool-caret { opacity: 1; }

.tool-flyout {
  position: fixed; z-index: 120;
  min-width: 268px; max-height: calc(100vh - 16px);
  overflow-y: auto; padding: 6px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow);
}
.flyout-title {
  padding: 7px 13px 9px; font-size: 12px; font-weight: 650;
  color: var(--text); border-bottom: 1px solid var(--border); margin-bottom: 5px;
}
.flyout-head {
  padding: 9px 13px 4px; font-size: 10.5px; font-weight: 700;
  letter-spacing: .6px; color: var(--text-faint); text-transform: uppercase;
}
.flyout-row { display: flex; align-items: center; border-radius: 8px; }
.flyout-row:hover { background: var(--surface-3); }
.flyout-row.disabled { opacity: .38; }
.flyout-row.disabled:hover { background: transparent; }
.flyout-main {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px;
  padding: 7px 13px; text-align: left;
  background: transparent; border: none; color: var(--text); font-size: 13px;
}
.flyout-main:disabled { cursor: default; }
.flyout-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flyout-key {
  font-size: 10.5px; color: var(--text-faint);
  border: 1px solid var(--border); border-radius: 3px; padding: 1px 5px;
}

.fav-bar {
  position: fixed; z-index: 60;
  display: flex; align-items: center; gap: 2px;
  padding: 4px 5px 4px 3px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow);
}
.fav-grip {
  display: flex; flex-direction: column; gap: 2px;
  padding: 6px 5px; cursor: grab; flex: 0 0 auto;
}
.fav-grip:active { cursor: grabbing; }
.fav-grip i { width: 10px; height: 1.5px; background: var(--text-faint); border-radius: 2px; }
.fav-items { display: flex; align-items: center; gap: 1px; }
.fav-btn {
  width: 30px; height: 28px;
  display: grid; place-items: center;
  background: transparent; border: 1px solid transparent;
  border-radius: 8px; color: var(--text-dim);
}
.fav-btn:hover { background: var(--surface-3); color: var(--text); }
.fav-btn.on { background: var(--accent-soft); border-color: rgba(41, 98, 255, .45); color: #8fa9ff; }
.fav-empty { padding: 0 8px; font-size: 11.5px; color: var(--text-faint); }

.keys-modal { height: 600px; }
.keys-modal .set-body { padding: 10px 20px 20px; }
.key-input { width: 54px; text-align: center; text-transform: uppercase; }

/* ---------- phones ---------- */
.tools-toggle { display: none; }
.chart-page.tools-hidden .toolbar-slot { display: none; }

@media (max-width: 760px) {
  /* Am Telefon gehört jeder Pixel dem Chart: keine Fugen, keine
     Rundungen, die Flächen stoßen aneinander. */
  .chart-page { gap: 0; padding: 0; }
  .symbol-bar {
    gap: 6px; padding: 6px 8px; min-height: 0;
    border-width: 0 0 1px; border-radius: 0;
  }
  .toolbar-slot { margin-right: 0; }
  .tool-rail { border-width: 0 1px 0 0; border-radius: 0; }
  .chart-host { border: none; border-radius: 0; }
  .chart-host canvas { border-radius: 0; }

  /* Oben bleiben nur Symbol und Layout. Werkzeuge, Zeitrahmen, Typ,
     Indikatoren, Einstellungen und Handel stehen in der Leiste unten —
     vorher rollte die obere Leiste seitlich, und fast alles lag außerhalb.
     Zeitrahmen und Typ bleiben im Baum, weil ihre Listen dort hängen; nur
     ihre Knöpfe verschwinden. */
  .symbol-bar > .tools-toggle, .symbol-bar > .gear-btn, .symbol-bar > .ind-btn,
  .symbol-bar > .bar-trade, .symbol-bar > .bar-spacer { display: none; }
  .symbol-bar > .tf-picker, .symbol-bar > .type-wrap {
    position: absolute; left: 0; top: 0; width: 0; height: 0;
    padding: 0; border: 0; overflow: visible;
  }
  .symbol-bar > .tf-picker > :not(.tf-dropdown), .type-wrap > .type-btn { display: none; }
  .sym-group { flex: 1 1 auto; height: 38px; }
  .sym-group .exchange-select { max-width: 92px; padding: 0 2px 0 9px; font-size: 12px; }
  .sym-icon { display: none; }
  .symbol-box { flex: 1; }
  .symbol-input { width: 100%; min-width: 0; padding: 0 10px; }
  .chart-status:not(:empty) { max-width: 110px; padding: 4px 8px; font-size: 11px; }
  .layout-trigger { max-width: 132px; height: 38px; padding: 0 10px; gap: 6px; }

  /* A floating bar on a 375 px screen covers the chart; it stays available
     through the star button but is out of the way by default. */
  .fav-bar { display: none; }

  .chart-legend { left: 6px; top: 6px; font-size: 10px; padding: 2px 4px; }
  .chart-legend .ex { display: none; }
  .pane-legend { left: 6px; }
  .leg-row { font-size: 10px; gap: 5px; }
  .leg-actions { opacity: 1; }

  .draw-props { bottom: 10px; gap: 5px; padding: 5px 7px; }
  .draw-props .swatches { display: none; }
  .width-input { width: 54px; }

  .scale-btns { bottom: 42px; opacity: 1; }

  .modal { width: calc(100vw - 16px); max-height: 88vh; }
  .set-modal, .ind-modal, .keys-modal { width: calc(100vw - 16px); height: 82vh; }
  .set-nav { flex-basis: 128px; padding: 8px 6px; }
  .set-nav-item { padding: 8px; font-size: 12px; gap: 6px; }
  .set-body { padding: 10px 12px 16px; }
  .set-select { min-width: 92px; max-width: 150px; }
  .set-select.wide { min-width: 120px; }
  .set-row { gap: 8px; }

  .tool-flyout { max-width: calc(100vw - 52px); }
  .markets-body { padding: 8px; }
  .heat-host { height: 320px; }
  .ai-body { padding: 8px; gap: 8px; }
}

@media (max-width: 760px) {
  /* The status line must stay one line, or the indicator rows below it
     collide with the symbol. */
  .chart-legend {
    white-space: nowrap; max-width: calc(100% - 78px);
    overflow: hidden; text-overflow: ellipsis;
  }
}

/* Scale buttons sit against the bottom right of their own pane. */
.scale-layer { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
/* Sitting on the price axis; the left/right offset comes from the view,
   which knows which side the axis is on. */
.scale-layer .scale-btns {
  position: absolute; top: 0;
  display: flex; gap: 4px; pointer-events: auto;
  opacity: 0; transition: opacity .15s;
}
.chart-host:hover .scale-layer .scale-btns { opacity: 1; }
.gear-btn { width: 36px; padding: 0; }

/* ---------- quick order ---------- */

/* The plus follows the crosshair along the price axis. It is only worth
   showing while the pointer is on the chart, which is also the only time
   it has a price to act on. */
.quick-btn {
  position: absolute; z-index: 7;
  width: 18px; height: 18px; padding: 0;
  display: grid; place-items: center;
  font-size: 14px; line-height: 1; font-weight: 500;
  background: var(--accent); color: #fff;
  border: none; border-radius: 5px;
  opacity: 0; transition: opacity .12s, transform .12s;
  pointer-events: none;
}
.chart-host:hover .quick-btn { opacity: .85; pointer-events: auto; }
.quick-btn:hover { opacity: 1; transform: scale(1.12); }

.quick-order {
  z-index: 60; width: 240px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow);
  padding: 10px; display: flex; flex-direction: column; gap: 8px;
}
.qo-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12px;
}
.qo-price { font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 650; }
.qo-sizes { display: flex; align-items: center; gap: 4px; }
.qo-label { font-size: 11px; color: var(--text-dim); margin-right: auto; }
.qo-size {
  padding: 3px 8px; font-size: 11px; font-weight: 600;
  background: var(--surface-2); color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 999px;
}
.qo-size.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.qo-actions { display: flex; flex-direction: column; gap: 4px; }
.qo-action {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 7px 10px; text-align: left;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 9px;
}
.qo-action:hover { background: var(--surface-3); border-color: var(--accent); }
.qo-action-text { font-size: 12px; font-weight: 600; }
.qo-action-hint { font-size: 10.5px; color: var(--text-faint); }
.qo-sep {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-faint); border-top: 1px solid var(--border); padding-top: 6px;
}
.qo-status { font-size: 11px; color: var(--text-dim); min-height: 14px; }
.qo-status.bad { color: var(--down); }

/* On a touch screen there is no hover to reveal the button, so it stays. */
@media (hover: none) {
  .quick-btn { opacity: .8; pointer-events: auto; }
  .quick-order { width: calc(100vw - 32px); max-width: 300px; }
}

/* ---------- chart type selector ---------- */
.type-wrap { position: relative; display: flex; }
.type-btn { display: flex; align-items: center; gap: 3px; }
.bar-caret { font-size: 11px; color: var(--text-dim); }
.menu-pop.chart-types { min-width: 180px; }
.menu-pop-item.type-row {
  display: flex; align-items: center; gap: 10px;
}
.menu-pop-item.type-row.on { color: var(--accent); }

/* ---------- color picker (spec §1.6) ---------- */
.cp-pop {
  position: fixed; z-index: 120;
  padding: 12px; width: max-content;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 7px; box-shadow: var(--shadow);
  font-size: 12px; color: var(--text);
}
.cp-page { display: flex; flex-direction: column; gap: 8px; }
.cp-grid {
  display: grid; grid-template-columns: repeat(11, 18px); gap: 3px;
}
.cp-custom { display: flex; flex-wrap: wrap; gap: 3px; }
.cp-cell {
  width: 18px; height: 18px; padding: 0; border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.10); cursor: pointer;
}
.cp-cell:hover { outline: 1px solid var(--text-dim); outline-offset: 1px; }
.cp-cell.on { outline: 2px solid var(--accent); outline-offset: 1px; }
.cp-plus {
  background: var(--surface-3); color: var(--text-dim);
  font-size: 13px; line-height: 1;
}
.cp-sep { height: 1px; background: var(--border); margin: 2px 0; }
.cp-label { color: var(--text-dim); font-size: 11px; }

.cp-alpha-row { display: flex; align-items: center; gap: 8px; }
.cp-alpha-track {
  position: relative; flex: 1; min-width: 120px; height: 16px; border-radius: 3px;
  /* Chequerboard under the gradient, so 0 % reads as transparent. */
  background-image:
    linear-gradient(to right, transparent, var(--cp-color, #2962ff)),
    linear-gradient(45deg, #555 25%, transparent 25%, transparent 75%, #555 75%),
    linear-gradient(45deg, #555 25%, #888 25%, #888 75%, #555 75%);
  background-size: 100% 100%, 8px 8px, 8px 8px;
  background-position: 0 0, 0 0, 4px 4px;
}
.cp-alpha { position: absolute; inset: 0; width: 100%; margin: 0; opacity: 0.65; }
.cp-alpha-num {
  width: 46px; padding: 3px 5px; text-align: right;
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: 4px; color: var(--text); font-size: 12px;
}
.cp-pct { color: var(--text-dim); }

.cp-field {
  position: relative; width: 206px; height: 120px; border-radius: 4px;
  cursor: crosshair; touch-action: none;
  background-image:
    linear-gradient(to top, #000, transparent),
    linear-gradient(to right, #fff, hsl(var(--cp-hue, 219) 100% 50%));
}
.cp-dot {
  position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px;
  border: 2px solid #fff; border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
}
.cp-hue {
  width: 206px; margin: 0; accent-color: var(--accent);
}
.cp-hex-row { display: flex; align-items: center; gap: 8px; }
.cp-hex {
  flex: 1; padding: 4px 6px; background: var(--surface-3);
  border: 1px solid var(--border); border-radius: 4px;
  color: var(--text); font-family: ui-monospace, monospace; font-size: 12px;
}
.cp-actions { display: flex; gap: 6px; }
.cp-btn {
  flex: 1; padding: 5px 9px; border-radius: 5px; font-size: 12px;
  background: var(--surface-3); border: 1px solid var(--border); color: var(--text);
}
.cp-btn:hover { background: var(--surface-2); }
.cp-btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }

/* A colour field button anywhere in the app. */
.cf-btn {
  width: 26px; height: 24px; padding: 3px; border-radius: 5px;
  background: transparent; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.cf-btn:hover { background: var(--surface-3); }
.cf-swatch {
  display: block; width: 100%; height: 100%; border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.prop-field { display: flex; align-items: center; gap: 4px; }
.prop-num {
  width: 62px; padding: 3px 5px; text-align: right;
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: 4px; color: var(--text); font-size: 12px;
}

/* ---------- order book viewer ---------- */
.book-page { padding: 16px 20px 28px; overflow: auto; }
.book-bar-top {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px;
}
.book-note { color: var(--text-dim); font-size: 12px; }
.book-summary {
  display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px;
}
.book-stat {
  display: flex; flex-direction: column; gap: 2px; min-width: 104px;
  padding: 8px 11px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.book-stat span { color: var(--text-dim); font-size: 11px; }
.book-stat strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.book-stat .up { color: var(--up); }
.book-stat .down { color: var(--down); }

.book-table {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2); overflow: hidden;
}
.book-sort { display: flex; align-items: center; gap: 2px; }
.book-caret { font-size: 9px; }
.book-head, .book-row {
  display: grid; grid-template-columns: 1.2fr 1fr 1fr 70px;
  align-items: center; gap: 10px; padding: 6px 12px;
  font-variant-numeric: tabular-nums; font-size: 13px;
}
.book-head {
  position: sticky; top: 0; z-index: 1;
  background: var(--surface-3); border-bottom: 1px solid var(--border);
  color: var(--text-dim); font-size: 12px;
}
.book-sort {
  background: transparent; border: none; color: inherit;
  text-align: left; padding: 2px 0; font-size: 12px;
}
.book-sort:hover { color: var(--text); }
.book-sort.on { color: var(--accent); }
.book-side-head { text-align: right; }
.book-row { position: relative; border-bottom: 1px solid rgba(255, 255, 255, 0.03); }
/* The depth bar sits behind the numbers rather than in a column of its own,
   so the table stays narrow enough to read on a laptop. */
.book-bar {
  position: absolute; left: 0; top: 0; bottom: 0; z-index: 0;
  opacity: 0.17; pointer-events: none;
}
.book-row.bid .book-bar { background: var(--up); }
.book-row.ask .book-bar { background: var(--down); }
.book-row > span:not(.book-bar) { position: relative; z-index: 1; }
.book-row.bid .book-price { color: var(--up); }
.book-row.ask .book-price { color: var(--down); }
.book-side { text-align: right; color: var(--text-dim); font-size: 11px; }
.book-empty { padding: 28px; text-align: center; color: var(--text-dim); }

/* ---------- portrait / touch (the Android shell runs this UI) ---------- */

/* The phone bar is a phone thing; on a wide screen it is simply absent. */
.phone-bar { display: none; }

@media (max-width: 760px) {
  /* Sechs Knöpfe, sechs Spalten: mit fünf Spalten rutschte „Handel" allein
     in eine zweite Zeile und nahm dem Chart 50 Pixel. */
  .phone-bar {
    display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
    flex: 0 0 auto; z-index: 20;
    background: var(--surface); border-top: 1px solid var(--border);
    /* Clears the gesture bar on Android and the home indicator on iOS. */
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .phone-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    /* 52 px is a comfortable thumb target; below ~44 px taps start missing. */
    min-height: 56px; min-width: 0; padding: 6px 1px 7px;
    background: transparent; border: none; color: var(--text-dim);
  }
  .phone-ico {
    display: grid; place-items: center; width: 40px; height: 27px;
    border-radius: 9px; transition: background .12s, color .12s;
  }
  .phone-label {
    font-size: 10px; letter-spacing: -.15px; max-width: 100%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .phone-btn:active .phone-ico { background: var(--surface-3); color: var(--text); }
  /* Der Zeitrahmen-Knopf zeigt den Zeitrahmen selbst. */
  .phone-tf {
    font-size: 11.5px; font-weight: 750; line-height: 1; color: var(--text);
    padding: 3px 5px; border-radius: 6px; border: 1.5px solid var(--text-dim);
  }
  /* Was offen ist, ist markiert: die Werkzeugleiste, die Handelsleiste. */
  .phone-btn.pb-trade { color: var(--text); }
  .chart-page:not(.tools-hidden) .phone-btn.pb-tools,
  .chart-page:has(.tp-rail.open) .phone-btn.pb-trade { color: #8fa9ff; }
  .chart-page:not(.tools-hidden) .phone-btn.pb-tools .phone-ico,
  .chart-page:has(.tp-rail.open) .phone-btn.pb-trade .phone-ico { background: var(--accent-soft); }

  .chart-page { height: 100%; }
  .chart-body { min-height: 0; }

  /* Bigger hit areas in the tool rail. */
  .tool-btn { width: 34px; height: 34px; flex-basis: 34px; }
  .tool-rail { width: 44px; }

  /* A pane legend is a stack of rows over the chart; on a phone it has to
     stay one short line each, or six indicators bury the candles. */
  .pane-legend { max-width: calc(100% - 70px); }
  .leg-row {
    gap: 4px; font-size: 10px; padding: 3px 5px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .leg-row .leg-inputs { display: none; }
  /* Hidden until the row is tapped — see the comment in legend.ts. */
  .leg-actions { display: none; }
  .leg-row.open .leg-actions { display: flex; opacity: 1; }
  .leg-row.open { white-space: normal; }
  .leg-btn { width: 30px; height: 30px; }

  /* The floating drawing bar is wider than a phone; it wraps and sits low
     enough to leave the candles alone. */
  .draw-props {
    left: 6px; right: 6px; transform: none; top: auto; bottom: 8px;
    height: auto; flex-wrap: wrap; justify-content: center;
  }
  .draw-props .prop-field { display: none; }
  .prop-btn.wide { padding: 0 5px; }

  .cp-pop { max-width: calc(100vw - 16px); }
  .cp-grid { grid-template-columns: repeat(11, 1fr); }
  .cp-field { width: 100%; }
  .cp-hue { width: 100%; }

  /* The book table drops the side column: the row tint and the price
     colour already say bid or ask, and four columns do not fit 375 px. */
  .book-head, .book-row { grid-template-columns: 1.05fr 1fr 1fr; gap: 7px; padding: 7px 9px; }
  .book-side, .book-side-head { display: none; }
  .book-page { padding: 10px 10px 20px; }
  .book-stat { min-width: 86px; padding: 6px 8px; }
}

/* Landscape on a phone: the top bar and the phone bar together eat half the
   height, so the phone bar goes and the top bar shrinks. */
@media (max-width: 920px) and (max-height: 520px) and (orientation: landscape) {
  .phone-bar { display: none; }
  .symbol-bar { padding: 3px 6px; min-height: 0; }
  .bar-btn, .tf-picker, .sym-group, .layout-trigger { height: 32px; }
}

/* ---------- drawing settings dialog (spec §3) ---------- */
.draw-modal { width: 440px; max-width: calc(100vw - 32px); }
.draw-modal .set-nav { flex-basis: 132px; }
.set-text {
  flex: 1; min-width: 0; padding: 5px 8px;
  font: inherit; font-size: 12.5px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-s);
}
.set-number.wide { min-width: 170px; }

/* Why an orderflow pane is empty — information, not an error. */
.leg-note {
  font-size: 10.5px; color: var(--warn, #d9a441);
  padding: 0 5px; border: 1px solid currentColor; border-radius: 3px;
  opacity: .85; white-space: nowrap;
}

/* ---------- trading settings ---------- */
.tf-notice {
  padding: 9px 12px; border-radius: var(--radius-s); font-size: 13px;
  border: 1px solid var(--border); background: var(--surface-2); margin-bottom: 14px;
}
.tf-notice.error { border-color: var(--down); color: var(--down); }
.tf-notice.ok { border-color: var(--up); color: var(--up); }

.tf-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 22px; }
.tf-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface);
}
.tf-row.on { border-color: var(--accent); }
.tf-row-main { flex: 1; min-width: 180px; }
.tf-row-name {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-weight: 600; font-size: 14px;
}
.tf-row-detail { font-size: 12.5px; color: var(--text-dim); margin-top: 3px; }
.tf-row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.tf-sep { margin: 0 6px; opacity: .5; }
.tf-error { color: var(--down); }

.tf-badges { display: flex; gap: 5px; }
.tf-tag {
  font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 3px; border: 1px solid var(--border);
  color: var(--text-dim);
}
.tf-tag.live { border-color: var(--up); color: var(--up); }
.tf-tag.paper { border-color: var(--border); }
.tf-tag.active { border-color: var(--accent); color: var(--accent); }
.tf-tag.error { border-color: var(--down); color: var(--down); }

.tf-empty {
  padding: 18px; text-align: center; color: var(--text-dim); font-size: 13px;
  border: 1px dashed var(--border); border-radius: var(--radius); margin-bottom: 22px;
}

.tf-card {
  padding: 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); margin-bottom: 18px;
}
.tf-card h3 { margin: 0 0 6px; font-size: 14px; }
.tf-lead { margin: 0 0 14px; font-size: 13px; color: var(--text-dim); max-width: 60ch; }
.tf-warn {
  padding: 10px 12px; margin-bottom: 14px; font-size: 12.5px;
  border-left: 3px solid var(--warn, #d9a441); background: var(--surface-2);
  color: var(--text-dim);
}
.tf-warn strong { color: var(--text); }
.tf-grid {
  display: grid; gap: 12px;
  /* min() so a narrow settings pane collapses to one column instead of
     pushing the inputs past the card's edge. */
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
}
.tf-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tf-label { font-size: 12px; color: var(--text-dim); font-weight: 600; }
.tf-hint { font-size: 11.5px; color: var(--text-faint); }
.tf-input {
  padding: 7px 10px; font: inherit; font-size: 13px; min-width: 0;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-s);
}
.tf-input:focus { outline: none; border-color: var(--accent); }
.tf-check {
  display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px;
}
.tf-actions { display: flex; gap: 8px; margin-top: 14px; }

/* ---------- portfolio ----------
   Steht in src/views/portfolio.css. */

/* ---------- trading rail beside the chart ---------- */
/* Closed, the rail takes no width at all and the handle sits in the
   toolbar — a 34 px strip of empty panel down the whole side was space
   the chart could use. Offen ist sie ein Panel wie Chart und Werkzeuge:
   gerundet, mit eigener Fuge. Alles, was sie zeigt, steht in Karten
   und Segmenten wie auf der Signal-Trading-Seite. */
.tp-rail {
  flex: 0 0 auto; width: 0; min-width: 0; position: relative;
  display: flex; align-items: stretch;
  background: var(--surface); border-radius: 12px; overflow: hidden;
  transition: width .16s ease, margin .16s ease;
}
.tp-rail.open { width: 344px; margin-left: 6px; border: 1px solid var(--border); }

.bar-trade { flex: 0 0 auto; display: flex; align-items: center; }
.tp-handle {
  padding: 0 14px; color: var(--text);
  background: var(--accent-soft); border-color: rgba(41, 98, 255, .45);
}
.tp-handle:hover { background: rgba(41, 98, 255, .24); border-color: rgba(41, 98, 255, .7); }
.tp-handle.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.tp-handle.on svg { stroke: #fff; }

.tp-body {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden; scrollbar-width: thin;
}
.tp-rail:not(.open) .tp-body { display: none; }
.tp-loading { flex: 1; min-height: 180px; display: grid; place-items: center; }

/* Kopf: Konto, Kontostand, Schließen */
.tp-head {
  padding: 12px; display: flex; flex-direction: column; gap: 8px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border-bottom: 1px solid var(--border-soft);
}
.tp-head-row { display: flex; align-items: center; gap: 8px; }
.tp-account {
  flex: 1; min-width: 0; height: 34px; padding: 0 10px;
  font: inherit; font-size: 12.5px; font-weight: 600;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 9px;
}
.tp-account:focus { outline: none; border-color: var(--accent); }
.tp-close {
  width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center;
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 9px;
}
.tp-close:hover { background: var(--surface-3); color: var(--text); }
.tp-balance {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums;
}
.tp-balance b { font-size: 19px; font-weight: 700; color: var(--text); letter-spacing: -0.3px; }
.tp-balance span {
  padding: 2px 9px; border-radius: 999px; white-space: nowrap;
  font-size: 11px; font-weight: 650; background: var(--surface-3);
}
.tp-balance .warn { color: var(--warn); background: rgba(246, 193, 119, .12); }

.tp-msg {
  margin: 10px 12px 0; padding: 8px 10px; font-size: 12px; line-height: 1.4;
  border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2);
}
.tp-msg.error { border-color: rgba(242, 54, 69, .45); color: #ff8a93; background: rgba(242, 54, 69, .08); }
.tp-msg.ok { border-color: rgba(8, 153, 129, .45); color: #5fd3b8; background: rgba(8, 153, 129, .08); }

/* Manuell / Signal und Positionen / Orders / Historie als Segmente */
.tp-modes, .tp-tabs {
  display: flex; gap: 3px; padding: 3px;
  background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 10px;
}
.tp-modes { margin: 10px 12px 0; }
.tp-tabs { margin: 12px 12px 0; }
.tp-tabs:empty { display: none; }
.tp-mode, .tp-tab {
  flex: 1; height: 30px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-size: 12.5px; font-weight: 650;
  background: transparent; color: var(--text-dim);
  border: 0; border-radius: 8px; cursor: pointer;
  transition: background .12s, color .12s;
}
.tp-tab { font-size: 12px; }
.tp-mode:hover, .tp-tab:hover { color: var(--text); }
.tp-mode.on, .tp-tab.on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
.tp-tab i {
  font-style: normal; font-size: 10.5px; font-weight: 700; line-height: 17px;
  min-width: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--accent-soft); color: #8fa9ff;
}

/* Das Orderformular */
.tp-ticket-slot, .tp-msg-slot { display: contents; }
.tp-ticket {
  padding: 12px; display: flex; flex-direction: column; gap: 10px;
  border-bottom: 1px solid var(--border-soft);
}
.tp-sym { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tp-sym-name { font-weight: 700; font-size: 15px; letter-spacing: -0.1px; }
.tp-sym-price { font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 600; color: var(--text-dim); }

.tp-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tp-side {
  height: 38px; font: inherit; font-size: 13.5px; font-weight: 700;
  background: var(--surface-2); color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.tp-side:hover { color: var(--text); }
.tp-side.buy.on { background: rgba(8, 153, 129, .18); color: #5fd3b8; border-color: var(--up); }
.tp-side.sell.on { background: rgba(242, 54, 69, .14); color: #ff8a93; border-color: var(--down); }

.tp-chips { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.tp-chip-gap { flex: 1 0 6px; }
/* Names what a row of chips is choosing between, where the chips alone
   would not say — "GTC / IOC / FOK" means nothing without "Gültigkeit". */
.tp-chip-label {
  font-size: 10.5px; color: var(--text-faint);
  align-self: center; margin-right: 2px; white-space: nowrap;
}
.tp-chip {
  height: 28px; padding: 0 10px; font: inherit; font-size: 11.5px; font-weight: 600;
  background: var(--surface-2); color: var(--text-dim);
  border: 1px solid var(--border-soft); border-radius: 8px; cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.tp-chip:hover { color: var(--text); border-color: var(--border); }
.tp-chip.on { background: var(--accent-soft); border-color: rgba(41, 98, 255, .55); color: #8fa9ff; }

.tp-sizemodes { display: flex; gap: 4px; }
.tp-sizemodes .tp-chip { flex: 1; text-align: center; padding: 0 4px; }

.tp-field { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.tp-field > span { flex: 0 0 78px; color: var(--text-dim); }
.tp-input {
  flex: 1; min-width: 0; height: 34px; padding: 0 10px;
  font: inherit; font-size: 13px; font-variant-numeric: tabular-nums;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 9px;
  transition: border-color .12s, box-shadow .12s;
}
.tp-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tp-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
/* Grid children do not shrink below their content unless told to, which
   pushed the second field's input out of the rail. */
.tp-row2 > * { min-width: 0; }
.tp-row2 .tp-field > span { flex: 0 0 auto; }

.tp-preview { display: flex; flex-direction: column; gap: 6px; }
.tp-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px;
  font-size: 11.5px; color: var(--text-dim);
  padding: 10px 12px; background: var(--surface-2);
  border: 1px solid var(--border-soft); border-radius: 10px;
}
.tp-grid > div { display: flex; justify-content: space-between; gap: 6px; min-width: 0; }
.tp-grid b { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 650; }
.tp-hint { font-size: 11.5px; color: var(--text-faint); line-height: 1.45; }
.tp-warn {
  font-size: 11.5px; line-height: 1.45; color: var(--warn);
  padding: 7px 9px; border-radius: 9px;
  background: rgba(246, 193, 119, .07); border: 1px solid rgba(246, 193, 119, .3);
}
.tp-warn.hard { color: #ffb3b9; background: rgba(242, 54, 69, .1); border-color: rgba(242, 54, 69, .4); }

.tp-submit {
  height: 42px; font: inherit; font-size: 14px; font-weight: 700; letter-spacing: .2px;
  border: 0; border-radius: 10px; cursor: pointer; color: #fff;
  transition: filter .12s, box-shadow .12s;
}
.tp-submit.buy { background: var(--up); box-shadow: 0 4px 14px rgba(8, 153, 129, .28); }
.tp-submit.sell { background: var(--down); box-shadow: 0 4px 14px rgba(242, 54, 69, .25); }
.tp-submit:hover:not(:disabled) { filter: brightness(1.08); }
.tp-submit:disabled { opacity: .45; cursor: default; box-shadow: none; }

/* Positionen, Orders, Historie */
.tp-list { flex: 1; min-height: 0; padding: 10px 12px 12px; }
.tp-rows { display: flex; flex-direction: column; gap: 8px; }
.tp-item {
  padding: 10px 11px; display: flex; flex-direction: column; gap: 6px;
  background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 12px;
}
.tp-item-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 12.5px; }
.tp-item-sym { font-weight: 700; }
.tp-item-side { font-size: 11px; font-weight: 650; color: var(--text-dim); }
.tp-item-pnl { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 700; }
.tp-item-detail { font-size: 11.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; line-height: 1.4; }
.tp-item .btn { align-self: flex-start; border-radius: 8px; }
.tp-item .up, .tp-item-pnl.up { color: var(--up); }
.tp-item .down, .tp-item-pnl.down { color: var(--down); }
.tp-item-tag {
  font-size: 10.5px; font-weight: 650; color: var(--text-dim);
  padding: 1px 6px; border-radius: 6px; background: var(--surface-3);
}
.tp-item-for { font-size: 11px; color: var(--text-faint); }
.tp-item-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.tp-guards {
  display: flex; flex-direction: column; gap: 3px;
  padding: 6px 8px; border-radius: 9px; background: var(--surface);
}
.tp-guards.none {
  font-size: 11px; color: var(--warn);
  background: rgba(246, 193, 119, .07); border: 1px dashed rgba(246, 193, 119, .35);
}
.tp-guard { display: flex; align-items: baseline; gap: 6px; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.tp-guard > span:first-child { font-weight: 650; min-width: 52px; }
.tp-guard .up { color: var(--up); }
.tp-guard .down { color: var(--down); }
.tp-guard-qty { color: var(--text-faint); margin-left: auto; }
.tp-guard-x {
  width: 20px; height: 20px; display: grid; place-items: center;
  background: transparent; border: 0; border-radius: 6px; color: var(--text-faint);
  font-size: 14px; line-height: 1; padding: 0; cursor: pointer;
}
.tp-guard-x:hover { color: var(--down); background: rgba(242, 54, 69, .12); }

.tp-protect { display: flex; flex-direction: column; gap: 6px; margin-top: 2px; }
.tp-protect-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tp-protect-row > * { min-width: 0; }
.tp-protect-actions { display: flex; gap: 6px; }

.tp-empty, .tp-blank {
  padding: 20px 12px; text-align: center; color: var(--text-faint); font-size: 12px;
}
.tp-empty { border: 1px dashed var(--border); border-radius: 12px; }
.tp-blank { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.tp-blank p { margin: 0; color: var(--text-dim); }

/* --- signal mode --- */
.tp-signalpane { display: flex; flex-direction: column; gap: 10px; }
.tp-strats { display: flex; flex-wrap: wrap; gap: 6px; }
.tp-strat {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 11px; font-size: 12px; font-weight: 600; cursor: pointer;
  background: var(--surface-2); color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 999px;
}
.tp-strat.on { border-color: rgba(41, 98, 255, .6); color: var(--text); background: var(--accent-soft); }
.tp-strat i {
  font-style: normal; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--up); background: rgba(8, 153, 129, .14); border-radius: 5px; padding: 1px 5px;
}

.tp-linetoggle {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-dim);
  padding: 8px 10px; border-radius: 10px; background: var(--surface-2);
}

.tp-signal {
  display: flex; flex-direction: column; gap: 4px; text-align: left; width: 100%;
  padding: 10px 11px; cursor: pointer;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border-soft); border-radius: 12px;
  transition: border-color .12s, background .12s;
}
.tp-signal.ready { border-color: rgba(8, 153, 129, .55); }
.tp-signal.intrade { border-color: rgba(41, 98, 255, .55); }
.tp-signal:hover { background: var(--surface-3); }
.tp-signal-head { display: flex; align-items: baseline; gap: 7px; }
.tp-signal-tf { font-size: 10.5px; color: var(--text-faint); }
.tp-signal-state {
  margin-left: auto; font-size: 10.5px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-dim);
}
.tp-signal-state.ready { border-color: rgba(8, 153, 129, .5); color: #5fd3b8; background: rgba(8, 153, 129, .12); }
.tp-signal-state.intrade { border-color: rgba(41, 98, 255, .45); color: #8fa9ff; background: var(--accent-soft); }
.tp-signal-orders { font-size: 10.5px; color: var(--text-faint); }

.tp-spot {
  font-size: 11px; line-height: 1.45; color: var(--warn);
  padding: 7px 9px; border-radius: 9px;
  background: rgba(246, 193, 119, .07); border: 1px solid rgba(246, 193, 119, .3);
}
.tp-venue { font-size: 11px; color: var(--text-faint); }

@media (max-width: 760px) {
  /* On a phone the rail would leave no chart; it opens over it instead —
     über die ganze Breite, wie ein Blatt, mit eigenem Schließen-Knopf. */
  .tp-rail.open {
    position: absolute; inset: 0; width: 100%; margin: 0; z-index: 20;
    border: none; border-radius: 0;
    box-shadow: -8px 0 24px rgba(0, 0, 0, .35);
  }
  .chart-body { position: relative; }
  .tp-head { padding: 10px 12px; }
}

/* ---------- signal trading ---------- */
.sg-page { display: flex; flex-direction: column; min-height: 0; overflow: auto; }
.sg-head {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 16px 20px 10px;
}
.sg-head h1 { margin: 0; font-size: 20px; }
.sg-picker { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.sg-strat {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 11px; font-size: 12.5px;
  background: var(--surface-2); color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 999px; cursor: pointer;
}
.sg-strat.on { border-color: var(--accent); color: var(--text); }
.sg-strat.add { border-style: dashed; }
.sg-live {
  font-style: normal; font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--up); border: 1px solid var(--up); border-radius: 3px; padding: 0 4px;
}

.sg-board { padding: 0 20px; }
.sg-blank {
  max-width: 48ch; margin: 32px auto; text-align: center; color: var(--text-dim);
}
.sg-blank h2 { font-size: 16px; color: var(--text); margin-bottom: 8px; }
.sg-blank p { font-size: 13.5px; }

.sg-summary {
  display: flex; gap: 1px; flex-wrap: wrap; background: var(--border);
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; margin-bottom: 14px;
}
.sg-sum {
  flex: 1; min-width: 110px; background: var(--surface); padding: 9px 12px;
  display: flex; flex-direction: column; gap: 2px;
}
.sg-sum > span {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-faint); font-weight: 600;
}
.sg-sum > b { font-size: 15px; font-variant-numeric: tabular-nums; }
.sg-sum > i {
  font-size: 10.5px; font-style: normal; color: var(--text-faint);
}
.sg-sum.dim { color: var(--text-faint); font-size: 12px; justify-content: center; }

.sg-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 10px; margin-bottom: 26px;
}
.sg-card {
  position: relative; padding: 11px 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface);
}
.sg-card.ready { border-color: var(--up); }
.sg-card.intrade { border-color: var(--accent); }
.sg-card.error { border-color: var(--down); }
.sg-card-head {
  display: flex; align-items: baseline; gap: 8px; margin-bottom: 7px;
}
.sg-card-sym { font-weight: 650; font-size: 14px; }
.sg-card-meta { font-size: 11px; color: var(--text-faint); }
.sg-state {
  margin-left: auto; font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
  padding: 2px 6px; border-radius: 3px;
  border: 1px solid var(--border); color: var(--text-dim);
}
.sg-state.ready { border-color: var(--up); color: var(--up); }
.sg-state.intrade { border-color: var(--accent); color: var(--accent); }
.sg-state.error { border-color: var(--down); color: var(--down); }

.sg-card-dir {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12.5px; margin-bottom: 7px;
}
.sg-card-dir .up { color: var(--up); font-weight: 600; }
.sg-card-dir .down { color: var(--down); font-weight: 600; }
.sg-card-dir .dim { color: var(--text-faint); }
.sg-card-price { font-variant-numeric: tabular-nums; color: var(--text-dim); }

.sg-levels {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; font-size: 11.5px;
}
.sg-levels > div { display: flex; justify-content: space-between; gap: 6px; min-width: 0; }
.sg-levels span { color: var(--text-dim); }
.sg-levels b { font-variant-numeric: tabular-nums; font-weight: 600; }
.sg-levels b.up { color: var(--up); }
.sg-levels b.down { color: var(--down); }

.sg-card-note, .sg-card-reason, .sg-card-error {
  margin-top: 7px; font-size: 11px; color: var(--text-dim); line-height: 1.35;
}
/* Der Chart-Knopf schwebt absolut unten rechts. Auf einer Karte, die nur
   aus einer Fehlerzeile besteht, lief der Text darunter hindurch und beide
   waren unlesbar. Der Text hält jetzt Abstand, und die Karte ist hoch
   genug, dass der Knopf eine eigene Zeile hat. */
.sg-card-error { color: var(--down); padding-right: 54px; }
.sg-card.error { min-height: 76px; }

/* Ein Symbol, das der Recorder nicht aufzeichnet: der Orderflow kommt dann
   bei jedem Abruf von Binance statt aus dem Archiv. Das war wochenlang
   unsichtbar und hat das Gewichtslimit gerissen. */
.sg-card-source {
  margin-top: 6px; padding: 3px 6px; border-radius: 3px;
  font-size: 10.5px; line-height: 1.3;
  color: var(--warn, #d9a441); background: rgba(217, 164, 65, .1);
  border-left: 2px solid var(--warn, #d9a441);
}
.sg-card-note { color: var(--warn, #d9a441); }
.sg-card-pos {
  margin-top: 7px; font-size: 11.5px; color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.sg-card-pos .up { color: var(--up); }
.sg-card-pos .down { color: var(--down); }
.sg-card-open {
  position: absolute; right: 8px; bottom: 8px;
  font-size: 10.5px; padding: 2px 7px; cursor: pointer;
  background: transparent; color: var(--text-faint);
  border: 1px solid var(--border); border-radius: 3px;
}
.sg-card-open:hover { color: var(--text); background: var(--surface-3); }

.sg-config {
  padding: 18px 20px 32px; border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.sg-config-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.sg-config-head h2 { margin: 0; font-size: 16px; }
.sg-dirty {
  font-size: 11px; color: var(--warn, #d9a441);
  border: 1px solid currentColor; border-radius: 3px; padding: 1px 6px;
}
.sg-sub { font-size: 13.5px; margin: 20px 0 6px; }
.sg-note {
  font-size: 12px; color: var(--text-dim); max-width: 70ch; margin: 0 0 10px;
  line-height: 1.45;
}

.sg-combis {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr));
  gap: 5px;
}
.sg-combi {
  display: flex; align-items: center; gap: 9px; min-width: 0;
  padding: 7px 10px; font-size: 12px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-s);
}
.sg-combi.on { border-color: var(--accent); }
.sg-combi-name { flex: 0 0 auto; }
.sg-combi-stats {
  margin-left: auto; font-size: 10.5px; color: var(--text-dim);
  font-variant-numeric: tabular-nums; text-align: right; min-width: 0;
}
.sg-combi-stats .up { color: var(--up); }
.sg-combi-stats .down { color: var(--down); }

.sg-rules { display: flex; flex-direction: column; gap: 5px; }
.sg-rule {
  text-align: left; padding: 9px 11px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-s);
}
.sg-rule.on { border-color: var(--accent); }
.sg-rule-head { display: flex; align-items: baseline; gap: 8px; }
.sg-rule-name { font-size: 13px; font-weight: 600; color: var(--text); }
.sg-tag {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--up); border: 1px solid var(--up); border-radius: 3px; padding: 0 5px;
}
.sg-rule-stats {
  display: flex; flex-wrap: wrap; gap: 3px 14px; margin-top: 4px;
  font-size: 11px; color: var(--text-dim); font-variant-numeric: tabular-nums;
}
.sg-rule-stats .down { color: var(--down); }

.sg-unit { display: flex; align-items: center; gap: 6px; }
.sg-unit .tf-input { flex: 1; min-width: 0; }
.sg-unit > span { font-size: 12px; color: var(--text-dim); }
.sg-warn {
  margin-top: 12px; padding: 9px 12px; font-size: 12.5px;
  border-left: 3px solid var(--down); background: var(--surface);
  color: var(--down);
}

@media (max-width: 760px) {
  .sg-head { padding: 12px 12px 8px; }
  .sg-board { padding: 0 12px; }
  .sg-config { padding: 14px 12px 24px; }
}

/* ---------- strategy performance panel ---------- */
.sg-perf {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding: 12px 14px; margin-bottom: 16px;
}
.sg-perf-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px;
}
.sg-perf-head h3 { margin: 0; font-size: 14px; }
.sg-perf-head .btn { margin-left: auto; }
.sg-tag.live { color: var(--up); border-color: var(--up); }
.sg-tag.off { color: var(--text-faint); border-color: var(--border); }

.sg-pstats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px 14px;
}
.sg-pstat { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sg-pstat.dim { color: var(--text-dim); font-size: 13px; }
.sg-pstat-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-faint); font-weight: 600;
}
.sg-pstat-value {
  font-size: 15px; font-variant-numeric: tabular-nums; letter-spacing: -.01em;
}
.sg-pstat-value.up { color: var(--up); }
.sg-pstat-value.down { color: var(--down); }
.sg-pstat-value.warn { color: var(--warn, #d9a441); }
.sg-pstat-hint { font-size: 10.5px; color: var(--text-dim); }

.sg-bysym {
  display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px;
  padding-top: 10px; border-top: 1px solid var(--border);
  font-size: 11.5px; color: var(--text-dim); font-variant-numeric: tabular-nums;
}
.sg-bysym-item i { font-style: normal; }
.sg-bysym-item .up { color: var(--up); }
.sg-bysym-item .down { color: var(--down); }

.sg-log { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.sg-log-rows { display: flex; flex-direction: column; gap: 2px; max-height: 240px; overflow-y: auto; }
.sg-log-row {
  display: grid; grid-template-columns: 44px 54px 92px 1fr; gap: 8px;
  font-size: 11px; color: var(--text-dim); font-variant-numeric: tabular-nums;
  padding: 2px 0;
}
.sg-log-row.bad .sg-log-action { color: var(--warn, #d9a441); }
.sg-log-time { color: var(--text-faint); }
.sg-log-sym { font-weight: 600; color: var(--text); }
.sg-log-detail { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 600px) {
  .sg-log-row { grid-template-columns: 40px 48px 1fr; }
  .sg-log-detail { grid-column: 1 / -1; white-space: normal; }
}

.sg-card.pending { opacity: .7; }
.sg-state.pending { border-color: var(--border); color: var(--text-faint); }
.sg-card-wait { font-size: 12px; color: var(--text-faint); padding: 6px 0; }

/* Validierungsfehler am Feld, nicht am Seitenkopf: eine Meldung über eine
   Zahl gehört neben die Zahl, nicht an eine Stelle, zu der man
   zurückscrollen muss. */
.field-error {
  display: block; flex-basis: 100%;
  margin-top: 4px; font-size: 11.5px; line-height: 1.4;
  color: var(--down);
}
.tf-field:has(> .field-error) .tf-input,
label:has(> .field-error) input {
  border-color: var(--down);
}
input[aria-invalid="true"] { border-color: var(--down); }

/* ---------- eigene Dialoge ---------- */

/* Ersetzt window.confirm und window.alert: die kamen vom Browser, standen
   als chromefarbener Kasten am Fensterrand, trugen den Hostnamen und
   sahen auf dem Telefon aus wie eine Sicherheitswarnung — nicht wie eine
   Frage zu einem Trade. */
.dlg-screen {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center; padding: 16px;
  background: rgba(0, 0, 0, .55);
  animation: dlg-in .12s ease-out;
}
.dlg {
  width: min(420px, 100%);
  /* `--surface-1` gibt es in dieser Palette nicht; die Farbe war damit
     ungültig und jeder Dialog durchsichtig — der Text dahinter las sich
     mit. Bei „Position zu Markt schließen?" ist das keine Kleinigkeit. */
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 18px 20px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.dlg-title { font-size: 15px; font-weight: 650; line-height: 1.35; }
.dlg-body { font-size: 13px; color: var(--text-dim); line-height: 1.5; }
.dlg-actions {
  display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px;
}
.dlg-actions .btn { min-width: 104px; justify-content: center; }
@keyframes dlg-in { from { opacity: 0; } to { opacity: 1; } }

/* Auf dem Telefon sitzen die Knöpfe untereinander und in Daumenreichweite. */
@media (max-width: 560px) {
  .dlg-screen { place-items: end center; padding: 0; }
  .dlg {
    width: 100%; border-radius: 14px 14px 0 0; border-bottom: none;
    padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  }
  .dlg-actions { flex-direction: column-reverse; }
  .dlg-actions .btn { width: 100%; padding: 11px; }
}

/* ---------- warum der Bot nicht handelt ---------- */

.sg-refusals {
  margin-top: 12px; padding: 9px 11px;
  border-radius: var(--radius-s);
  background: rgba(217, 164, 65, .08);
  border-left: 2px solid var(--warn, #d9a441);
  display: flex; flex-direction: column; gap: 5px;
}
.sg-refusals-head {
  font-size: 11px; font-weight: 650; color: var(--warn, #d9a441);
  text-transform: uppercase; letter-spacing: .04em;
}
.sg-refusal {
  display: flex; gap: 8px; align-items: baseline; font-size: 12px;
  color: var(--text-dim); line-height: 1.4;
}
.sg-refusal-n {
  flex: 0 0 auto; font-variant-numeric: tabular-nums; font-weight: 650;
  color: var(--text); min-width: 34px;
}
.sg-refusal-text { flex: 1 1 auto; }
.sg-refusal-sym { flex: 0 0 auto; font-size: 10.5px; color: var(--text-faint); }

/* ---------- Richtungswahl ---------- */

.sg-dirs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.sg-dir {
  flex: 1 1 180px; display: flex; flex-direction: column; gap: 2px;
  padding: 9px 11px; text-align: left; cursor: pointer;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.sg-dir:hover { border-color: var(--accent); }
.sg-dir.on { border-color: var(--accent); background: var(--surface-2); }
.sg-dir-name { font-size: 13px; font-weight: 600; }
.sg-dir-stats {
  font-size: 11px; color: var(--text-faint); font-variant-numeric: tabular-nums;
}
.sg-card-stale { margin-top: 6px; font-size: 10.5px; color: var(--text-faint); }

/* ---------- phone: menus from the scrolling bar ---------- */
/*
 * The symbol bar scrolls sideways, so a menu anchored to a control in it
 * opens wherever that control happens to sit — the timeframe list opened
 * at x=337 on a 375 px screen and was four fifths off the edge. On a phone
 * these become sheets pinned to the bottom of the viewport instead, which
 * is also where a thumb is.
 */
@media (max-width: 760px) {
  .tf-dropdown,
  .symbol-bar .menu-pop,
  .symbol-bar .tf-dropdown {
    position: fixed;
    left: max(8px, env(safe-area-inset-left, 0px));
    right: max(8px, env(safe-area-inset-right, 0px));
    top: auto;
    bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    width: auto; min-width: 0; max-width: none;
    /* Unter der Haelfte des Bildschirms: darueber steht der Chart, und
       ohne ihn weiss man nicht mehr, wofuer man den Zeitrahmen waehlt. */
    max-height: 46vh; overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 16px;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, .45);
    z-index: 40;
  }

  /* Fingerfreundliche Zeilen: 29 px hohe Treffer trifft niemand. */
  .tf-dropdown .tf-row-main { padding: 12px 16px; font-size: 15px; }
  .tf-dropdown .star { width: 32px; height: 32px; }
  .tf-add { padding: 12px 16px; font-size: 15px; }

  /* The layout menu hangs off the right end of the same bar. */
  .layout-menu .menu-pop {
    position: fixed;
    left: max(8px, env(safe-area-inset-left, 0px));
    right: max(8px, env(safe-area-inset-right, 0px));
    top: auto; bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    width: auto; max-height: 46vh; overflow-y: auto; z-index: 40;
  }

  /* Nothing may sit under the phone bar. */
  .phone-bar {
    padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
  }
}

/* ---------- trading rail: modes, sizing, guards ----------
   Zusammengeführt in den Block „trading rail beside the chart". */

/* The per-account exposure ceiling, inline in the account row. */
.tf-limit {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-dim); flex: 0 0 auto;
}
.tf-limit b { color: var(--text); font-weight: 600; }
.tf-limit.wide { flex: 1 1 100%; }
.tf-lev { width: 70px; text-align: right; }

/* ---------- prop firm mode ---------- */

.tf-row-limits { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }

/* Set apart from the risk settings above it: these are not a matter of
   degree but the terms the account is held to. */
.tf-prop {
  padding: 8px 10px; border-radius: var(--radius-s);
  border: 1px solid var(--border); background: var(--surface-2);
  display: flex; flex-direction: column; gap: 8px; min-width: 260px;
}
.tf-prop.on { border-color: var(--accent); }
.tf-prop-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--text); cursor: pointer;
}
.tf-prop-hint {
  flex: 1 1 100%; font-weight: 400; font-size: 10.5px; color: var(--text-faint);
}
.tf-prop-fields {
  display: flex; flex-wrap: wrap; gap: 8px 14px;
  padding-top: 8px; border-top: 1px solid var(--border);
}
.tf-prop-fields .tf-limit { justify-content: space-between; flex: 1 1 auto; }
.tf-prop-warn {
  flex: 1 1 100%; font-size: 10.5px; line-height: 1.45;
  color: var(--text-dim); border-left: 2px solid var(--accent); padding-left: 8px;
}
/* Das Kästchen selbst. Hiess einmal .tf-check und hat damit die ältere
   Regel gleichen Namens überschrieben, die die Label-Zeile der
   Strategie-Einstellungen beschreibt — jede dieser Zeilen wurde dadurch
   auf 14 Pixel gestaucht und der Text lag übereinander. */
.tf-box { width: 14px; height: 14px; accent-color: var(--accent); flex: 0 0 auto; }

@media (max-width: 760px) {
  .tf-row-limits { align-items: stretch; width: 100%; }
  .tf-prop { min-width: 0; }
}
.tf-note {
  font-size: 12px; color: var(--text-dim); line-height: 1.5;
  max-width: 70ch; margin: -8px 0 22px;
}

/* ---------- Benachrichtigungen ---------- */
.push-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 20px;
}
.push-state {
  font-size: 12px; font-weight: 650; padding: 4px 10px;
  border-radius: 999px; border: 1px solid var(--border);
}
.push-state.on { color: var(--up); border-color: var(--up); }
.push-state.off { color: var(--text-faint); }
.push-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.push-group {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); overflow: hidden;
}
.push-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 16px; cursor: pointer;
  border-bottom: 1px solid var(--border-soft);
}
.push-group .push-row:last-child { border-bottom: none; }
.push-row:hover { background: var(--surface-2); }
/* Das Kästchen soll auf der ersten Textzeile sitzen, nicht in der Mitte
   eines dreizeiligen Hinweises. */
.push-row .tf-box { margin-top: 3px; }
.push-row-title { font-size: 13.5px; font-weight: 600; }
.push-row-hint {
  font-size: 12px; color: var(--text-faint); margin-top: 3px; line-height: 1.5;
}
.push-note {
  margin-top: 22px; padding: 13px 16px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2);
}

/* ---------- Börsenauswahl beim Verbinden ---------- */
.tf-venues {
  display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0 14px;
}
.tf-venue {
  padding: 7px 14px; font: inherit; font-size: 13px; font-weight: 600;
  background: var(--surface-2); color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 999px; cursor: pointer;
}
.tf-venue:hover { color: var(--text); border-color: var(--text-faint); }
.tf-venue.on {
  color: var(--accent); border-color: var(--accent); background: var(--accent-soft);
}

/* ---------- Order-Spur: jede Order, lückenlos ---------- */
.sg-logtabs { display: flex; gap: 4px; margin-left: 8px; }
.sg-logtab {
  padding: 4px 10px; font: inherit; font-size: 11.5px; font-weight: 600;
  background: transparent; color: var(--text-faint);
  border: 1px solid var(--border); border-radius: var(--radius-s); cursor: pointer;
}
.sg-logtab:hover { color: var(--text); }
.sg-logtab.on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

.sg-audit { display: flex; flex-direction: column; gap: 1px; }
.sg-audit-row {
  display: grid;
  grid-template-columns: 64px 54px 50px 96px 1fr 58px minmax(0, 1.2fr);
  gap: 8px; align-items: baseline;
  padding: 4px 8px; font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  border-left: 2px solid transparent;
}
.sg-audit-row:nth-child(odd) { background: var(--surface-2); }
.sg-audit-row.bad { border-left-color: var(--down); }
.sg-audit-leg { color: var(--text-faint); }
.sg-audit-what { color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Börse / davon erkannt. Gehen die auseinander, legt der Bot neu, was
   längst liegt — deshalb sticht genau diese Zelle hervor. */
.sg-audit-seen {
  text-align: right; color: var(--text-faint);
  font-weight: 600; cursor: help;
}
.sg-audit-seen.warn {
  color: var(--warn, #e3a008);
  background: color-mix(in srgb, var(--warn, #e3a008) 12%, transparent);
  border-radius: var(--radius-s); padding: 0 5px;
}
.sg-audit-detail {
  color: var(--text-faint); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 760px) {
  .sg-audit-row { grid-template-columns: 54px 48px 1fr 52px; }
  .sg-audit-leg, .sg-audit-what { display: none; }
}

/* --------------------------------------------------- Konto-Sicherheit */

.dlg-wide { max-width: 460px; }

/* Zwei bis drei Verweise nebeneinander. `.foot` allein ist zentrierter
   Fliesstext und klebt sie aneinander — „Kein Zugriff?Abbrechen". */
.mfa-foot {
  display: flex; flex-wrap: wrap; gap: 6px 16px;
  align-items: center; text-align: left;
}
.mfa-foot .link { white-space: nowrap; }

.mfa-choices { display: grid; gap: 8px; margin: 14px 0; }
.mfa-choice {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 13px; text-align: left;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
}
.mfa-choice:hover { border-color: var(--accent); }
.mfa-icon { font-size: 19px; line-height: 1; }
.mfa-choice-title { font-weight: 600; font-size: 13.5px; }
.mfa-choice-hint { font-size: 11.5px; color: var(--text-dim); margin-top: 2px; }

/* Der Code wird abgetippt oder eingefügt: große Ziffern, weite Sperrung,
   damit sich niemand verzählt. */
.mfa-code {
  width: 100%; text-align: center;
  font-family: ui-monospace, monospace; font-size: 22px;
  letter-spacing: 6px; padding: 10px 0;
}

.sec-grid { display: grid; gap: 16px; }
.sec-card {
  border: 1px solid var(--border); border-radius: 12px; padding: 14px 15px;
  background: var(--surface-2);
}
.sec-card h3 { margin: 0 0 4px; font-size: 13.5px; }
.sec-card .hint { font-size: 11.5px; color: var(--text-dim); margin-bottom: 10px; }

.sec-state { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.sec-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.sec-dot.on { background: #22c55e; }
.sec-dot.off { background: #ef4444; }
.sec-dot.warn { background: #f59e0b; }

.sec-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--border);
}
.sec-row:last-child { border-bottom: none; }
.sec-row .grow { flex: 1; min-width: 0; }
.sec-row .title { font-size: 13px; font-weight: 600; }
.sec-row .sub { font-size: 11.5px; color: var(--text-dim); }
.sec-row .sub.now { color: #22c55e; }

.sec-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 11px; }

/* Wiederherstellungscodes: einmal sichtbar, zum Abschreiben oder Drucken. */
.rec-codes {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 14px;
  font-family: ui-monospace, monospace; font-size: 14px;
  margin: 12px 0; padding: 12px; border-radius: 8px;
  background: var(--bg); border: 1px dashed var(--border);
  user-select: all;
}
@media (max-width: 420px) { .rec-codes { grid-template-columns: 1fr; } }

/* Der QR-Code steht auf Weiß, egal wie dunkel die Seite ist — eine
   Kamera liest einen invertierten QR-Code nicht zuverlässig. */
.qr-box {
  background: #fff; padding: 10px; border-radius: 10px;
  width: max-content; margin: 0 auto 12px;
}
.qr-box svg { display: block; width: 220px; height: 220px; }

.totp-secret {
  font-family: ui-monospace, monospace; font-size: 15px; letter-spacing: 1px;
  text-align: center; padding: 9px; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--border);
  user-select: all; margin-bottom: 10px;
}

/* Faktor-Auswahl: erledigte und nötige Schritte unterscheiden sich. */
.mfa-choice .grow { flex: 1; min-width: 0; }
.mfa-choice.done { opacity: .55; cursor: default; }
.mfa-choice.done:hover { border-color: var(--border); }
.mfa-choice.must { border-color: var(--warn); }

/* ---------- Chart-Leiste in mittleren Breiten ----------
   Die Leiste darf weder umbrechen noch seitlich rollen: ihre Menüs hängen
   in ihr und würden abgeschnitten. Wird das Fenster schmaler, fallen
   erst die Beschriftungen weg (Symbol und Titel bleiben), dann die
   Favoriten-Zeitrahmen außer dem gewählten — der Pfeil daneben öffnet die
   ganze Liste. Unter 761 px gilt die Telefonleiste. */
@media (min-width: 761px) and (max-width: 1120px) {
  .symbol-bar .bar-btn-label, .symbol-bar .layout-name { display: none; }
  .symbol-bar .ind-btn, .symbol-bar .tp-handle { width: 36px; padding: 0; }
  .symbol-bar .layout-trigger { padding: 0 10px; }
}
@media (min-width: 761px) and (max-width: 900px) {
  .symbol-bar .tf-group .tf:not(.on) { display: none; }
  .symbol-input { width: 112px; }
}

/* US-Märkte (25.11.2026): Name und Art in der Symbolsuche, und kein
   Handel aus dem Chart — Aktien, Indizes und CME-Futures handelt keine
   der hinterlegten Börsen, ein Auftrag ginge an das falsche Instrument. */
/* Über der schwebenden Favoritenleiste (z-index 60), die sonst die
   zweite Zeile der Vorschläge verdeckt. */
.suggest { width: 300px; z-index: 70; }
.suggest .sug-name {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text-dim); font-size: 12px;
}
.suggest .q { flex: 0 0 auto; }
.chart-page:has(.chart-host[data-quelle="fred"]) .tp-handle,
.chart-page:has(.chart-host[data-quelle="fred"]) .tp-rail,
.chart-page:has(.chart-host[data-quelle="fred"]) .phone-btn.pb-trade { display: none !important; }

/* ---------- Eine Leiste auf der Chart-Seite (30.11.2026) ----------
   Menü und Profil der App sitzen in der Symbolleiste, die Kopfzeile fehlt
   dort. Ihre Menüs hängen am jeweiligen Knopf. */
.kopf-anker { position: relative; display: flex; align-items: center; flex: 0 0 auto; }
.kopf-anker .popover { top: calc(100% + 10px); }
.kopf-anker.links .popover { left: -4px; right: auto; }
.kopf-anker.rechts .popover { right: -4px; left: auto; }
.symbol-bar.eine-leiste { flex-wrap: nowrap; min-width: 0; }
.symbol-bar.eine-leiste .an-chart-kopf { min-width: 0; overflow: hidden; }
.symbol-bar.eine-leiste .avatar { width: 30px; height: 30px; }

/* src/chart/pine/pine.css */
/*
 * Der Pine-Editor.
 *
 * Eigene Datei, an `src/styles.css` angehängt von `build.mjs`. Grund: an der
 * Hauptdatei arbeitet gerade jemand anders, und zwei Hände in einer Datei
 * ohne Versionskontrolle gehen schief.
 *
 * Die Maße sind hier nicht Geschmack, sondern Bedingung: Textfeld und
 * Hervorhebung liegen übereinander, und sie müssen **zeichengenau** gleich
 * laufen. Dieselbe Schrift, derselbe Zeilenabstand, dieselbe Innenabstände,
 * dasselbe `white-space` und dasselbe `tab-size`. Weicht eines davon ab,
 * wandert die Färbung gegen den Text — am Anfang unsichtbar, nach 80 Zeilen
 * um eine ganze Zeile verschoben.
 */

.pine-modal {
  width: 860px;
  max-height: 88vh;
}

.pine-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 8px;
}

.pine-bar .pine-name {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
}

/* ---------- Editorfläche ---------- */

.pine-editor {
  --pine-line: 19px;
  --pine-font: 12.5px/19px var(--mono);

  display: flex;
  align-items: stretch;
  margin: 0 16px;
  height: 46vh;
  min-height: 220px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
}

.pine-gutter {
  flex: 0 0 auto;
  width: 46px;
  padding: 10px 8px 10px 0;
  overflow: hidden;
  font: var(--pine-font);
  color: var(--text-faint);
  text-align: right;
  user-select: none;
  background: var(--surface);
  border-right: 1px solid var(--border-soft);
}

.pine-ln {
  height: var(--pine-line);
  line-height: var(--pine-line);
}

.pine-code {
  position: relative;
  flex: 1;
  min-width: 0;
}

/*
 * Beide Schichten tragen genau dieselben Maße. Jede Änderung hier muss an
 * beiden Stellen passieren, sonst laufen sie auseinander.
 */
.pine-hl,
.pine-input {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 10px 12px;
  font: var(--pine-font);
  letter-spacing: 0;
  tab-size: 4;
  white-space: pre;
  word-break: normal;
  overflow-wrap: normal;
  border: none;
  overflow: auto;
}

.pine-hl {
  color: var(--text);
  pointer-events: none;
  background: transparent;
}

.pine-input {
  resize: none;
  outline: none;
  background: transparent;
  /* Der Text selbst ist unsichtbar: gelesen wird die Schicht darunter.
     Nur Cursor und Auswahl kommen von hier. */
  color: transparent;
  caret-color: var(--text);
}

.pine-input::selection {
  background: rgba(41, 98, 255, 0.35);
  color: transparent;
}

/* ---------- Farben ---------- */

.pt-comment { color: #5c6370; font-style: italic; }
.pt-string  { color: #98c379; }
.pt-number  { color: #d19a66; }
.pt-keyword { color: #c678dd; }
.pt-type    { color: #56b6c2; }
.pt-builtin { color: #61afef; }
.pt-member  { color: var(--text); }
.pt-op      { color: #8a8f9b; }

.pt-color {
  color: #e5c07b;
  border-bottom: 1px dotted currentcolor;
}

/* ---------- Zustand und Fehler ---------- */

.pine-status {
  padding: 8px 16px 2px;
  font-size: 12px;
  color: var(--text-faint);
}

.pine-status.good { color: var(--up); }
.pine-status.bad { color: var(--down); }

.pine-errors {
  max-height: 150px;
  margin: 2px 16px 0;
  overflow: auto;
}

.pine-err,
.pine-warn {
  display: flex;
  gap: 10px;
  width: 100%;
  padding: 6px 8px;
  font-size: 12.5px;
  text-align: left;
  background: transparent;
  border: none;
  border-left: 2px solid var(--down);
  border-radius: 0;
  color: var(--text-dim);
}

.pine-err { cursor: pointer; }
.pine-err:hover { background: var(--surface-2); color: var(--text); }
.pine-warn { border-left-color: var(--warn); }

.pine-err-at {
  flex: 0 0 auto;
  font: 11.5px/1.5 var(--mono);
  color: var(--text-faint);
}

.pine-err-msg { flex: 1; }

/* ---------- Die Zeilen im Auswahlfenster ---------- */

.ind-row.pine-saved .ind-meta { color: var(--accent); }

.pine-new {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 11px 12px;
  font-size: 13px;
  text-align: left;
  color: var(--text);
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-s);
}

.pine-new:hover { background: var(--surface-3); border-color: var(--accent); }
.pine-new .pine-plus { font-size: 15px; color: var(--accent); }

.ind-row .pine-edit {
  flex: 0 0 auto;
  padding: 4px 9px;
  font-size: 11.5px;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
}

.ind-row .pine-edit:hover { color: var(--text); background: var(--surface-3); }

/* ---------- Telefon ---------- */

@media (max-width: 760px) {
  .pine-modal { width: calc(100vw - 16px); max-height: 94vh; }
  .pine-editor { height: 40vh; margin: 0 10px; }
  .pine-gutter { width: 34px; }
  .pine-bar { flex-wrap: wrap; padding: 10px 10px 6px; }
  .pine-errors { margin: 2px 10px 0; max-height: 110px; }
  .pine-status { padding: 8px 10px 2px; }
}

/* ---------- Strategie-Test ----------
   Eigene Klassen (`stt-`). Die Signal-Trading-Seite verwendet seit dem
   20.11. ebenfalls `st-head`, `st-kpi`, `st-chip`, `st-tab(s)` und
   `st-note`; ihre Regeln stehen in der Kette hinter dieser Datei und
   formten das Panel hier um — jede Kennzahl wurde zur Karte. */
.stt-panel {
  flex: 0 0 auto; max-height: 46%;
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  font-size: 12.5px;
}
.stt-head {
  display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap;
  padding: 8px 12px;
}
.stt-toggle {
  width: 28px; height: 28px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-dim);
  border: 1px solid var(--border-soft); border-radius: 8px;
  font-size: 12px; cursor: pointer;
}
.stt-toggle:hover { color: var(--text); background: var(--surface-3); }
.stt-title { font-weight: 700; font-size: 13px; }
.stt-select {
  height: 30px; padding: 0 8px; font-size: 12.5px; font-weight: 600;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
}
/* Wie belastbar das Ergebnis ist: als Punkt mit Abzeichen, wie die
   Zustände auf der Signal-Seite. */
.stt-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; white-space: nowrap; cursor: help;
  font-size: 11.5px; font-weight: 650;
  color: var(--text-dim); border: 1px solid var(--border);
}
.stt-chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.stt-chip.good { color: #5fd3b8; border-color: rgba(8, 153, 129, .5); background: rgba(8, 153, 129, .12); }
.stt-chip.warn, .stt-chip.wait { color: var(--warn); border-color: rgba(246, 193, 119, .4); background: rgba(246, 193, 119, .08); }
.stt-chip.bad { color: #ff8a93; border-color: rgba(242, 54, 69, .45); background: rgba(242, 54, 69, .08); }
.stt-kpi { display: inline-flex; flex-direction: column; gap: 1px; line-height: 1.25; }
.stt-kpi-l { color: var(--text-faint); font-size: 10.5px; }
.stt-kpi-v { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stt-up { color: var(--up); }
.stt-down { color: var(--down); }
.stt-tabs {
  display: flex; gap: 3px; width: max-content; margin: 0 12px; padding: 3px;
  background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 10px;
}
.stt-tab {
  height: 28px; padding: 0 12px; font-size: 12px; font-weight: 650;
  background: none; color: var(--text-dim); border: 0; border-radius: 8px; cursor: pointer;
}
.stt-tab:hover { color: var(--text); }
.stt-tab.on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
.stt-body {
  display: grid; grid-template-columns: minmax(220px, 1.2fr) minmax(240px, 1fr);
  gap: 10px 20px; padding: 10px 12px 12px; overflow: auto; min-height: 0;
}
.stt-body.stt-scroll { display: block; padding: 8px 0 0; }
.stt-chart { min-height: 120px; padding: 8px; background: var(--surface-2); border-radius: 10px; }
.stt-curve { width: 100%; height: 130px; display: block; }
.stt-line { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.stt-line.up { stroke: var(--up); }
.stt-line.down { stroke: var(--down); }
.stt-zero { stroke: var(--border); stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.stt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; align-content: start; }
.stt-row {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 5px 0; border-bottom: 1px solid var(--border-soft);
}
.stt-row span:first-child { color: var(--text-faint); }
.stt-row span:last-child { font-weight: 600; font-variant-numeric: tabular-nums; }
.stt-note {
  grid-column: 1 / -1; padding: 8px 10px; border-radius: 9px; line-height: 1.45;
  color: var(--text-dim); background: var(--surface-2); border: 1px solid var(--border-soft);
}
.stt-note.good { color: #9ad9c6; border-color: rgba(8, 153, 129, .3); }
.stt-note.warn, .stt-note.wait { color: var(--warn); background: rgba(246, 193, 119, .07); border-color: rgba(246, 193, 119, .28); }
.stt-note.bad { color: #ff8a93; background: rgba(242, 54, 69, .08); border-color: rgba(242, 54, 69, .3); }
.stt-table { width: 100%; border-collapse: collapse; }
.stt-table th {
  position: sticky; top: 0; background: var(--surface); text-align: left;
  color: var(--text-faint); font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: .4px;
  padding: 6px 10px; border-bottom: 1px solid var(--border);
}
.stt-table td { padding: 5px 10px; border-bottom: 1px solid var(--border-soft); white-space: nowrap; }
.stt-table tbody tr:hover td { background: rgba(255, 255, 255, .02); }
.stt-num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  .stt-panel { max-height: 55%; border-width: 1px 0 0; border-radius: 0; }
  .stt-head { gap: 6px 14px; padding: 6px 10px; }
  .stt-body { grid-template-columns: 1fr; }
}

/* src/chart/drawings/fib.css */
/*
 * Die Levelliste der Fibonacci-Werkzeuge.
 *
 * Eigene Datei, von `build.mjs` an `src/styles.css` gehängt — dieselbe
 * Aufteilung wie beim Pine-Editor, und aus demselben Grund: an der
 * Hauptdatei arbeitet jemand anders, und ohne Versionskontrolle wäre eine
 * gemeinsame Datei eine stille Überschreibung.
 *
 * Eine Zeile je Level, in einer Reihe: Schalter, Wert, Farbe, Linienart,
 * Entfernen. Die Spalten müssen über alle Zeilen auf derselben Breite
 * stehen, sonst liest sich die Liste nicht als Tabelle — deshalb feste
 * Breiten statt `flex: 1` für Wert und Auswahl.
 */

.fib-levels {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 0 2px;
}

.fib-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.fib-row .set-check {
  flex: 0 0 auto;
  margin: 0;
}

.fib-row .fib-value {
  flex: 0 0 72px;
  width: 72px;
  min-width: 0;
}

.fib-row .set-color {
  flex: 0 0 auto;
}

.fib-row .set-select {
  flex: 1;
  min-width: 0;
}

.fib-del {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  padding: 0;
  font-size: 15px;
  line-height: 1;
  color: var(--text-faint);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-s);
}

.fib-del:hover {
  color: var(--down);
  border-color: var(--border);
  background: var(--surface-3);
}

.fib-add {
  align-self: flex-start;
  margin-top: 4px;
}

@media (max-width: 760px) {
  /* Auf dem Telefon ist für Linienart keine Spalte übrig; sie wandert in
     eine zweite Zeile, statt die Farbwahl zu zerdrücken. */
  .fib-row { flex-wrap: wrap; }
  .fib-row .set-select { flex: 1 0 100%; }
}

/* src/chart/zeichnen.css */
/* Zeichenwerkzeuge: Symbole, Texteditor im Chart, Emoji- und
   Tabellenfelder, Legende der Indikatoren. */

/* Das Symbol eines Werkzeugs ist das Werkzeug selbst, im Kleinen. */
.wz-bild { display: block; pointer-events: none; }
.wz-zeichen { display: inline-grid; place-items: center; line-height: 1; font-weight: 650; color: inherit; white-space: nowrap; letter-spacing: -.3px; }
.tool-bild { display: grid; place-items: center; width: 20px; height: 20px; }
.flyout-icon { display: grid; place-items: center; flex: 0 0 22px; width: 22px; height: 20px; color: var(--text-dim); }
.flyout-row:hover .flyout-icon { color: var(--text); }

.prop-t { font-weight: 700; font-family: Georgia, serif; font-size: 13.5px; }
.draw-props { max-width: calc(100% - 24px); }
.draw-props .vorlage-farbe { flex: 0 0 auto; }
.vorlage-farbe { width: 12px; height: 12px; border-radius: 4px; border: 1px solid rgba(255, 255, 255, .18); }
.menu-pop.prop-pop { max-height: min(60vh, 420px); overflow-y: auto; }

/* Text einer Zeichnung, direkt im Chart getippt. */
.zeichen-text {
  position: absolute; z-index: 24; box-sizing: border-box;
  min-height: 34px; padding: 5px 8px; resize: none; overflow: auto;
  font-family: inherit; line-height: 1.3; text-align: left;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--accent); border-radius: 8px; outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow);
}

.set-textarea { min-height: 76px; resize: vertical; line-height: 1.4; font-family: inherit; }
.set-umschalter {
  width: 30px; height: 28px; border-radius: 7px; font-weight: 700; font-size: 13px;
  background: transparent; border: 1px solid var(--border); color: var(--text-dim);
}
.set-umschalter.kursiv { font-style: italic; font-family: Georgia, serif; }
.set-umschalter:hover { background: var(--surface-3); color: var(--text); }
.set-umschalter.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.emoji-wahl { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 4px; padding: 4px 0 8px; }
.emoji-knopf { height: 34px; border-radius: 8px; background: transparent; border: 1px solid transparent; font-size: 18px; line-height: 1; }
.emoji-knopf:hover { background: var(--surface-3); }
.emoji-knopf.on { border-color: var(--accent); background: var(--accent-soft); }
.emoji-frei { grid-column: span 3; }

.tab-zellen { display: grid; gap: 4px; padding: 4px 0; overflow-x: auto; }
.tab-zellen .set-text { width: 100%; min-width: 70px; box-sizing: border-box; }

/* Legende der Indikatoren: eine Zeile je Indikator, nie über den Rand und
   nie über die Symbolzeile. */
.pane-legend { max-width: calc(100% - 96px); overflow-x: hidden; overflow-y: auto; scrollbar-width: none; }
.pane-legend::-webkit-scrollbar { display: none; }
.leg-row { white-space: nowrap; flex: 0 0 auto; max-width: 100%; width: max-content; box-sizing: border-box; min-height: 22px; }
.leg-title { overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; min-width: 24px; }
.leg-value, .leg-inputs { flex: 0 0 auto; }
.leg-row:not(:hover) .leg-actions { width: 0; margin: 0; overflow: hidden; }
.chart-legend { white-space: nowrap; max-width: calc(100% - 96px); box-sizing: border-box; overflow: hidden; }
.chart-legend > * { flex: 0 0 auto; }
.chart-legend .sym { overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; min-width: 60px; }

@media (max-width: 760px) {
  .leg-row.open { white-space: nowrap; }
  .leg-row.open .leg-actions { width: auto; overflow: visible; }
}

/* Papierhandel auf Märkten, die keine verbindbare Börse führt. */
.tp-papier {
  display: flex; flex-direction: column; align-items: flex-start; gap: 9px;
  padding: 10px 12px; margin: 4px 0; border-radius: 9px; font-size: 12px; line-height: 1.45;
  background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--text-dim);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.tp-papier.knapp { padding: 5px 10px; font-size: 11px; }
.qo-papier { font-size: 11px; color: var(--text-faint); padding: 2px 0 6px; }

.modal.draw-modal { width: 500px; }
.draw-modal .set-number { width: 70px; }

/* src/views/signal-trading.css */
/* ---------- Signal Trading: Kacheln, Anlegen, Dashboard ----------
   Eigene Datei, weil an styles.css parallel gearbeitet wird und das Projekt
   keine Versionskontrolle hat. Baut auf den Tokens aus styles.css auf. */

.st-page {
  --st-gap: 16px;
  --st-card: var(--surface);
  --st-line: var(--border-soft);
  /* Unten wenig Polster: der feste Fuß hält Abstand zum Polster, nicht
     zum Rand — 120 px hier ließen ihn mitten im Bild stehen. */
  padding: 18px 22px 16px;
  max-width: 1440px; margin: 0 auto; width: 100%;
  font-variant-numeric: tabular-nums;
}
.st-page .up { color: var(--up); }
.st-page .down { color: var(--down); }
.st-page .dim { color: var(--text-faint); }
.st-page b { font-weight: 650; }

/* ---------- Kopf ---------- */
.st-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 18px; padding: 0;
}
.st-head h1 { margin: 2px 0 4px; font-size: 24px; letter-spacing: -0.3px; }
.st-sub { margin: 0; color: var(--text-dim); font-size: 13.5px; max-width: 720px; line-height: 1.5; }
.st-back {
  background: none; border: none; padding: 0; color: var(--text-faint);
  font-size: 12.5px; margin-bottom: 6px;
}
.st-back:hover { color: var(--text); }
.st-head-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.st-head-actions { display: flex; gap: 8px; align-items: center; }
.st-head-kpis { display: flex; gap: 10px; flex-wrap: wrap; }
.st-head-kpis > div {
  display: flex; flex-direction: column; gap: 2px; min-width: 140px;
  padding: 10px 14px; background: var(--st-card);
  border: 1px solid var(--border); border-radius: 12px;
}
.st-head-kpis span { font-size: 11.5px; color: var(--text-faint); }
.st-head-kpis b { font-size: 17px; }

/* ---------- Status-Punkte und Abzeichen ---------- */
.st-dot {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; color: var(--text-dim); white-space: nowrap;
}
.st-dot::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint);
}
.st-dot.live { color: var(--up); }
.st-dot.live::before { background: var(--up); box-shadow: 0 0 0 3px rgba(8,153,129,.2); animation: st-puls 2s ease-in-out infinite; }
.st-dot.good::before { background: var(--accent); }
.st-dot.good { color: #8fa9ff; }
.st-dot.wait::before { background: var(--warn); }
.st-dot.wait { color: var(--warn); }
.st-dot.bad::before { background: var(--down); }
.st-dot.bad { color: #ff8a93; }
@keyframes st-puls { 50% { box-shadow: 0 0 0 5px rgba(8,153,129,0); } }

.st-badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
  border: 1px solid var(--border); color: var(--text-dim); background: var(--surface-2);
}
.st-badge.today { color: #8fa9ff; border-color: rgba(41,98,255,.45); background: var(--accent-soft); }
.st-badge.good { color: #5fd3b8; border-color: rgba(8,153,129,.5); background: rgba(8,153,129,.12); }
.st-badge.ok { color: #9ad9c6; border-color: rgba(8,153,129,.3); }
.st-badge.bad { color: #ff8a93; border-color: rgba(242,54,69,.4); background: rgba(242,54,69,.08); }
.st-badge.locked { color: var(--text-faint); border-style: dashed; }

.st-acc {
  font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px;
  background: var(--surface-3); color: var(--text-dim); letter-spacing: .2px;
}
.st-acc.live { background: rgba(246,193,119,.15); color: var(--warn); }

.st-side { font-size: 11.5px; font-weight: 700; }

/* ---------- Kacheln ---------- */
.st-tiles {
  display: grid; gap: var(--st-gap);
  grid-template-columns: repeat(auto-fill, minmax(min(310px, 100%), 1fr));
}
.st-tile {
  display: flex; flex-direction: column; gap: 10px; text-align: left;
  padding: 16px; min-height: 230px;
  background: linear-gradient(180deg, var(--surface-2), var(--st-card) 60%);
  border: 1px solid var(--border); border-radius: 16px; color: var(--text);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.st-tile:hover { border-color: #3a4256; transform: translateY(-2px); box-shadow: var(--shadow); }
.st-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.st-tile-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.st-tile-name { font-size: 16px; font-weight: 700; letter-spacing: -0.2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-tile-method { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-dim); }
.st-tile-account { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.st-tile-pnl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 2px; }
.st-tile-pnl > div { display: flex; flex-direction: column; gap: 2px; }
.st-tile-pnl span { font-size: 11px; color: var(--text-faint); }
.st-tile-pnl b { font-size: 18px; letter-spacing: -0.2px; }
.st-tile-nocurve {
  height: 44px; display: grid; place-items: center; font-size: 11.5px; color: var(--text-faint);
  border: 1px dashed var(--border-soft); border-radius: 8px;
}
.st-tile-foot { display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; color: var(--text-dim); margin-top: auto; }
.st-tile-foot i { font-style: normal; color: var(--text-faint); }
.st-tile-warn { font-size: 11.5px; color: #ff8a93; }
.st-tile-warn.soft { color: var(--warn); }
.st-tile-note { font-size: 11.5px; color: var(--text-faint); }

.st-add {
  align-items: center; justify-content: center; gap: 6px;
  background: transparent; border: 2px dashed var(--border); color: var(--text-dim);
}
.st-add:hover { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.st-add-plus {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  font-size: 32px; font-weight: 300; line-height: 1;
  background: var(--accent-soft); color: #8fa9ff; border: 1px solid rgba(41,98,255,.4);
}
.st-add-label { font-size: 15px; font-weight: 650; color: var(--text); }
.st-add-hint { font-size: 12px; color: var(--text-faint); text-align: center; }

/* ---------- Kurven ---------- */
.st-spark { width: 100%; height: 44px; display: block; }
.st-spark.wide { height: 120px; }
.st-spark-zero { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.st-spark-line { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.st-spark-line.up { stroke: var(--up); }
.st-spark-line.down { stroke: var(--down); }
.st-spark-area.up { fill: rgba(8,153,129,.14); }
.st-spark-area.down { fill: rgba(242,54,69,.12); }

/* ---------- Editor: drei Schritte ---------- */
.st-editor { display: flex; flex-direction: column; gap: 12px; }
.st-step { background: var(--st-card); border: 1px solid var(--border); border-radius: 14px; }
.st-step.open { border-color: #343b4e; }
.st-step-head {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 14px 16px; background: none; border: none; color: var(--text);
}
.st-step-nr {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 26px;
  font-size: 12.5px; font-weight: 700; background: var(--accent-soft); color: #8fa9ff;
}
.st-step-title { font-size: 15px; font-weight: 700; }
.st-step-sum { flex: 1; min-width: 0; font-size: 12.5px; color: var(--text-dim); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-step-chev { color: var(--text-faint); width: 14px; }
.st-step-body { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.st-note { grid-column: 1 / -1; margin: 0; font-size: 12.5px; color: var(--text-dim); line-height: 1.55; }
.st-note b { color: var(--text); }
.st-subhead { font-size: 12px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: .5px; margin-top: 6px; }

.st-quick { display: flex; gap: 8px; flex-wrap: wrap; }
.st-chip {
  padding: 6px 12px; border-radius: 999px; font-size: 12.5px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim);
  font-weight: 600; white-space: nowrap; cursor: pointer;
}
.st-chip:hover { color: var(--text); border-color: #3a4256; }

/* Assets */
.st-assets { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); }
.st-asset {
  display: flex; flex-direction: column; gap: 10px; padding: 12px;
  background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 12px;
  transition: border-color .12s, background .12s;
}
.st-asset.on { border-color: rgba(41,98,255,.55); background: linear-gradient(180deg, rgba(41,98,255,.08), var(--surface-2)); }
.st-asset-main { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.st-asset-main .set-check { width: 18px; height: 18px; flex-basis: 18px; }
.st-asset-name { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.st-asset-name b { font-size: 15px; }
.st-asset-name .dim { font-size: 11.5px; }
.st-asset-price { display: flex; flex-direction: column; align-items: flex-end; font-size: 12.5px; }
.st-asset-price i { font-style: normal; font-size: 11px; }
.st-asset-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.st-asset-stats span { display: flex; flex-direction: column; gap: 1px; }
.st-asset-stats i { font-style: normal; font-size: 10.5px; color: var(--text-faint); }
.st-asset-stats b { font-size: 13px; }
.st-asset-legs { display: flex; gap: 6px; }
.st-leg {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 6px 4px; border-radius: 9px; position: relative;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-dim);
}
.st-leg.measured::after {
  content: ''; position: absolute; top: 5px; right: 6px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
}
.st-leg.on { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.st-leg-name { font-size: 12.5px; font-weight: 650; }
.st-leg-r { font-size: 10.5px; }

/* Methoden */
.st-group { display: flex; flex-direction: column; gap: 8px; padding-top: 6px; }
.st-group + .st-group { border-top: 1px solid var(--st-line); padding-top: 14px; }
.st-group-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.st-group-head h4 { margin: 0; font-size: 14px; }
.st-same {
  font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  color: #8fa9ff; background: var(--accent-soft); border: 1px solid rgba(41,98,255,.35);
}
.st-same.off { color: var(--text-faint); background: transparent; border-color: var(--border); }
.st-methods { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr)); }
.st-method {
  display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 12px;
  transition: border-color .12s, background .12s;
}
.st-method:hover { border-color: #3a4256; }
.st-method:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.st-method.on { border-color: var(--accent); background: linear-gradient(180deg, rgba(41,98,255,.1), var(--surface-2) 70%); }
.st-method.off { cursor: default; opacity: .62; }
.st-method.off:hover { border-color: var(--border-soft); }
.st-method-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.st-radio {
  width: 16px; height: 16px; border-radius: 50%; flex: 0 0 16px;
  border: 2px solid var(--text-faint);
}
.st-method.on .st-radio { border-color: var(--accent); background: radial-gradient(circle, var(--accent) 45%, transparent 50%); }
.st-method.off .st-radio { border-style: dashed; }
.st-method-name { font-weight: 700; font-size: 14px; flex: 1; min-width: 0; }
.st-method-rules { display: flex; flex-wrap: wrap; gap: 6px; }
.st-method-rules span {
  display: inline-flex; gap: 6px; align-items: baseline; font-size: 12px;
  padding: 3px 8px; border-radius: 7px; background: var(--surface); color: var(--text-dim);
  border: 1px solid transparent;
}
.st-method-rules i { font-style: normal; color: var(--text-faint); font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; }
.st-method-rules span.diff { color: var(--warn); border-color: rgba(246,193,119,.35); background: rgba(246,193,119,.07); }
.st-method-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.st-period {
  display: grid; grid-template-columns: auto 1fr; column-gap: 6px; row-gap: 0; align-items: baseline;
  padding: 7px 9px; border-radius: 9px; background: var(--surface);
}
.st-period > i { grid-column: 1 / -1; font-style: normal; font-size: 10.5px; color: var(--text-faint); margin-bottom: 3px; }
.st-period > i em { font-style: normal; opacity: .8; }
.st-period b { font-size: 13px; text-align: right; }
.st-period small { font-size: 10.5px; color: var(--text-faint); }
.st-period.ref { grid-column: span 2; border: 1px dashed var(--border); background: transparent; }
.st-method-line { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; font-size: 12px; color: var(--text-dim); }
.st-method-line i { font-style: normal; color: var(--text-faint); }
.st-method-line.mc { padding: 6px 9px; border-radius: 9px; background: rgba(41,98,255,.06); }
.st-method-hint { font-size: 12px; color: var(--text-dim); line-height: 1.45; border-left: 2px solid var(--border); padding-left: 8px; }
.st-method.off .st-method-hint { border-left-color: var(--warn); }
.st-method-more {
  align-self: flex-start; background: none; border: none; padding: 0;
  color: #8fa9ff; font-size: 12px;
}
.st-method-details { display: flex; flex-direction: column; gap: 8px; padding-top: 6px; border-top: 1px solid var(--st-line); }
.st-years { display: flex; flex-wrap: wrap; gap: 4px; }
.st-year { display: flex; flex-direction: column; align-items: center; padding: 4px 7px; border-radius: 7px; background: var(--surface); min-width: 52px; }
.st-year i { font-style: normal; font-size: 10px; color: var(--text-faint); }
.st-year b { font-size: 12px; }

/* Übersicht aller Methoden */
.st-ov { display: flex; flex-direction: column; gap: 10px; }
.st-ov-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.st-chip.on { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.st-ov-scroll {
  overflow-x: auto; border: 1px solid var(--border-soft); border-radius: 12px;
  background: var(--surface-2); -webkit-overflow-scrolling: touch;
}
.st-ov-table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 860px; }
.st-ov-table th {
  position: sticky; top: 0; z-index: 1; text-align: right; white-space: nowrap;
  padding: 9px 10px; font-size: 11px; font-weight: 650; color: var(--text-faint);
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.st-ov-table th:first-child { text-align: left; }
.st-ov-table th button { background: none; border: none; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.st-ov-table th.on, .st-ov-table th button:hover { color: var(--text); }
.st-ov-table th.on button::after { content: ' ↓'; color: var(--accent); }
.st-ov-table td { padding: 8px 10px; border-top: 1px solid var(--st-line); vertical-align: middle; }
.st-ov-table tbody tr { cursor: pointer; transition: background .1s; }
.st-ov-table tbody tr:hover { background: rgba(255,255,255,.025); }
.st-ov-table tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.st-ov-table tbody tr.on { background: linear-gradient(90deg, rgba(41,98,255,.16), rgba(41,98,255,.04)); }
.st-ov-table tbody tr.on .st-radio { border-color: var(--accent); background: radial-gradient(circle, var(--accent) 45%, transparent 50%); }
.st-ov-name { display: flex; align-items: center; gap: 10px; min-width: 210px; max-width: 300px; }
.st-ov-label { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.st-ov-name b { font-size: 13px; line-height: 1.3; }
.st-ov-name small { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 10.5px; color: var(--text-faint); }
.st-ov-name .st-badge { font-size: 10px; padding: 0 7px; }
.st-ov-per { text-align: right; white-space: nowrap; }
.st-ov-per b { display: block; font-size: 13.5px; }
.st-ov-per small { display: flex; gap: 6px; justify-content: flex-end; font-size: 10.5px; color: var(--text-faint); }
.st-kombi .st-ov-name { min-width: 230px; max-width: 340px; }
.st-kombi td:last-child .st-chip { white-space: nowrap; padding: 4px 10px; }
.st-kombi tbody tr { cursor: default; }
.st-kombi td:last-child { text-align: right; }

.st-period-ls { grid-column: 1 / -1; display: flex; gap: 8px; margin-top: 3px; font-size: 10.5px; }

/* Assets: je Richtung, Richtung je Bein */
.st-asset-dirs { display: flex; flex-direction: column; gap: 3px; position: relative; }
.st-asset-dir {
  display: grid; grid-template-columns: 44px 1fr 1fr 1fr 1fr; gap: 6px; align-items: baseline;
  font-size: 12px; padding: 4px 8px; border-radius: 8px; background: var(--surface);
}
.st-asset-dir i { font-style: normal; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.st-asset-dir.long i { color: var(--up); }
.st-asset-dir.short i { color: var(--down); }
.st-asset-dir small { color: var(--text-faint); font-size: 10px; }
.st-asset-dir b { text-align: right; font-size: 12px; }
.st-asset-seit { align-self: flex-end; font-size: 10px; color: var(--text-faint); }
.st-seg.mini { width: 100%; }
.st-seg.mini .st-seg-btn { flex: 1; padding: 5px 6px; font-size: 11.5px; }
.st-leg-dir { font-size: 10.5px; font-weight: 700; letter-spacing: .3px; color: var(--text-faint); }
.st-leg.on .st-leg-dir { color: #8fa9ff; }
.st-leg.one { border-color: var(--warn); background: rgba(246,193,119,.08); }
.st-leg.one .st-leg-dir { color: var(--warn); }
.st-leg-only { font-size: 10px; font-weight: 700; color: var(--warn); }

/* Vorschlag je Asset */
.st-suggest {
  display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border-soft);
}
.st-suggest.good { border-color: rgba(8,153,129,.4); background: linear-gradient(180deg, rgba(8,153,129,.07), var(--surface-2)); }
.st-suggest-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.st-suggest-tests { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-dim); }
.st-suggest-tests > span:first-child { flex-basis: 100%; }
.st-suggest-tests i { font-style: normal; color: var(--text-faint); margin-right: 6px; }
.st-suggest-test { padding: 2px 8px; border-radius: 7px; background: var(--surface); }

/* Die Aufstellung einer Methode */
.st-facts { display: flex; flex-direction: column; gap: 6px; }
.st-facts-table {
  width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px;
  border: 1px solid var(--border-soft); border-radius: 12px; overflow: hidden; background: var(--surface-2);
}
.st-facts-table th, .st-facts-table td { padding: 7px 10px; border-top: 1px solid var(--st-line); text-align: right; white-space: nowrap; }
.st-facts-table thead th { border-top: none; font-size: 11px; color: var(--text-faint); font-weight: 650; background: var(--surface); }
.st-facts-table tbody th { text-align: left; font-weight: 500; color: var(--text-dim); white-space: normal; }
.st-facts-table thead th:first-child { text-align: left; }
.st-facts-table td b { font-size: 13px; }
.st-facts-table td small { color: var(--text-faint); }
.st-auto { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.st-auto > div {
  display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: baseline;
  padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border-soft);
}
.st-auto i { font-style: normal; font-size: 11.5px; color: var(--text-faint); }
.st-auto b { font-size: 13.5px; }
.st-auto small { grid-column: 1 / -1; font-size: 11.5px; color: var(--text-faint); line-height: 1.45; }

/* Risiko */
.st-seg-row { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.st-seg { display: inline-flex; padding: 3px; gap: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
.st-seg-btn {
  padding: 8px 14px; border-radius: 8px; border: none; background: none;
  color: var(--text-dim); font-weight: 650; font-size: 13px;
}
.st-seg-btn.on { background: var(--accent); color: #fff; }
.st-seg-row .tf-field { width: 160px; }
.st-dirs { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); }
.st-dir {
  display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 10px 12px;
  background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 10px; color: var(--text);
}
.st-dir span { font-size: 11.5px; color: var(--text-faint); }
.st-dir.on { border-color: var(--accent); background: var(--accent-soft); }
.st-bound {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border-soft);
}
.st-bound-head { font-size: 11.5px; font-weight: 700; color: var(--text-dim); margin-right: 4px; }
.st-bound-item { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--surface); color: var(--text-dim); }
.st-warn {
  font-size: 12.5px; line-height: 1.5; padding: 10px 12px; border-radius: 10px;
  color: #ffb3b9; background: rgba(242,54,69,.1); border: 1px solid rgba(242,54,69,.35);
}
.st-warn.soft { color: var(--warn); background: rgba(246,193,119,.07); border-color: rgba(246,193,119,.3); }
.st-warn.wide { flex-basis: 100%; }
.st-page .tf-check { margin-top: 2px; line-height: 1.4; }
.st-page .tf-check.dim { color: var(--text-faint); }

/* Fuß beim Anlegen: bleibt unten stehen */
.st-footer {
  position: sticky; bottom: 0; z-index: 5; margin-top: 16px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border-radius: 14px;
  background: rgba(19,23,34,.94); backdrop-filter: blur(8px);
  border: 1px solid var(--border); box-shadow: 0 -8px 24px rgba(0,0,0,.35);
}
.st-footer-sum { display: flex; gap: 12px; flex-wrap: wrap; align-items: baseline; font-size: 13px; color: var(--text-dim); flex: 1; min-width: 0; }
.st-footer-err { flex-basis: 100%; font-size: 12.5px; color: #ff8a93; order: 3; }
.st-footer-actions { display: flex; gap: 8px; }

/* ---------- Dashboard ---------- */
.st-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: var(--st-gap); align-items: start; }
.st-col { display: flex; flex-direction: column; gap: var(--st-gap); min-width: 0; }
.st-card {
  display: flex; flex-direction: column; gap: 10px; padding: 14px 16px;
  background: var(--st-card); border: 1px solid var(--border); border-radius: 14px; min-width: 0;
}
.st-card-title {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  font-size: 12px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: .5px;
}
.st-empty { font-size: 12.5px; color: var(--text-faint); padding: 8px 0; }
.empty.small { height: 80px; }

.st-how-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 16px; }
.st-how { display: flex; flex-direction: column; gap: 6px; }
.st-how > div { display: grid; grid-template-columns: 92px 1fr; gap: 10px; font-size: 13px; }
.st-how i { font-style: normal; color: var(--text-faint); font-size: 12px; }
.st-how-nums { display: grid; gap: 6px; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.st-how-nums > div { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.st-how-nums i { font-style: normal; font-size: 10.5px; color: var(--text-faint); }
.st-how-nums b { font-size: 16px; }
.st-how-nums small { font-size: 10.5px; color: var(--text-faint); }

.st-sigs { display: flex; flex-direction: column; }
.st-sig {
  display: grid; grid-template-columns: 96px 86px 48px 1fr auto; gap: 8px; align-items: center;
  padding: 8px 0; border-top: 1px solid var(--st-line); font-size: 12.5px;
}
.st-sig:first-child { border-top: none; }
.st-sig-name { display: flex; flex-direction: column; }
.st-sig-name .dim { font-size: 11px; }
.st-sig-levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 4px 8px; }
.st-sig-levels span { display: flex; flex-direction: column; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.st-sig-levels i { font-style: normal; font-size: 10px; color: var(--text-faint); }
.st-sig-reason { grid-column: 1 / -1; font-size: 11.5px; color: var(--text-faint); margin-top: -2px; }
.st-sig-chart {
  padding: 4px 9px; font-size: 11px; border-radius: 7px;
  background: transparent; border: 1px solid var(--border); color: var(--text-dim);
}
.st-sig-chart:hover { color: var(--text); border-color: #3a4256; }

.st-kpis { display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.st-kpi {
  display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; min-width: 0;
  background: var(--st-card); border: 1px solid var(--border); border-radius: 14px;
  line-height: 1.25;
}
.st-kpi.big { grid-column: span 2; background: linear-gradient(180deg, var(--surface-2), var(--st-card)); }
.st-kpi span { font-size: 11.5px; color: var(--text-faint); }
.st-kpi b { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-kpi.big b { font-size: 24px; letter-spacing: -0.4px; }
.st-kpi small { font-size: 11px; color: var(--text-faint); }

.st-poss { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); }
.st-pos {
  display: flex; flex-direction: column; gap: 8px; padding: 12px;
  background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 12px;
}
.st-pos-head { display: flex; align-items: baseline; gap: 8px; }
.st-pos-head b { font-size: 15px; }
.st-pos-age { margin-left: auto; font-size: 11px; color: var(--text-faint); }
.st-pos-pnl { display: flex; align-items: baseline; gap: 10px; }
.st-pos-pnl b { font-size: 19px; letter-spacing: -0.3px; }
.st-pos-pnl span { font-size: 12.5px; font-weight: 650; }
.st-pos-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 10px; font-size: 12px; }
.st-pos-grid span { display: flex; flex-direction: column; min-width: 0; }
.st-pos-grid i { font-style: normal; font-size: 10px; color: var(--text-faint); }
.st-pos-grid small { font-size: 10.5px; color: var(--text-faint); font-weight: 400; }

.st-pends { display: flex; flex-direction: column; }
.st-pend {
  display: grid; grid-template-columns: 56px 64px 64px 1fr 1fr auto; gap: 8px; align-items: baseline;
  padding: 7px 0; border-top: 1px solid var(--st-line); font-size: 12.5px;
}
.st-pend:first-child { border-top: none; }
.st-pend i { font-style: normal; color: var(--text-faint); font-size: 11px; }

.st-trades { display: flex; flex-direction: column; max-height: 360px; overflow-y: auto; }
.st-trade {
  display: grid; grid-template-columns: 62px 52px 20px 1fr auto 112px 60px; gap: 8px; align-items: center;
  padding: 6px 0; border-top: 1px solid var(--st-line); font-size: 12px;
}
.st-trade:first-child { border-top: none; }
.st-trade > b:nth-last-child(2) { text-align: right; }
.st-trade > span:last-child { text-align: right; font-size: 11.5px; }
.st-trade-px { color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.st-refusals { display: flex; flex-direction: column; }
.st-refusal {
  display: grid; grid-template-columns: 44px 1fr; gap: 2px 10px; align-items: baseline;
  padding: 7px 0; border-top: 1px solid var(--st-line); font-size: 12.5px; color: var(--text-dim);
}
.st-refusal:first-child { border-top: none; }
.st-refusal b { color: var(--warn); }
.st-refusal i { grid-column: 2; font-style: normal; font-size: 11px; color: var(--text-faint); }

/* Einstellungen unter dem Dashboard */
.st-settings { margin-top: 26px; display: flex; flex-direction: column; gap: 12px; }
.st-settings-head { display: flex; flex-direction: column; gap: 4px; }
.st-settings-head h2 { margin: 0; font-size: 18px; }
.st-savebar {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 14px; border-radius: 12px;
  background: rgba(19,23,34,.94); backdrop-filter: blur(8px); border: 1px solid var(--border);
}
.st-savebar > span:first-child { flex: 1; font-size: 12.5px; }
.st-dirty { color: var(--warn); font-weight: 650; }
.st-bar-err { flex-basis: 100%; order: 5; font-size: 12.5px; line-height: 1.45; color: #ff8a93; }
.st-tabs { display: inline-flex; gap: 4px; text-transform: none; letter-spacing: 0; }
.st-tab {
  padding: 4px 10px; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer;
  background: none; border: 1px solid var(--border); color: var(--text-dim);
}
.st-tab.on { background: var(--surface-3); color: var(--text); border-color: #3a4256; }
.st-settings .sg-log-rows { max-height: 360px; }
.st-settings .sg-log-row { grid-template-columns: 96px 56px 110px 1fr; font-size: 11.5px; }

/* ---------- Telefon ---------- */
@media (max-width: 1100px) {
  .st-cols { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .st-page { padding: 12px 12px 0; --st-gap: 12px; }
  .st-head { margin-bottom: 12px; }
  .st-head h1 { font-size: 21px; }
  .st-head-kpis { width: 100%; }
  .st-head-kpis > div { flex: 1; min-width: 0; padding: 8px 10px; }
  .st-head-kpis b { font-size: 14px; }
  .st-head-actions { width: 100%; }
  .st-head-actions .btn { flex: 1; }
  .st-tile { min-height: 0; padding: 14px; }
  .st-step-head { padding: 12px; gap: 10px; }
  .st-step-body { padding: 0 12px 12px; }
  .st-step-sum { display: none; }
  .st-method-nums { grid-template-columns: 1fr 1fr 1fr; gap: 4px; }
  .st-period { padding: 6px; column-gap: 3px; }
  .st-period b { font-size: 12px; }
  .st-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-kpi.big { grid-column: span 1; }
  .st-kpi.big b { font-size: 19px; }
  .st-sig { grid-template-columns: 1fr auto auto; row-gap: 6px; }
  .st-sig-levels { grid-column: 1 / -1; grid-row: 2; }
  .st-sig-chart { display: none; }
  .st-pend { grid-template-columns: 1fr auto auto; }
  .st-pend > span:nth-child(n+4) { grid-row: 2; }
  .st-trade { grid-template-columns: 56px 1fr 18px auto; row-gap: 2px; }
  .st-trade-px { grid-column: 1 / 3; grid-row: 2; }
  .st-trade > span:nth-child(5) { display: none; }
  .st-trade > b:nth-last-child(2) { grid-column: 3 / 5; grid-row: 2; }
  .st-trade > span:last-child { grid-row: 1; grid-column: 4; }
  .st-footer { border-radius: 14px 14px 0 0; margin: 16px -12px 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
  .st-savebar { margin: 0 -12px; border-radius: 14px 14px 0 0; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .st-footer-actions { width: 100%; }
  .st-footer-actions .btn { flex: 1; }
  .st-seg-row .tf-field { width: 100%; }
  .st-seg { width: 100%; }
  .st-seg-btn { flex: 1; padding: 9px 4px; }
  .st-settings .sg-log-row { grid-template-columns: 82px 48px 1fr; }
}
@media (max-width: 760px) {
  /* Beim seitlichen Wischen bleibt der Name stehen. */
  .st-ov-table th:first-child, .st-ov-table td.st-ov-name {
    position: sticky; left: 0; z-index: 2; background: var(--surface-2);
    box-shadow: 1px 0 0 var(--border-soft);
  }
  .st-ov-table th:first-child { z-index: 3; }
  .st-ov-table tbody tr.on td.st-ov-name { background: #1b2340; }
  .st-ov-name { min-width: 148px; max-width: 168px; gap: 6px; }
  .st-ov-name b { font-size: 12px; }
  .st-ov-table td, .st-ov-table th { padding: 7px 8px; }
}
@media (max-width: 560px) {
  .st-facts-table th, .st-facts-table td { padding: 6px 6px; font-size: 11.5px; }
  .st-facts-table td small { display: block; }
  .st-asset-dir { grid-template-columns: 40px 1fr 1fr 1fr; }
  .st-asset-dir b:last-child { display: none; }
}
@media (max-width: 420px) {
  .st-asset-stats { grid-template-columns: repeat(2, 1fr); }
  .st-pos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-tile-pnl b { font-size: 16px; }
}

/* ---------- Bot einrichten (30.11.2026): Konten, Risiko, Start ---------- */

.bot-page { max-width: 880px; }
.bot-karte {
  background: var(--st-card); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 18px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 12px;
}
.bot-karte-kopf { display: flex; align-items: center; gap: 10px; }
.bot-karte-kopf h2 { margin: 0; font-size: 16px; font-weight: 700; }
.bot-nr {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-size: 12.5px; font-weight: 700;
}
.bot-text { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--text); }
.bot-klein { margin: 0; font-size: 12px; line-height: 1.5; color: var(--text-dim); }
.bot-regeln { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bot-regel {
  display: flex; flex-direction: column; gap: 4px; padding: 12px 14px;
  background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 10px;
  font-size: 12.5px; color: var(--text-dim); line-height: 1.45;
}
.bot-regel b { font-size: 15px; color: var(--text); }
.bot-rolle-art { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.bot-rolle-art.long { color: var(--up, #26a69a); }
.bot-rolle-art.short { color: var(--down, #ef5350); }
.bot-regeln.einzeln { grid-template-columns: 1fr; }
.bot-modi { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bot-modus {
  display: flex; flex-direction: column; gap: 8px; text-align: left; cursor: pointer;
  padding: 14px; border-radius: 12px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border-soft);
}
.bot-modus:hover:not(:disabled) { border-color: #3a4256; }
.bot-modus.on { border-color: var(--accent); background: var(--accent-soft); }
.bot-modus:disabled { opacity: .5; cursor: not-allowed; }
.bot-modus-kopf { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.bot-radio { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border); flex: 0 0 16px; }
.bot-modus.on .bot-radio { border-color: var(--accent); background: radial-gradient(var(--accent) 45%, transparent 50%); }
.bot-modus-name { font-size: 12.5px; color: var(--text-dim); }
.bot-modus-zahlen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.bot-modus-zahlen > span { display: flex; flex-direction: column; gap: 2px; }
.bot-modus-zahlen i { font-style: normal; font-size: 10.5px; color: var(--text-faint); }
.bot-modus-zahlen b { font-size: 15px; font-variant-numeric: tabular-nums; }
.bot-modus-fuss { font-size: 11.5px; color: var(--text-dim); }
.bot-teil { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border-soft); }
.bot-teil-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.bot-teil-kopf span { font-size: 12px; color: var(--text-dim); }
.bot-paar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bot-paar .tf-field { min-width: 0; }
.bot-wahl { width: 100%; min-width: 0; }
.bot-soll { display: flex; flex-direction: column; gap: 6px; }
.bot-soll-kopf { font-size: 12px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; }
.bot-soll-zeile { display: grid; grid-template-columns: 1.2fr 1fr .6fr; gap: 10px; font-size: 13px; font-variant-numeric: tabular-nums; }
.bot-soll-zeile .dim { color: var(--text-faint); text-align: right; }
.bot-hinweis > div + div { margin-top: 4px; }
.bot-hinweis, .bot-ok {
  font-size: 13px; line-height: 1.5; padding: 10px 12px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border-soft); color: var(--text);
}
.bot-ok { border-color: rgba(38, 166, 154, .35); background: rgba(38, 166, 154, .08); }
.bot-seg { align-self: flex-start; }
.bot-seg .st-seg-btn { min-width: 64px; }
.bot-zahlen { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.bot-zahlen > div { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; }
.bot-zahlen span { font-size: 11px; color: var(--text-dim); }
.bot-zahlen b { font-size: 16px; font-variant-numeric: tabular-nums; }
.bot-fuss { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 4px 2px 24px; }
.bot-start { padding: 10px 22px; font-size: 14px; }
.bot-add { display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.bot-add-haupt {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: transparent; border: none; color: inherit; cursor: pointer; padding: 0;
}
@media (max-width: 640px) {
  .bot-regeln { grid-template-columns: 1fr; }
  .bot-zahlen { grid-template-columns: 1fr 1fr; }
  .bot-modi, .bot-paar { grid-template-columns: 1fr; }
}
.st-link {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--text-dim); font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px;
}
.st-link:hover { color: var(--text); }

/* Big-Trade-Filter in „Bot einrichten“ (01.12.2026) */
.bot-schalter { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border-soft); }
.bot-schalter input { margin-top: 3px; }
.bot-schalter span { display: flex; flex-direction: column; gap: 3px; }
.bot-schalter i { font-style: normal; font-size: 12px; color: var(--text-dim); line-height: 1.45; }

/* src/views/portfolio.css */
/* ---------- Portfolio ----------
   Eigene Datei wie signal-trading.css: an styles.css wird parallel
   gearbeitet, und das Projekt hat keine Versionskontrolle. Baut auf den
   Tokens aus styles.css auf und übernimmt die Formensprache der
   Signal-Trading-Seite — Karten mit großem Radius, Kennzahlen als Kacheln,
   Status als Punkt oder Abzeichen, Grün und Rot nur für die Richtung. */

.pf-page {
  display: block; min-height: 0; overflow: auto;
  font-variant-numeric: tabular-nums;
}
.pf-wrap {
  --pf-gap: 14px;
  max-width: 1440px; margin: 0 auto; width: 100%;
  padding: 18px 22px 28px;
  display: flex; flex-direction: column; gap: var(--pf-gap);
}
.pf-body { display: flex; flex-direction: column; gap: var(--pf-gap); min-width: 0; }
.pf-page .up { color: var(--up); }
.pf-page .down { color: var(--down); }
.pf-page .dim { color: var(--text-faint); }
.pf-page .notice { margin: 0; }

/* ---------- Kopf ---------- */
.pf-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 14px 20px; flex-wrap: wrap; margin-bottom: 2px;
}
.pf-title { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pf-head h1 { margin: 0; font-size: 24px; letter-spacing: -0.3px; }
.pf-status {
  margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--text-dim);
}
.pf-status-sep { color: var(--text-faint); }

.pf-dot {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--text-dim); white-space: nowrap;
}
.pf-dot::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint);
}
.pf-dot.live { color: var(--up); }
.pf-dot.live::before {
  background: var(--up); box-shadow: 0 0 0 3px rgba(8, 153, 129, .2);
  animation: pf-puls 2s ease-in-out infinite;
}
.pf-dot.wait { color: var(--warn); }
.pf-dot.wait::before { background: var(--warn); }
.pf-dot.bad { color: #ff8a93; }
.pf-dot.bad::before { background: var(--down); }
@keyframes pf-puls { 50% { box-shadow: 0 0 0 5px rgba(8, 153, 129, 0); } }

/* Kontowahl: eine Pille je Konto, die Farbe des Abzeichens sagt, ob
   echtes Geld dahintersteht. */
.pf-accounts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pf-acc {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; font-size: 13px;
  background: var(--surface); color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 999px;
  transition: border-color .12s, color .12s, background .12s;
}
.pf-acc:hover { border-color: #3a4256; color: var(--text); }
.pf-acc.on {
  color: var(--text); border-color: rgba(41, 98, 255, .6);
  background: linear-gradient(180deg, rgba(41, 98, 255, .14), var(--surface));
}
.pf-acc.add { border-style: dashed; background: transparent; }
.pf-acc-name { font-weight: 650; }
.pf-acc-kind {
  font-size: 10.5px; font-weight: 700; letter-spacing: .3px;
  padding: 2px 7px; border-radius: 6px;
  background: var(--surface-3); color: var(--text-dim);
}
.pf-acc-kind.demo { background: var(--accent-soft); color: #8fa9ff; }
.pf-acc-kind.live { background: rgba(246, 193, 119, .15); color: var(--warn); }

/* ---------- Kennzahlen ---------- */
.pf-kpi {
  display: flex; flex-direction: column; gap: 3px; min-width: 0;
  padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
}
.pf-kpi-label { font-size: 11.5px; color: var(--text-faint); }
/* Ein Wert bricht um, statt mit „…" zu enden: eine halbe Kontozahl ist
   schlimmer als eine zweite Zeile. */
.pf-kpi-value {
  font-size: 18px; font-weight: 650; letter-spacing: -0.2px;
  overflow-wrap: anywhere;
}
.pf-kpi-hint { font-size: 11px; color: var(--text-faint); line-height: 1.35; }
.pf-kpi.up .pf-kpi-value { color: var(--up); }
.pf-kpi.down .pf-kpi-value { color: var(--down); }
.pf-kpi.warn .pf-kpi-value { color: var(--warn); }
.pf-kpi.warn { border-color: rgba(246, 193, 119, .35); }

.pf-hero {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.pf-balance {
  grid-column: span 2;
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
  padding: 14px 18px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface) 70%);
  border: 1px solid var(--border); border-radius: 16px;
}
.pf-big {
  font-size: 30px; font-weight: 700; letter-spacing: -0.6px; line-height: 1.15;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pf-big small { font-size: 15px; font-weight: 600; color: var(--text-faint); margin-left: 6px; letter-spacing: 0; }
.pf-balance-change {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 12.5px;
}
.pf-balance-change b { font-size: 14px; }
.pf-balance-change span { color: var(--text-dim); }
.pf-balance-change.up b { color: var(--up); }
.pf-balance-change.down b { color: var(--down); }

/* Füllstand gegen eine Grenze */
.pf-meter {
  height: 4px; border-radius: 4px; background: var(--surface-3);
  overflow: hidden; margin: 3px 0 1px;
}
.pf-meter i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.pf-meter.warn i { background: var(--warn); }

/* ---------- Verlauf und Auswertung ---------- */
/* Drei Karten nebeneinander, gleich hoch: die Kurve bestimmt die Höhe
   nicht allein, sonst stünde sie halbleer über einem halben Bildschirm. */
.pf-cols {
  display: grid; gap: var(--pf-gap); align-items: stretch;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.05fr) minmax(0, .8fr);
}
.pf-card {
  display: flex; flex-direction: column; gap: 12px; min-width: 0;
  padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
}
.pf-card.flush { padding: 4px 0; gap: 0; }
.pf-card-title {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 12px; font-weight: 700; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .5px;
}
.pf-card-aside { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text-faint); }

.pf-stats { display: grid; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pf-stats .pf-kpi {
  padding: 9px 11px; border-radius: 11px;
  background: var(--surface-2); border-color: var(--border-soft);
}
.pf-stats .pf-kpi-value { font-size: 15.5px; }
.pf-stats .pf-kpi.accent { background: linear-gradient(180deg, rgba(41, 98, 255, .1), var(--surface-2)); }

.pf-split { display: flex; height: 4px; border-radius: 4px; overflow: hidden; gap: 2px; margin: 3px 0 1px; }
.pf-split i { display: block; height: 100%; }
.pf-split .win { background: var(--up); border-radius: 4px 0 0 4px; }
.pf-split .loss { background: var(--down); border-radius: 0 4px 4px 0; }

/* Kapitalkurve */
.pf-curve { min-height: 300px; }
.pf-chart { flex: 1; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.pf-chart-plot { position: relative; flex: 1; min-height: 190px; cursor: crosshair; }
.pf-chart-svg, .pf-chart-svg svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pf-chart-line { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.pf-chart-line.up { stroke: var(--up); }
.pf-chart-line.down { stroke: var(--down); }
.pf-stop-a.up { stop-color: var(--up); stop-opacity: .26; }
.pf-stop-a.down { stop-color: var(--down); stop-opacity: .22; }
.pf-stop-b { stop-opacity: 0; }
.pf-stop-b.up { stop-color: var(--up); }
.pf-stop-b.down { stop-color: var(--down); }
.pf-chart-base { stroke: var(--text-faint); stroke-width: 1; stroke-dasharray: 4 5; vector-effect: non-scaling-stroke; opacity: .7; }
.pf-chart-baselabel {
  position: absolute; left: 0; transform: translateY(-120%);
  font-size: 10.5px; color: var(--text-faint); pointer-events: none;
  background: var(--surface); padding: 0 4px 0 0;
}
.pf-chart-ylabel {
  position: absolute; right: 0; font-size: 10.5px; color: var(--text-faint);
  pointer-events: none; background: var(--surface); padding: 0 0 0 4px;
}
.pf-chart-ylabel.top { top: 0; }
.pf-chart-ylabel.bottom { bottom: 0; }
.pf-chart-dot {
  position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px;
  border-radius: 50%; pointer-events: none; border: 2px solid var(--surface);
}
.pf-chart-dot.up { background: var(--up); box-shadow: 0 0 0 4px rgba(8, 153, 129, .22); }
.pf-chart-dot.down { background: var(--down); box-shadow: 0 0 0 4px rgba(242, 54, 69, .2); }
.pf-chart-dot.hover { box-shadow: none; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; }
.pf-chart-cross {
  position: absolute; top: 0; bottom: 0; width: 0; pointer-events: none;
  border-left: 1px dashed var(--text-faint); opacity: .6;
}
.pf-chart-tip {
  position: absolute; top: 6px; margin-left: 12px; z-index: 2; pointer-events: none;
  display: flex; flex-direction: column; gap: 2px; min-width: 150px;
  padding: 8px 10px; border-radius: 10px; font-size: 11.5px; white-space: nowrap;
  background: rgba(26, 31, 46, .96); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.pf-chart-tip.flip { transform: translateX(calc(-100% - 24px)); }
.pf-chart-tip > span:first-child { color: var(--text-faint); }
.pf-chart-tip b { font-size: 14px; }
.pf-chart-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-faint); }
.pf-chart-empty {
  flex: 1; min-height: 160px; display: grid; place-items: center;
  font-size: 12.5px; color: var(--text-faint);
  border: 1px dashed var(--border-soft); border-radius: 10px;
}
.pf-chart-empty.small { min-height: 90px; flex: 0 0 auto; }

/* Monate: die Balken füllen die Karte, so hoch sie neben den anderen ist. */
.pf-monthcard .pf-months { flex: 1; }
.pf-months {
  display: flex; gap: 4px; align-items: stretch; min-height: 150px;
  overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin;
}
.pf-month { flex: 1 0 34px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pf-month-val { font-size: 10.5px; color: var(--text-dim); white-space: nowrap; }
.pf-month.up .pf-month-val { color: var(--up); }
.pf-month.down .pf-month-val { color: var(--down); }
.pf-month-bars { display: flex; flex-direction: column; width: 100%; flex: 1; min-height: 96px; }
.pf-month-up, .pf-month-dn { flex: 1; display: flex; justify-content: center; min-height: 0; }
.pf-month-up { align-items: flex-end; border-bottom: 1px solid var(--border); }
.pf-month-dn { align-items: flex-start; }
/* Ohne Verlustmonat braucht es die untere Hälfte nicht. */
.pf-months.only-up .pf-month-dn { display: none; }
.pf-month-up i, .pf-month-dn i { display: block; width: min(22px, 70%); }
.pf-month-up i { background: linear-gradient(180deg, var(--up), rgba(8, 153, 129, .55)); border-radius: 5px 5px 1px 1px; }
.pf-month-dn i { background: linear-gradient(0deg, var(--down), rgba(242, 54, 69, .55)); border-radius: 1px 1px 5px 5px; }
.pf-month-label { font-size: 11px; color: var(--text-faint); display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.pf-month-label small { font-size: 9.5px; opacity: .8; }

/* ---------- Abschnitte ---------- */
.pf-section {
  display: flex; flex-direction: column; gap: 10px; min-width: 0;
  margin-top: 8px; scroll-margin-top: 12px;
}
.pf-section-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pf-section-head h2 { margin: 0; font-size: 17px; letter-spacing: -0.2px; }
.pf-count {
  min-width: 22px; padding: 1px 8px; border-radius: 999px; text-align: center;
  font-size: 11.5px; font-weight: 700; color: #8fa9ff;
  background: var(--accent-soft); border: 1px solid rgba(41, 98, 255, .35);
}
.pf-section-aside { margin-left: auto; font-size: 12.5px; color: var(--text-dim); }
.pf-section-aside b { font-weight: 650; }
.pf-empty {
  padding: 18px; text-align: center; font-size: 12.5px; color: var(--text-faint);
  border: 1px dashed var(--border); border-radius: 14px;
}
.pf-card.flush > .pf-empty { border: none; }

.pf-sym { font-weight: 700; white-space: nowrap; }
.pf-sym small { font-size: .78em; font-weight: 600; color: var(--text-faint); margin-left: 1px; }
.pf-side {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; white-space: nowrap; border: 1px solid transparent;
}
.pf-side.long { color: #5fd3b8; background: rgba(8, 153, 129, .12); border-color: rgba(8, 153, 129, .45); }
.pf-side.short { color: #ff8a93; background: rgba(242, 54, 69, .09); border-color: rgba(242, 54, 69, .4); }
.pf-tag, .pf-kind {
  font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px;
  background: var(--surface-3); color: var(--text-dim); white-space: nowrap;
}

/* Positionen als Karten */
.pf-positions { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); }
.pf-pos {
  display: flex; flex-direction: column; gap: 10px; padding: 14px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface) 65%);
  border: 1px solid var(--border); border-radius: 14px; position: relative; overflow: hidden;
}
.pf-pos::before {
  content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0;
}
.pf-pos.long::before { background: var(--up); }
.pf-pos.short::before { background: var(--down); }
.pf-pos-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pf-pos-head .pf-sym { font-size: 16px; }
.pf-pos-age { margin-left: auto; font-size: 11px; color: var(--text-faint); }
.pf-pos-pnl { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pf-pos-pnl b { font-size: 22px; letter-spacing: -0.4px; }
.pf-pos-pnl span { font-size: 12.5px; font-weight: 650; }
.pf-r { padding: 1px 7px; border-radius: 6px; background: var(--surface-3); }
.pf-pos-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; font-size: 12.5px; }
.pf-pos-grid > span { display: flex; flex-direction: column; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-pos-grid i { font-style: normal; font-size: 10.5px; color: var(--text-faint); }
.pf-pos-grid small { font-size: 10.5px; color: var(--text-faint); }
.pf-pos-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-top: 10px; border-top: 1px solid var(--border-soft); font-size: 12px;
}
.pf-pos-foot .btn { border-radius: 8px; }

/* Stop — Einstieg — Ziel */
.pf-range { position: relative; height: 6px; border-radius: 6px; background: var(--surface-3); margin: 2px 0; }
.pf-range i { position: absolute; top: 0; height: 100%; display: block; }
.pf-range-loss { background: rgba(242, 54, 69, .55); border-radius: 6px; }
.pf-range-win { background: rgba(8, 153, 129, .6); border-radius: 6px; }
.pf-range-entry { width: 2px !important; margin-left: -1px; top: -3px !important; height: 12px !important; background: var(--text-dim); border-radius: 2px; }
.pf-range-mark {
  width: 12px; height: 12px !important; top: -3px !important; margin-left: -6px; border-radius: 50%;
  background: var(--text); border: 2px solid var(--surface);
}
.pf-range-mark.up { background: var(--up); }
.pf-range-mark.down { background: var(--down); }

/* Orders und Historie als Zeilen */
.pf-rows { display: flex; flex-direction: column; font-size: 12.5px; }
.pf-row {
  display: grid; gap: 10px; align-items: center;
  padding: 9px 16px; border-top: 1px solid var(--border-soft);
}
.pf-row:first-child { border-top: none; }
.pf-row:not(.head):hover { background: rgba(255, 255, 255, .02); }
.pf-row.head {
  font-size: 11px; font-weight: 600; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: .4px; padding-top: 8px; padding-bottom: 8px;
}
.pf-row > span { min-width: 0; white-space: nowrap; }
.pf-row i { font-style: normal; display: none; }
.pf-row .c-act { display: flex; justify-content: flex-end; }
.pf-row .c-act .btn { border-radius: 8px; }
.pf-history .c-pnl { font-weight: 700; }
.pf-history .c-path { color: var(--text-dim); }

/* Tabellenform: eine Zeile je Order oder Trade, Zahlen rechtsbündig,
   damit Stellen untereinander stehen. Erst ab 1101 px — schmaler
   schnitten die Spalten Zahlen ab („12,0000…"), und eine Kontozahl, die
   man nicht ganz lesen kann, ist schlimmer als eine Zeile mehr. */
@media (min-width: 1101px) {
  .pf-row > span { overflow: hidden; text-overflow: ellipsis; }
  .pf-orders .pf-row { grid-template-columns: 112px 100px 92px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) 110px 120px 110px; }
  .pf-history .pf-row { grid-template-columns: 112px 76px 124px 76px minmax(0, 1.3fr) minmax(0, 1fr) 100px 100px 120px; }
  .pf-orders .pf-row > :nth-child(n+4):nth-child(-n+7) { text-align: right; }
  .pf-orders .pf-row > :nth-child(8) { padding-left: 14px; }
  .pf-history .pf-row > :nth-child(n+3):nth-child(-n+8) { text-align: right; }
  .pf-history .pf-row > :nth-child(9) { padding-left: 16px; }
  .pf-history { max-height: 640px; overflow-y: auto; }
  .pf-history .pf-row.head { position: sticky; top: 0; z-index: 1; background: var(--surface); }
}
@media (min-width: 1101px) and (max-width: 1180px) {
  .pf-orders .pf-row { grid-template-columns: 104px 96px 76px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) 90px 100px; }
  .pf-orders .c-when, .pf-orders .pf-row.head > span:nth-child(8) { display: none; }
  .pf-history .pf-row { grid-template-columns: 104px 66px 120px 66px minmax(0, 1.5fr) minmax(0, 1fr) 88px 118px; }
  .pf-history .c-fees, .pf-history .pf-row.head > span:nth-child(8) { display: none; }
}

/* Schmaler werden die Zeilen mehrzeilig: oben Symbol, Richtung und das
   Wichtigste, darunter die Einzelheiten mit Beschriftung — nichts wird
   abgeschnitten, nichts liegt rechts außerhalb. */
@media (max-width: 1100px) {
  .pf-row.head { display: none; }
  .pf-row { padding: 10px 12px; gap: 4px 10px; }
  .pf-row i { display: inline; color: var(--text-faint); font-size: 11px; margin-right: 4px; }

  /* Oben Symbol, Art, Richtung und Stornieren; darunter Menge und Wert;
     dann Preis und Auslöser, soweit die Order sie hat. */
  .pf-orders .pf-row { grid-template-columns: auto auto 1fr auto; }
  .pf-orders .c-sym { grid-row: 1; grid-column: 1; }
  .pf-orders .c-kind { grid-row: 1; grid-column: 2; }
  .pf-orders .c-side { grid-row: 1; grid-column: 3; }
  .pf-orders .c-act { grid-row: 1; grid-column: 4; }
  .pf-orders .c-qty { grid-row: 2; grid-column: 1 / 3; }
  .pf-orders .c-value { grid-row: 2; grid-column: 3 / 5; text-align: right; }
  .pf-orders .c-price, .pf-orders .c-trigger { grid-column: 1 / -1; }
  .pf-orders .c-when, .pf-orders .none { display: none; }

  .pf-history .pf-row {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "sym side pnl"
      "path path r"
      "qty qty when";
  }
  .pf-history .c-sym { grid-area: sym; }
  .pf-history .c-side { grid-area: side; }
  .pf-history .c-pnl { grid-area: pnl; text-align: right; font-size: 13.5px; }
  .pf-history .c-r { grid-area: r; text-align: right; }
  .pf-history .c-path { grid-area: path; font-size: 12px; }
  .pf-history .c-qty { grid-area: qty; font-size: 11.5px; color: var(--text-faint); }
  .pf-history .c-when { grid-area: when; text-align: right; font-size: 11.5px; }
  .pf-history .c-value, .pf-history .c-fees { display: none; }
}

/* Dazwischen, auf Tablets und schmalen Fenstern, stehen die mehrzeiligen
   Zeilen zu zweit nebeneinander, statt über die ganze Breite zu laufen. */
@media (min-width: 761px) and (max-width: 1100px) {
  .pf-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-rows > .pf-row:nth-child(-n+3) { border-top: none; }
  .pf-rows > .pf-row:nth-child(even) { border-right: 1px solid var(--border-soft); }
}

/* ---------- Leeres Konto, Laden ---------- */
.pf-loading { min-height: 50vh; display: grid; place-items: center; }
.pf-blank {
  max-width: 460px; margin: 40px auto; padding: 28px 24px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; color: var(--text-dim);
}
.pf-blank-icon {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 8px;
  font-size: 28px; font-weight: 300; color: #8fa9ff;
  background: var(--accent-soft); border: 1px solid rgba(41, 98, 255, .4);
}
.pf-blank h2 { font-size: 17px; color: var(--text); margin: 0 0 4px; }
.pf-blank p { font-size: 13.5px; line-height: 1.5; margin: 0 0 14px; }

/* ---------- Leiste unten, nur Telefon ---------- */
.pf-dock { display: none; }

/* ---------- Schmaler ---------- */
@media (max-width: 1280px) {
  .pf-cols { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
  .pf-curve { grid-column: 1 / -1; min-height: 280px; }
}
@media (min-width: 761px) and (max-width: 1180px) {
  /* Kontostand über zwei Spalten und vier Kacheln: in drei Spalten gehen
     sie in zwei volle Reihen auf, statt eine Kachel allein umzubrechen. */
  .pf-hero { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  /* Auswertung und Monate untereinander: nebeneinander würden die
     Kennzahlen in ihren Kacheln abgeschnitten. */
  .pf-cols { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .pf-wrap { --pf-gap: 12px; padding: 12px 12px 0; }
  .pf-head { align-items: flex-start; }
  .pf-head h1 { font-size: 21px; }
  /* Die Konten rollen seitlich in ihrer eigenen Zeile, statt umzubrechen
     und den halben Bildschirm zu füllen. */
  .pf-accounts {
    width: calc(100% + 24px); margin: 0 -12px; padding: 0 12px 2px;
    flex-wrap: nowrap; justify-content: flex-start;
    overflow-x: auto; scrollbar-width: none;
  }
  .pf-accounts::-webkit-scrollbar { height: 0; }
  .pf-acc { flex: 0 0 auto; }

  .pf-hero { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pf-balance { padding: 14px; }
  .pf-big { font-size: 27px; }
  .pf-kpi { padding: 10px 12px; }
  .pf-kpi-value { font-size: 16px; }

  .pf-card { padding: 12px; }
  .pf-curve { min-height: 0; }
  .pf-months { min-height: 130px; }
  .pf-chart { min-height: 0; }
  .pf-chart-plot { flex: 0 0 auto; height: 190px; min-height: 0; }
  .pf-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .pf-stats .pf-kpi-value { font-size: 14.5px; }

  .pf-section-aside { margin-left: 0; flex-basis: 100%; font-size: 12px; }
  .pf-pos { padding: 12px; }
  .pf-pos-pnl b { font-size: 20px; }

  /* Die feste Leiste: springt zu den Abschnitten einer langen Seite. */
  .pf-dock {
    position: sticky; bottom: 0; z-index: 5;
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
    margin: 6px -12px 0; padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
    background: rgba(19, 23, 34, .94); backdrop-filter: blur(8px);
    border-top: 1px solid var(--border); border-radius: 14px 14px 0 0;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, .35);
  }
  .pf-dock.hidden { display: none; }
  .pf-dock-btn {
    display: flex; align-items: center; justify-content: center; gap: 5px;
    min-height: 40px; padding: 0 4px; border-radius: 10px;
    background: none; border: 1px solid transparent; color: var(--text-dim);
    font-size: 12px; font-weight: 650;
  }
  .pf-dock-btn.on { background: var(--accent-soft); color: #8fa9ff; border-color: rgba(41, 98, 255, .35); }
  .pf-dock-btn i {
    font-style: normal; font-size: 10.5px; font-weight: 700; min-width: 17px; padding: 0 5px;
    border-radius: 999px; background: var(--surface-3); color: var(--text-dim); line-height: 17px;
  }
  .pf-dock-btn i:empty { display: none; }
}

@media (max-width: 380px) {
  .pf-pos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-big { font-size: 25px; }
  .pf-dock-btn { font-size: 11.5px; gap: 3px; }
}

/* src/views/analysen.css */
/* Der Tab „Analysen“, die Bausteine, die Schiene im Analyse-Chart, das
   Wellen-Fenster und die EW-Leiste. Eigene Datei aus demselben Grund wie
   die übrigen: ohne Versionskontrolle überschreibt eine gemeinsame Datei
   parallele Änderungen still. */

.set-text {
  width: 100%; padding: 7px 9px; box-sizing: border-box;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-s); color: var(--text); font-size: 12.5px; outline: none;
}
.set-text:focus { border-color: var(--accent); }

.an-typ {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 18px; padding: 0 6px; border-radius: 9px;
  font-size: 10px; font-weight: 700; letter-spacing: .3px; vertical-align: middle;
  background: var(--surface-3); color: var(--text-dim);
}
.an-typ.typ-ew { background: rgba(213, 0, 249, .16); color: #e27cff; }
.an-typ.typ-ai { background: rgba(41, 98, 255, .18); color: #8fa9ff; }
.an-typ.typ-strategie { background: rgba(8, 153, 129, .18); color: #4ec9a5; }
.an-typ.typ-frei { background: rgba(246, 193, 119, .16); color: var(--warn); }

.an-link {
  background: none; border: none; padding: 0; color: #8fa9ff; font: inherit; cursor: pointer;
}
.an-link:hover { text-decoration: underline; }
.an-hinweis { color: var(--text-faint); font-size: 12.5px; line-height: 1.5; margin: 4px 0 0; }
.an-fehler { color: var(--down); font-size: 12.5px; padding: 6px 0; }
.an-fehler:empty { display: none; }
.dim { color: var(--text-faint); }

/* ---------- Übersicht ---------- */
.an-page { padding: 18px 20px 40px; }
.an-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; align-items: start; }
.an-gruppen {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px;
  display: flex; flex-direction: column; gap: 10px; position: sticky; top: 0;
}
.an-kopf { margin: 2px 2px 0; font-size: 13px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .6px; }
.an-gruppen-liste { display: flex; flex-direction: column; gap: 3px; }
.an-gruppe-knopf {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 9px;
  background: transparent; border: 1px solid transparent; border-radius: 8px;
  color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer;
}
.an-gruppe-knopf:hover { background: var(--surface-2); }
.an-gruppe-knopf.on { background: var(--accent-soft); border-color: rgba(41, 98, 255, .45); }
.an-gruppe-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-zahl { color: var(--text-faint); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.an-neu-gruppe {
  display: flex; flex-direction: column; gap: 7px; padding-top: 10px; border-top: 1px solid var(--border-soft);
}
.an-neu-klappe summary {
  cursor: pointer; list-style: none; padding: 7px 9px; border-radius: 8px;
  color: #8fa9ff; font-size: 12.5px; font-weight: 600; border: 1px dashed var(--border);
}
.an-neu-klappe summary::-webkit-details-marker { display: none; }
.an-neu-klappe[open] summary { margin-bottom: 8px; }
.an-neu-gruppe .set-select { max-width: none; }

.an-inhalt { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.an-gruppe-kopf, .an-seite-kopf {
  display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px;
}
.an-gruppe-kopf > div:first-child, .an-seite-kopf > div:first-child { flex: 1; min-width: 240px; }
.an-gruppe-kopf h2, .an-seite-kopf h2 { margin: 0; font-size: 19px; }
.an-aktionen { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.an-leer {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  padding: 18px; color: var(--text-faint); background: var(--surface); border: 1px dashed var(--border); border-radius: 12px;
}
.an-assets { display: flex; flex-direction: column; gap: 12px; }
.an-asset-block { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.an-asset-kopf {
  display: flex; align-items: center; gap: 4px; padding: 9px 14px;
  background: var(--surface-2); border-bottom: 1px solid var(--border-soft); font-size: 13px;
}
.an-analyse {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--border-soft);
}
.an-analyse:last-child { border-bottom: none; }
.an-analyse-haupt {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: left;
  background: none; border: none; color: var(--text); font: inherit; cursor: pointer; padding: 2px 0;
}
.an-analyse-haupt:hover b { color: #8fa9ff; }
.an-analyse-haupt b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-meta { font-size: 11.5px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-mehr { position: relative; }
.an-mehr summary {
  list-style: none; cursor: pointer; padding: 4px 9px; border-radius: 6px; color: var(--text-dim); font-size: 16px;
}
.an-mehr summary::-webkit-details-marker { display: none; }
.an-mehr summary:hover { background: var(--surface-2); }
.an-mehr-menue {
  position: absolute; right: 0; top: 30px; z-index: 30; min-width: 200px; padding: 5px;
  display: flex; flex-direction: column; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 9px; box-shadow: var(--shadow);
}
.an-mehr-menue button {
  text-align: left; background: none; border: none; color: var(--text); font: inherit; font-size: 12.5px;
  padding: 7px 9px; border-radius: 6px; cursor: pointer;
}
.an-mehr-menue button:hover { background: var(--surface-3); }
.an-mehr-menue button.danger { color: var(--down); }

.an-willkommen { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.an-willkommen h2 { margin: 0 0 6px; }
.an-vorschlaege { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 14px; }
.an-vorschlag {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; padding: 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; color: var(--text); font: inherit; cursor: pointer;
}
.an-vorschlag:hover { border-color: rgba(41, 98, 255, .6); }
.an-vorschlag span:last-child { font-size: 12px; color: var(--text-faint); line-height: 1.45; }

/* ---------- Neue Analyse ---------- */
.an-brotkrumen { font-size: 12.5px; color: var(--text-faint); margin-bottom: 12px; }
.an-karte-gross {
  max-width: 720px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px; display: flex; flex-direction: column; gap: 12px;
}
.an-karte-gross h2 { margin: 0; }
.an-feld { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: center; gap: 10px; }
.an-feld > span { font-size: 12.5px; color: var(--text-dim); }
.an-feld .set-select { max-width: 260px; }
.an-suchfeld { align-items: start; }
.an-suchfeld > span { padding-top: 8px; }
.an-suche { font-size: 14px; padding: 9px 11px; }
.an-vorschlagliste { grid-column: 2; display: flex; flex-wrap: wrap; gap: 5px; }
.an-vorschlagliste:empty { display: none; }
.an-treffer {
  padding: 5px 9px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); font: inherit; font-size: 12px; cursor: pointer;
}
.an-treffer:hover { border-color: var(--accent); }
.an-gewaehlt { padding-left: 120px; font-size: 13px; }
.an-baustein-wahl { display: flex; flex-direction: column; gap: 6px; }
.an-baustein-wahl:empty { display: none; }
.an-baustein-wahl h4 { margin: 4px 0; font-size: 13px; }
.an-baustein {
  display: grid; grid-template-columns: 20px 120px minmax(0, 1fr); align-items: center; gap: 6px;
  padding: 7px 9px; border: 1px solid var(--border-soft); border-radius: 8px; cursor: pointer;
}
.an-baustein span { font-size: 12px; color: var(--text-faint); }

/* ---------- Seite einer Analyse ---------- */
.an-seite { display: flex; flex-direction: column; gap: 14px; }
.an-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; }
.an-chip {
  padding: 5px 11px; border-radius: 14px; border: 1px solid var(--border); background: transparent;
  color: var(--text-dim); font: inherit; font-size: 12px; cursor: pointer;
}
.an-chip.on { background: var(--accent-soft); border-color: rgba(41, 98, 255, .55); color: var(--text); }
.an-bausteine-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; align-items: start; }
.an-ew-struktur { padding: 10px 0; border-bottom: 1px solid var(--border-soft); display: flex; flex-direction: column; gap: 5px; }
.an-ew-kopf { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.an-ew-wellen { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; font-variant-numeric: tabular-nums; }
.an-ew-ziele { font-size: 11.5px; }
.an-regelzahl { font-size: 11px; padding: 1px 7px; border-radius: 9px; }
.an-regelzahl.fehler { background: rgba(242, 54, 69, .16); color: var(--down); }
.an-regelzahl.hinweis { background: rgba(246, 193, 119, .16); color: var(--warn); }

/* ---------- Bausteine ---------- */
.ab-karte {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px;
  display: flex; flex-direction: column; gap: 10px; min-width: 0;
}
.ab-titel { margin: 0; font-size: 14px; }
.ab-leer { display: grid; place-items: center; min-height: 80px; color: var(--text-faint); font-size: 12.5px; text-align: center; }
.ab-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.ab-kpi { display: flex; flex-direction: column; gap: 2px; padding: 7px 9px; background: var(--surface-2); border-radius: 8px; min-width: 0; }
.ab-kpi span { font-size: 10.5px; color: var(--text-faint); }
.ab-kpi b { font-size: 13px; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ab-kpi b.up, .up { color: var(--up); }
.ab-kpi b.down, .down { color: var(--down); }
.ab-leiste { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ab-status { font-size: 11.5px; color: var(--text-faint); min-height: 14px; }
.ab-ai { display: flex; flex-direction: column; gap: 10px; }
.ab-ai-kopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.ab-text { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--text-dim); white-space: pre-wrap; }
.ab-unter { display: flex; flex-direction: column; gap: 6px; padding-top: 6px; border-top: 1px solid var(--border-soft); }
.ab-unter h4 { margin: 0; font-size: 12px; color: var(--text-dim); }
.ab-unter summary { cursor: pointer; font-size: 12px; color: var(--text-dim); }
.ab-block h5 { margin: 6px 0 3px; font-size: 11.5px; color: var(--text); text-transform: capitalize; }
.ab-block p, .ab-block li { font-size: 12px; color: var(--text-dim); line-height: 1.5; margin: 0; }
.ab-tabelle { display: flex; flex-direction: column; font-size: 11.5px; }
.ab-tr { display: grid; grid-template-columns: 46px repeat(5, minmax(0, 1fr)); gap: 6px; padding: 4px 2px; border-bottom: 1px solid var(--border-soft); align-items: center; }
.ab-tr span { display: flex; align-items: center; gap: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ab-tr.kopf { color: var(--text-faint); font-size: 10.5px; }
.ab-tr.drei { grid-template-columns: 92px minmax(0, 1fr) 150px; }
.ab-tr .tf { font-weight: 700; }
.ab-linie { height: 70px; color: #8fa9ff; }
.ab-linie svg { width: 100%; height: 100%; display: block; }
.ab-quelle { font-size: 10.5px; color: var(--text-faint); line-height: 1.45; }
.ab-notizen {
  width: 100%; box-sizing: border-box; resize: vertical; padding: 9px 10px; min-height: 90px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font: inherit; font-size: 13px; line-height: 1.5; outline: none;
}
.ab-notizen:focus { border-color: var(--accent); }
.ab-monate { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 3px; height: 70px; align-items: end; }
.ab-monat { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; height: 100%; }
.ab-monat i { width: 100%; background: rgba(41, 98, 255, .55); border-radius: 2px 2px 0 0; min-height: 2px; display: block; }
.ab-monat span { font-size: 9px; color: var(--text-faint); }
.ab-monat.unbekannt i { background: var(--border); }
.ab-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.ab-chips span { font-size: 10.5px; padding: 2px 8px; border-radius: 9px; background: var(--surface-2); color: var(--text-dim); }
.ab-links { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; }
.ab-links a { color: #8fa9ff; }

/* ---------- Schiene im Analyse-Chart ---------- */
.an-rail {
  flex: 0 0 auto; width: 0; min-width: 0; position: relative;
  display: flex; flex-direction: column;
  background: var(--surface); border-radius: 12px; overflow: hidden;
  transition: width .16s ease, margin .16s ease;
}
.an-rail.open { width: 372px; margin-left: 6px; border: 1px solid var(--border); }
.an-rail:not(.open) > * { display: none; }
.an-rail-kopf {
  display: flex; align-items: center; gap: 6px; padding: 8px 8px 0;
  border-bottom: 1px solid var(--border-soft); background: linear-gradient(180deg, var(--surface-2), var(--surface));
}
.an-reiter { flex: 1; display: flex; gap: 2px; }
.an-reiter-knopf {
  padding: 8px 12px; background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--text-dim); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.an-reiter-knopf.on { color: var(--text); border-bottom-color: var(--accent); }
.an-zu { background: none; border: none; color: var(--text-faint); font-size: 18px; cursor: pointer; padding: 4px 8px; }
.an-body { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; padding: 10px; }
.an-handle {
  padding: 0 12px; margin-right: 6px; color: var(--text);
  background: rgba(213, 0, 249, .10); border-color: rgba(213, 0, 249, .38);
}
.an-handle.on { background: #9c27b0; border-color: #9c27b0; color: #fff; }
.an-handle.on svg { stroke: #fff; }

.an-chart-kopf { display: flex; align-items: center; gap: 7px; font-size: 12.5px; min-width: 0; max-width: 46vw; }
.an-chart-kopf .an-link { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.an-chart-kopf .an-titel { color: var(--text); font-weight: 600; max-width: 220px; }
.an-stand { font-size: 10.5px; color: var(--text-faint); white-space: nowrap; }
.an-stand.dirty, .an-stand.saving { color: var(--warn); }
.an-stand.error { color: var(--down); }

.an-navigator { display: flex; flex-direction: column; gap: 8px; }
.an-gruppe { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.an-aktuell { display: flex; flex-direction: column; gap: 3px; padding: 9px 10px; background: var(--surface-2); border-radius: 9px; font-size: 12.5px; }
.an-aktuell .an-link { align-self: flex-start; font-size: 12px; }
.an-blaettern { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.an-pos { font-size: 12px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.an-abschnitt { margin: 6px 0 0; font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .5px; }
.an-liste { display: flex; flex-direction: column; gap: 2px; }
.an-zeile {
  display: flex; flex-direction: column; gap: 1px; width: 100%; text-align: left; padding: 7px 9px;
  background: none; border: 1px solid transparent; border-radius: 7px; color: var(--text); font: inherit; cursor: pointer;
}
.an-zeile:hover { background: var(--surface-2); }
.an-zeile.aktuell { background: var(--accent-soft); border-color: rgba(41, 98, 255, .45); }
.an-zeile-titel { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-zeile-meta { font-size: 10.5px; color: var(--text-faint); }
.an-neu { align-self: flex-start; }
.an-asset summary { cursor: pointer; padding: 5px 2px; font-size: 12.5px; }
.an-bausteine { display: flex; flex-direction: column; gap: 10px; }
.an-bausteine .ab-karte { padding: 11px; }
.an-bausteine .ab-kpis { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
.an-bausteine .ab-tr { grid-template-columns: 38px repeat(5, minmax(0, 1fr)); font-size: 10.5px; }
.an-bausteine .ab-tr.drei { grid-template-columns: 74px minmax(0, 1fr) 110px; }

/* ---------- Wellen-Fenster ---------- */
.ew-fenster { display: flex; flex-direction: column; gap: 10px; }
.ew-kopf { display: flex; align-items: center; gap: 8px; }
.ew-anzahl { font-size: 11.5px; color: var(--text-faint); }
.ew-leer p { font-size: 12.5px; line-height: 1.55; color: var(--text-dim); margin: 0 0 8px; }
.ew-karte {
  display: flex; flex-direction: column; gap: 7px; padding: 10px;
  background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 10px;
}
.ew-karte.gewaehlt { border-color: rgba(41, 98, 255, .7); box-shadow: 0 0 0 1px rgba(41, 98, 255, .35); }
.ew-karte-kopf {
  display: flex; align-items: center; gap: 7px; width: 100%; padding: 0; text-align: left;
  background: none; border: none; color: var(--text); font: inherit; cursor: pointer;
}
.ew-punkt { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: 0 0 10px; }
.ew-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ew-richtung { font-size: 13px; color: var(--text-dim); }
.ew-grad { font-size: 11px; color: var(--text-faint); white-space: nowrap; }
.ew-status { font-size: 11.5px; color: var(--text-dim); }
.ew-tabelle { display: flex; flex-direction: column; font-size: 11px; font-variant-numeric: tabular-nums; }
.ew-tr {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) 54px minmax(0, 1.35fr) 44px;
  gap: 6px; padding: 4px 0; border-bottom: 1px solid var(--border-soft); align-items: center;
}
.ew-tr > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ew-tr.kopf { color: var(--text-faint); font-size: 10px; }
.ew-tr.kaputt { background: rgba(242, 54, 69, .07); }
.ew-tr small { display: block; color: var(--text-faint); font-size: 9.5px; }
.ew-regeln { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.ew-regeln li { display: flex; gap: 6px; font-size: 11.5px; line-height: 1.4; color: var(--text-dim); }
.ew-regeln li i { flex: 0 0 14px; font-style: normal; font-weight: 800; text-align: center; }
.ew-regeln li.fehler { color: #ff8a93; }
.ew-regeln li.fehler i { color: var(--down); }
.ew-regeln li.hinweis i { color: var(--warn); }
.ew-regeln li.ok i { color: var(--up); }
.ew-ziele { display: flex; flex-direction: column; gap: 2px; }
.ew-ziele h5 { margin: 2px 0; font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .4px; }
.ew-ziel { display: grid; grid-template-columns: minmax(0, 1fr) auto 52px; gap: 6px; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.ew-ziel.zone { grid-template-columns: minmax(0, 1fr) auto; color: var(--text-dim); }
.ew-ziel.in-zone b { color: var(--text); }
.ew-tag {
  margin-left: 5px; padding: 0 5px; border-radius: 6px; font-size: 9.5px; font-weight: 700;
  background: rgba(213, 0, 249, .16); color: #e27cff;
}
.ew-knoepfe .ew-eigene { flex: 1 1 100%; font-size: 11.5px; padding: 5px 7px; }
.ew-ziel span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ew-knoepfe { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; padding-top: 6px; border-top: 1px solid var(--border-soft); }
.ew-knoepfe .ew-auswahl { flex: 1 1 100%; }
.ew-knoepfe .set-check-label { flex: 0 0 auto; gap: 6px; font-size: 12px; }
.ew-knoepfe .btn { flex: 0 0 auto; }
.ew-auswahl {
  max-width: 100%; padding: 5px 7px; font-size: 11.5px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px; color: var(--text);
}

/* ---------- EW-Leiste über dem Chart ---------- */
/* Eine eigene Zeile zwischen Kopfleiste und Chart: über den Kerzen
   verdeckte sie, was man anklicken will, und schluckte die Klicks. */
.ew-slot:empty { display: none; }
.ew-leiste {
  display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap;
  padding: 5px 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
}
.ewl-zeile { display: flex; align-items: center; gap: 4px 6px; flex-wrap: wrap; }
.ewl-formen { display: flex; gap: 1px; flex-wrap: wrap; }
.ewl-knopf {
  flex: 0 0 auto; padding: 4px 8px; border-radius: 6px; border: 1px solid transparent; background: transparent;
  color: var(--text-dim); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.ewl-knopf:hover { background: var(--surface-3); color: var(--text); }
.ewl-knopf.on { background: var(--accent); color: #fff; }
.ewl-magnet.on { background: rgba(8, 153, 129, .2); color: #4ec9a5; border-color: rgba(8, 153, 129, .5); }
.ewl-fertig { background: rgba(41, 98, 255, .18); color: #8fa9ff; border-color: rgba(41, 98, 255, .5); }
.ewl-grad {
  flex: 0 0 auto; width: 150px; padding: 4px 6px; font-size: 11.5px; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px;
}
.ewl-hinweis {
  flex: 1 1 0; min-width: 0; margin-left: 6px; font-size: 11.5px; color: var(--text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ewl-hinweis:empty { display: none; }

/* ---------- Dialog der Verhältnisse ---------- */
.ew-set { width: min(780px, 96vw); }
.ew-set .set-body { max-height: 64vh; overflow-y: auto; }
.ew-set-zeile {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 9px 0; border-bottom: 1px solid var(--border-soft);
}
.ew-set-zeile label { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-faint); }
.ew-set-name { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; }
.ew-set-name span { font-size: 11px; color: var(--text-faint); }
.ew-set .set-number { width: 70px; }


/* ---- Wellen-Baum (24.11.2026): oben der größte Grad, eingerückt die Wellen */
.ew-baum { display: flex; flex-direction: column; gap: 1px; }
.ew-knoten { display: flex; flex-direction: column; gap: 1px; }
.ew-zeile {
  display: flex; align-items: center; gap: 6px; width: 100%; min-height: 26px;
  padding: 3px 6px; border: none; border-radius: 6px; background: transparent;
  color: var(--text); font-size: 12.5px; text-align: left; font-variant-numeric: tabular-nums;
}
.ew-zeile.welle:hover, .ew-zeile-knopf:hover { background: var(--surface-3); }
.ew-zeile.gewaehlt, .ew-zeile.struktur.gewaehlt { background: rgba(41, 98, 255, .16); }
.ew-zeile.struktur { padding-right: 4px; }
.ew-zeile-knopf {
  display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0;
  padding: 2px 4px; border: none; border-radius: 6px; background: transparent; color: inherit; text-align: left;
}
.ew-auf { flex: 0 0 16px; padding: 0; border: none; background: transparent; color: var(--text-faint); font-size: 11px; }
.ew-zeile.welle b { min-width: 34px; font-weight: 500; }
.ew-zeile.welle span { font-size: 11.5px; }
.ew-zeile.laeuft b { opacity: .8; }
.ew-fehler {
  display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%;
  background: rgba(242, 54, 69, .18); color: var(--down); font-size: 10.5px; font-weight: 800;
}
.ew-kachel {
  display: flex; flex-direction: column; gap: 6px; padding: 10px 11px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
}
.ew-kachel.leer { color: var(--text-faint); font-size: 12px; border-style: dashed; background: transparent; }
.ew-k-kopf { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--text-dim); }
.ew-k-kopf b { color: var(--text); font-size: 13px; }
.ew-k-label { font-size: 20px !important; font-weight: 500; line-height: 1; }
.ew-k-zeile { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ew-k-zeile > span:last-child { text-align: right; }
.ew-k-fehler { font-size: 11.5px; color: #ff8a93; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ew-k-knoepfe { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-top: 6px; border-top: 1px solid var(--border-soft); }
.ew-k-knoepfe .ew-auswahl { flex: 1 1 100%; }

/* ---- Performance: Bilanz der Zielzonen */
.ew-perf { display: flex; flex-direction: column; gap: 10px; }
.ew-perf-kopf { display: flex; align-items: center; gap: 8px; }
.ew-perf-kopf .dim { flex: 1; font-size: 11.5px; }
.ew-perf-kopf.trades { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--border-soft); }
.ew-perf-laden, .ew-perf-fehler { font-size: 12.5px; color: var(--text-dim); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.ew-perf-kacheln { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.ew-perf-kachel {
  display: flex; flex-direction: column; gap: 2px; padding: 8px 9px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px;
}
.ew-perf-kachel span { font-size: 10.5px; }
.ew-perf-kachel b { font-size: 17px; font-variant-numeric: tabular-nums; }
.ew-perf-kachel small { font-size: 10px; line-height: 1.3; }
.ew-perf-kachel.up b { color: var(--up); }
.ew-perf-kachel.down b { color: var(--down); }
.ew-perf-erklaerung { font-size: 11px; line-height: 1.45; }
.ew-perf-tabelle { display: flex; flex-direction: column; gap: 2px; }
.ew-perf-zeile { display: grid; grid-template-columns: minmax(0, 1fr) auto 44px; gap: 8px; font-size: 12px; font-variant-numeric: tabular-nums; }
.ew-perf-zeile b { text-align: right; }
.ew-perf-liste { display: flex; flex-direction: column; gap: 1px; }
.ew-perf-fall {
  display: grid; grid-template-columns: minmax(30px, auto) minmax(0, 1fr) auto; gap: 8px; align-items: center;
  padding: 4px 6px; border: none; border-radius: 6px; background: transparent; color: var(--text);
  font-size: 11.5px; text-align: left; font-variant-numeric: tabular-nums;
}
.ew-perf-fall:hover { background: var(--surface-3); }
.ew-perf-was { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-dim); }
.ew-perf-fall.s-getroffen .ew-perf-status { color: var(--up); }
.ew-perf-fall.s-durchlaufen .ew-perf-status { color: var(--down); }
.ew-perf-fall.s-in_zone .ew-perf-status { color: var(--warn); }
.ew-perf-fall.s-offen .ew-perf-status { color: var(--text-faint); }

/* ---- Zielzone: Menü beim Rechtsklick, Presets, Vorlagen */

/* ---- Wellen-Baum, Runde 3 (24.11.2026): alle Wellen, Schalter, Ratio */
.ew-zeile.welle { cursor: pointer; }
.ew-zeile.welle.art-angenommen, .ew-zeile.welle.art-offen { opacity: .5; }
.ew-zeile.welle.art-angenommen b, .ew-zeile.welle.art-offen b { color: var(--text-dim); }
.ew-zeile.welle.art-danach { opacity: .8; }
.ew-ratio { font-size: 11px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.ew-luecke { flex: 1; }
.ew-schalter {
  flex: 0 0 auto; width: 20px; height: 20px; padding: 0; border: 1px solid var(--border); border-radius: 50%;
  background: transparent; color: var(--text-faint); font-size: 11px; line-height: 1;
}
.ew-schalter.an { color: var(--accent); border-color: rgba(41, 98, 255, .55); }
.ew-schalter:hover { background: var(--surface-3); color: var(--text); }
.ew-zonenschalter {
  flex: 0 0 auto; padding: 1px 7px; border: 1px solid var(--border); border-radius: 6px;
  background: transparent; color: var(--text-faint); font-size: 10.5px;
}
.ew-zonenschalter.an { color: #8fa9ff; border-color: rgba(41, 98, 255, .55); background: rgba(41, 98, 255, .12); }
.ew-k-hinweis { font-size: 11.5px; line-height: 1.45; }
.ewl-beginn.on { border-color: rgba(41, 98, 255, .6); color: #8fa9ff; }
.ewz-farbe { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 9px; margin-top: 4px; }
.ewp-koerper { max-height: 66vh; overflow-y: auto; }
.ewp-karte {
  display: flex; flex-direction: column; gap: 6px; padding: 9px 10px; margin: 6px 0;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
}
.ewp-design summary { cursor: pointer; font-size: 12px; color: var(--text-dim); padding: 2px 0; }
.ewp-design[open] summary { margin-bottom: 4px; }

.ewz-menue, .vorlage-pop { position: fixed; top: auto; z-index: 140; min-width: 250px; }
.ewz-kopf { padding: 6px 12px 4px; font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .4px; }
.ewz-eintrag { display: flex !important; align-items: flex-start; gap: 6px; }
.ewz-haken { flex: 0 0 14px; color: var(--accent); }
.ewz-text { display: flex; flex-direction: column; gap: 1px; }
.ewz-text small { color: var(--text-faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.ew-presetwahl { display: flex; gap: 4px; flex-wrap: wrap; }
.ew-preset {
  padding: 4px 10px; border: 1px solid var(--border); border-radius: 7px;
  background: transparent; color: var(--text-dim); font-size: 12px;
}
.ew-preset:hover { color: var(--text); background: var(--surface-3); }
.ew-preset.on { background: rgba(41, 98, 255, .18); border-color: rgba(41, 98, 255, .6); color: #8fa9ff; }
.set-dash { color: var(--text-faint); }
.vorlage-zeile { display: flex; align-items: center; }
.vorlage-zeile .vorlage-name { flex: 1; }
.vorlage-weg { border: none; background: transparent; color: var(--text-faint); padding: 4px 8px; font-size: 15px; border-radius: 6px; }
.vorlage-weg:hover { color: var(--down); background: var(--surface-3); }
.vorlage-form { display: flex; flex-direction: column; gap: 12px; }
.draw-modal.nur-zone .set-nav { display: none; }
.ewp-block { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--border-soft); }
.ewp-zeile { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ewp-zeile label { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-faint); }
.ewp-zeile .set-text { width: 170px; }
.ewp-zeile .ewp-name { width: 96px; }
.ewp-nr { width: 14px; color: var(--text-faint); font-size: 11.5px; }
.keys-modal .set-body { overflow-y: auto; }
.keys-modal .set-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.keys-modal .key-input { width: 92px; text-align: center; cursor: pointer; text-transform: none; }

@media (max-width: 760px) {
  .an-page { padding: 12px 12px 40px; }
  .an-layout { grid-template-columns: minmax(0, 1fr); }
  .an-gruppen { position: static; }
  .an-bausteine-raster { grid-template-columns: minmax(0, 1fr); }
  .an-feld { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .an-vorschlagliste { grid-column: 1; }
  .an-gewaehlt { padding-left: 0; }
  .an-baustein { grid-template-columns: 20px minmax(0, 1fr); }
  .an-baustein span { grid-column: 2; }
  .an-rail.open {
    position: absolute; inset: 0; width: 100%; margin: 0; z-index: 20; border: none; border-radius: 0;
    box-shadow: -8px 0 24px rgba(0, 0, 0, .35);
  }
  .an-chart-kopf { max-width: 40vw; }
  .an-chart-kopf .an-typ, .an-chart-kopf > .an-link:not(.an-titel), .an-chart-kopf > .dim, .an-stand { display: none; }
  .ew-leiste { padding: 4px 6px; }
  .ewl-grad { width: 120px; }
  /* Eine Zeile zum Wischen statt drei, die dem Chart die Höhe nehmen. */
  .ewl-zeile { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .ewl-zeile::-webkit-scrollbar { display: none; }
  .ewl-formen { flex-wrap: nowrap; }
  .ew-leiste { flex-wrap: nowrap; }
  .phone-bar.mit-analyse { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .chart-page:has(.an-rail.open) .phone-btn.pb-analysen { color: #e27cff; }
  .chart-page:has(.an-rail.open) .phone-btn.pb-analysen .phone-ico { background: rgba(213, 0, 249, .14); }
  .ewl-hinweis { display: none; }
  .ew-set-zeile { grid-template-columns: minmax(0, 1fr); }
}

/* Zielzonen-Design: Linien je Level (25.11.) — Farbe, Breite, Art, an/aus.
   Die Zeilen leihen sich das Raster der Fibonacci-Levelliste (fib.css). */
.ewlv-tabelle { padding: 2px 0 4px; }
.ewlv-zeile .ewlv-wert {
  flex: 0 0 48px; font-size: 12px; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.ewlv-zeile.aus .ewlv-wert { color: var(--text-faint); text-decoration: line-through; }
.ewlv-zeile.aus .set-color, .ewlv-zeile.aus .set-select { opacity: .45; }
.ewlv-zeile .ewlv-platz, .ewlv-kopf .ewlv-platz { flex: 0 0 22px; }
.ewlv-kopf { min-height: 0; }
.ewlv-kopf span { font-size: 11px; color: var(--text-faint); letter-spacing: .02em; }
.ewlv-kopf .ewlv-wert { flex: 0 0 48px; font-size: 11px; color: var(--text-faint); }
.ewlv-kopf .ewlv-k-box { flex: 0 0 16px; }
.ewlv-kopf .ewlv-k-farbe { flex: 0 0 34px; }
.ewlv-kopf .ewlv-k-sel { flex: 1; min-width: 0; max-width: 230px; padding-left: 2px; }
.ewlv-zeile .set-select { min-width: 0; }
/* Ohne eigene Farbe: blass, sie folgt den Linien der Zone. */
.ewlv-zeile .set-color.ewlv-erbt { opacity: .5; }

/* ---------- EW-Werkzeuge in der einen Leiste (30.11.2026) ---------- */
.symbol-bar .ew-slot { display: flex; align-items: center; min-width: 0; }
.ew-leiste.kompakt {
  padding: 0 0 0 8px; margin-left: 2px; background: none; border: none; border-radius: 0;
  border-left: 1px solid var(--border-soft); flex-wrap: nowrap;
}
.ew-leiste.kompakt .ewl-zeile { flex-wrap: nowrap; gap: 6px; }
.ewl-ew {
  font-size: 10.5px; font-weight: 800; letter-spacing: .04em; padding: 2px 6px; border-radius: 5px;
  color: #e27cff; background: rgba(213, 0, 249, .14);
}
.ewl-formwahl { position: relative; display: inline-flex; align-items: stretch; }
.ewl-formwahl .ewl-form {
  min-width: 64px; border: 1px solid var(--border); border-right: none; border-radius: 6px 0 0 6px;
  background: var(--surface-2); color: var(--text);
}
.ewl-formwahl .ewl-form.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.ewl-formwahl .ewl-pfeil {
  padding: 4px 6px; border: 1px solid var(--border); border-radius: 0 6px 6px 0; background: var(--surface-2);
}
.ewl-menue {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 120;
  min-width: 300px; padding: 5px; flex-direction: column; gap: 1px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow);
}
.ewl-menue.auf { display: flex; }
.ewl-menue-eintrag {
  display: flex; align-items: baseline; gap: 10px; width: 100%; text-align: left;
  padding: 7px 10px; border: none; border-radius: 7px; background: transparent; color: var(--text); cursor: pointer;
}
.ewl-menue-eintrag:hover { background: var(--surface-3); }
.ewl-menue-eintrag.on { background: var(--accent-soft); }
.ewl-menue-eintrag b { min-width: 58px; font-size: 12.5px; }
.ewl-menue-eintrag span { font-size: 11.5px; color: var(--text-dim); white-space: nowrap; }
.ew-leiste.kompakt .ewl-grad { width: 122px; }
.ew-leiste.kompakt .ewl-grad.ewl-beginn { width: 96px; }
.ew-leiste.kompakt .ewl-tasten { font-size: 14px; padding: 2px 7px; }
/* Der Hinweis zum nächsten Punkt: ein Schild oben im Chart, das keine
   Klicks nimmt und den Chart nicht verschiebt. */
.chart-host .ewl-hinweis {
  position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); z-index: 7;
  max-width: 70%; margin: 0; padding: 4px 12px; border-radius: 999px; pointer-events: none;
  background: rgba(19, 23, 34, .88); border: 1px solid var(--border); color: var(--text);
  font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chart-host .ewl-hinweis:empty { display: none; }
/* Eine Zeile, auch bei rund 1000 Pixel Breite: nichts schrumpft unter
   seinen Inhalt außer Suche und Analyse-Kopf, und mit EW-Werkzeugen
   zeigt die Zeitrahmenwahl nur den gewählten (▾ öffnet alle). */
.symbol-bar.eine-leiste > * { flex-shrink: 0; }
.symbol-bar.eine-leiste > .sym-group { flex-shrink: 1; min-width: 96px; }
.symbol-bar.eine-leiste > .an-chart-kopf { flex: 0 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; }
@media (max-width: 1440px) {
  .symbol-bar.eine-leiste:has(.ew-leiste) .tf-group .tf:not(.on) { display: none; }
}
@media (max-width: 1180px) {
  .ew-leiste.kompakt .ewl-grad { width: 104px; }
  .ew-leiste.kompakt .ewl-grad.ewl-beginn { width: 84px; }
  .symbol-bar.eine-leiste .an-chart-kopf .an-stand,
  .symbol-bar.eine-leiste .an-chart-kopf > .an-link:not(.an-titel),
  .symbol-bar.eine-leiste .an-chart-kopf > .dim { display: none; }
}
@media (max-width: 760px) {
  /* Am Telefon reicht die Breite nicht: die EW-Werkzeuge rutschen unter
     Symbol und Menü, in derselben Leiste. */
  .symbol-bar.eine-leiste { flex-wrap: wrap; }
  /* Die erste Zeile bleibt: Menü, Suche, Titel, Profil. Die Suche nimmt
     nur den Platz, der übrig ist (Basis 0), sonst bräche das Profil um. */
  .symbol-bar.eine-leiste > .sym-group { flex: 1 1 0; min-width: 0; }
  .symbol-bar.eine-leiste > .an-chart-kopf { max-width: 38vw; }
  .symbol-bar.eine-leiste .ew-slot { order: 20; flex-basis: 100%; overflow-x: auto; scrollbar-width: none; }
  .ew-leiste.kompakt { border-left: none; padding-left: 0; }
  .chart-host .ewl-hinweis { display: none; }
}

/* src/views/symbolsuche.css */
/*
 * Das Suchfenster für Symbole (views/symbolsuche.ts), wie bei
 * TradingView: großes Feld, Kategorien als Chips, Quelle als Auswahl,
 * darunter die Liste mit Kreis, Symbol, Name, Art und Börse.
 * Eigene Datei, wie fib.css und analysen.css — ohne Versionskontrolle
 * überschreibt eine gemeinsame Datei still parallele Arbeit.
 */

.ssu-overlay {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(8, 10, 14, .58);
  backdrop-filter: blur(3px);
  display: flex; justify-content: center; align-items: flex-start;
  padding-top: 7vh;
}

.ssu {
  width: 860px; max-width: calc(100vw - 32px);
  height: min(720px, 86vh);
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow);
  overflow: hidden;
}

.ssu-kopf {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 18px 12px 22px;
}
.ssu-lupe { display: inline-flex; color: var(--text-dim); }
.ssu-feld {
  flex: 1; min-width: 0;
  background: transparent; border: none; outline: none;
  color: var(--text); font-size: 20px; font-family: inherit;
}
.ssu-feld::placeholder { color: var(--text-faint); }
.ssu-x {
  width: 34px; height: 34px; display: grid; place-items: center;
  background: transparent; border: 1px solid transparent; border-radius: 10px;
  color: var(--text-dim);
}
.ssu-x:hover { background: var(--surface-3); color: var(--text); }

.ssu-filter {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 2px 18px 14px 22px;
  border-bottom: 1px solid var(--border);
}
.ssu-chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; min-width: 0; }
.ssu-chip {
  padding: 7px 14px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-dim); font-size: 13.5px; white-space: nowrap;
}
.ssu-chip:hover { color: var(--text); background: var(--surface-3); }
.ssu-chip.on { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 600; }
.ssu-quelle {
  flex: 0 0 auto;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 999px; padding: 7px 12px; font-size: 13px;
}

.ssu-liste { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: 6px 8px 12px; }
.ssu-titel {
  padding: 12px 14px 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-faint);
}
.ssu-zeile {
  display: flex; align-items: center; gap: 14px;
  padding: 9px 14px; border-radius: 10px; cursor: pointer;
}
.ssu-zeile.on { background: var(--surface-3); }
.ssu-logo {
  flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; font-size: 11px; font-weight: 750; letter-spacing: -.02em;
}
.ssu-text { flex: 1; min-width: 0; }
.ssu-sym {
  display: flex; align-items: center; gap: 6px;
  font-size: 15px; font-weight: 650; color: var(--text);
}
.ssu-uhr { display: inline-flex; color: var(--text-faint); }
.ssu-name { display: flex; align-items: center; gap: 8px; margin-top: 3px; min-width: 0; }
.ssu-name-text {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text-dim); font-size: 13px;
}
.ssu-art {
  flex: 0 0 auto;
  font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-dim); background: var(--surface-3);
  border-radius: 4px; padding: 2px 6px;
}
.ssu-zeile.on .ssu-art { background: var(--surface-2); }
.ssu-boerse {
  flex: 0 1 auto; max-width: 32%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12.5px; letter-spacing: .03em; color: var(--text-dim); text-align: right;
}
.ssu-weg {
  flex: 0 0 26px; width: 26px; height: 26px; display: grid; place-items: center;
  background: transparent; border: none; border-radius: 6px;
  color: var(--text-faint); opacity: 0;
}
.ssu-zeile:hover .ssu-weg, .ssu-zeile.on .ssu-weg { opacity: 1; }
.ssu-weg:hover { background: var(--surface-2); color: var(--text); }
.ssu-leer { padding: 22px 14px; color: var(--text-faint); font-size: 13.5px; }
.ssu-leer.klein { padding: 8px 14px; font-size: 12px; }

/* Das Symbolfeld der Leiste öffnet nur noch das Fenster. */
.symbol-box .symbol-input { cursor: pointer; caret-color: transparent; }

@media (max-width: 760px) {
  .ssu-overlay { padding: 0; }
  .ssu { width: 100vw; max-width: none; height: 100%; border-radius: 0; border: none; }
  .ssu-feld { font-size: 17px; }
  .ssu-filter { padding: 2px 12px 12px; }
  .ssu-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .ssu-chips::-webkit-scrollbar { display: none; }
  .ssu-quelle { flex: 1 0 100%; }
  .ssu-zeile { padding: 9px 8px; gap: 10px; }
  .ssu-boerse { max-width: 28%; font-size: 11px; }
}

/* src/views/seitenleiste.css */
/*
 * Rechte Leiste (Handel, Analysen, Skripte, Objektbaum), die Kacheln für
 * Skripte und Objektbaum, die Ladeanzeige über dem Chart und das
 * Marktstatus-Zeichen — Wünsche des Nutzers vom 27.11.2026.
 * Eigene Datei, wie fib.css und analysen.css.
 */

/* ---------- die schmale Leiste ---------- */

.rl-leiste {
  flex: 0 0 44px; width: 44px; margin-left: 6px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 0;
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: 12px;
}
.rl-knopf {
  width: 34px; height: 34px; display: grid; place-items: center;
  background: transparent; border: 1px solid transparent; border-radius: 9px;
  color: var(--text-dim); cursor: pointer;
  transition: background .12s, color .12s;
}
.rl-knopf:hover { background: var(--surface-3); color: var(--text); }
.rl-knopf.on { background: var(--accent-soft); color: var(--accent); border-color: rgba(41, 98, 255, .35); }
.rl-knopf.aus { opacity: .32; cursor: not-allowed; }
.rl-knopf.aus:hover { background: transparent; color: var(--text-dim); }
.rl-svg { display: grid; place-items: center; }
.rl-knopf svg { stroke: currentColor; }

/* Der alte Knopf oben rechts ist der Leiste gewichen. */
.symbol-bar .tp-handle, .symbol-bar .an-handle { display: none; }

/* ---------- Kacheln: Skripte und Objektbaum ---------- */

.sk-rail, .ob-rail {
  flex: 0 0 auto; width: 0; min-width: 0;
  display: flex; flex-direction: column;
  background: var(--surface); border-radius: 12px; overflow: hidden;
  transition: width .16s ease, margin .16s ease;
}
.sk-rail.open { width: 540px; margin-left: 6px; border: 1px solid var(--border); }
.ob-rail.open { width: 310px; margin-left: 6px; border: 1px solid var(--border); }
.sk-rail:not(.open) > *, .ob-rail:not(.open) > * { display: none; }

.sk-kopf, .ob-kopf {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 10px 9px 14px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border-bottom: 1px solid var(--border-soft);
}
.sk-kopf b, .ob-kopf b { font-size: 13px; color: var(--text); }
.sk-wahl { flex: 1; min-width: 0; max-width: none; }
.ob-kopf-knopf {
  width: 28px; height: 28px; display: grid; place-items: center;
  background: transparent; border: 1px solid transparent; border-radius: 7px;
  color: var(--text-dim);
}
.ob-kopf-knopf:hover { background: var(--surface-3); color: var(--text); }

.sk-koerper { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; }
.pine-kachel-inhalt { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.pine-kachel-inhalt .pine-bar { padding: 10px 12px 8px; flex-wrap: wrap; }
.pine-kachel-inhalt .pine-bar .set-select { flex: 1 1 100%; max-width: none; }
.pine-kachel-inhalt .pine-editor { margin: 0 12px; height: auto; flex: 1; min-height: 240px; }
.pine-kachel-inhalt .pine-status { padding: 8px 12px 2px; }
.pine-kachel-inhalt .pine-errors { margin: 2px 12px 0; }
.pine-kachel-inhalt .modal-foot { flex-wrap: wrap; padding: 10px 12px; }

/* ---------- Objektbaum ---------- */

.ob-liste { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 6px; }
.ob-reihe {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; margin-bottom: 4px;
  font-size: 12.5px; font-weight: 600; color: var(--text);
  border-bottom: 1px solid var(--border-soft);
}
.ob-reihe svg { color: var(--text-faint); }
.ob-zeile {
  display: flex; align-items: center; gap: 8px;
  min-height: 32px; padding: 3px 6px 3px 10px; border-radius: 7px;
  font-size: 12.5px; color: var(--text); cursor: pointer;
}
.ob-zeile:hover { background: var(--surface-2); }
.ob-zeile.gewaehlt { background: var(--accent-soft); }
.ob-zeile.tief { padding-left: 30px; }
.ob-zeile.versteckt .ob-name, .ob-zeile.versteckt .ob-icon { opacity: .45; }
.ob-icon { flex: 0 0 18px; display: grid; place-items: center; color: var(--text-dim); }
.ob-t { font-weight: 700; font-size: 13px; }
.ob-svg { display: grid; place-items: center; color: var(--text-dim); }
.ob-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ob-anzahl { color: var(--text-faint); font-size: 11.5px; }
.ob-schloss { display: grid; place-items: center; color: var(--text-faint); }
.ob-auge, .ob-mehr {
  flex: 0 0 26px; width: 26px; height: 26px; display: grid; place-items: center;
  background: transparent; border: none; border-radius: 6px; color: var(--text-faint);
}
.ob-auge { opacity: 0; }
.ob-mehr { opacity: 0; }
.ob-zeile:hover .ob-auge, .ob-zeile:hover .ob-mehr, .ob-zeile.gewaehlt .ob-auge, .ob-zeile.gewaehlt .ob-mehr,
.ob-auge.aus { opacity: 1; }
.ob-auge:hover, .ob-mehr:hover { background: var(--surface-3); color: var(--text); }
.ob-auge.aus { color: var(--warn); }
.ob-auf {
  flex: 0 0 18px; width: 18px; height: 18px; padding: 0;
  background: transparent; border: none; color: var(--text-faint); font-size: 11px;
}
.ob-ordner { border-radius: 8px; margin: 2px 0; }
.ob-ordner.ziel { outline: 1px dashed var(--accent); background: var(--accent-soft); }
.ob-ordner-kopf { padding-left: 4px; font-weight: 600; }
.ob-leer { padding: 18px 10px; color: var(--text-faint); font-size: 12.5px; }
.ob-menue { position: fixed; z-index: 140; min-width: 190px; }

/* ---------- Ladeanzeige über dem Chart ---------- */

.chart-laden {
  position: absolute; inset: 0; z-index: 8;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: var(--bg);
  color: var(--text-dim); font-size: 13px; text-align: center; padding: 24px;
}
.chart-laden-text { color: var(--text-dim); }
.chart-laden-fehler { color: var(--text); max-width: 520px; line-height: 1.45; }
.chart-laden-hinweis { color: var(--text-faint); font-size: 12px; min-height: 16px; }

/* ---------- Marktstatus neben dem Symbol ---------- */

.chart-legend .mz-pille {
  pointer-events: auto;
  display: inline-flex; align-items: center; gap: 5px;
  margin-left: 8px; padding: 2px 8px 2px 6px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px;
  color: var(--text-dim); font-size: 11px; font-weight: 600; line-height: 16px; cursor: pointer;
}
.chart-legend .mz-pille:hover { color: var(--text); border-color: #3a4256; }
.mz-punkt { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; display: inline-block; }
.mz-pop {
  position: fixed; z-index: 140; width: 360px; max-width: calc(100vw - 16px);
  padding: 12px 14px 12px; display: flex; flex-direction: column; gap: 8px;
}
.mz-kopf { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); }
.mz-art { color: var(--text-faint); font-size: 12px; margin-top: -4px; }
.mz-titel { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); margin-top: 4px; }
.mz-leiste {
  position: relative; height: 14px; border-radius: 4px; overflow: hidden;
  background: var(--surface-3);
}
.mz-stueck { position: absolute; top: 0; bottom: 0; }
.mz-stueck.mz-zu { opacity: .45; }
.mz-jetzt { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .5); }
.mz-skala { position: relative; height: 14px; font-size: 10px; color: var(--text-faint); }
.mz-skala span { position: absolute; transform: translateX(-50%); }
.mz-skala span:first-child { transform: none; }
.mz-skala span:last-child { transform: translateX(-100%); }
.mz-liste { display: flex; flex-direction: column; gap: 4px; }
.mz-zeile { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text); }
.mz-zeit { min-width: 92px; font-variant-numeric: tabular-nums; color: var(--text-dim); }
.mz-fuss { font-size: 11.5px; color: var(--text-faint); line-height: 1.4; border-top: 1px solid var(--border-soft); padding-top: 8px; }

/* ---------- Layout-Menü: nur das Zeichen ---------- */

.layout-trigger.nur-icon { padding: 0 9px; gap: 6px; }
.menu-pop-kopf {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 8px 12px 8px; margin-bottom: 4px;
  font-size: 12.5px; font-weight: 700; color: var(--text);
  border-bottom: 1px solid var(--border-soft);
}
.menu-pop-kopf-stand { font-size: 11px; font-weight: 500; color: var(--text-faint); }

/* ---------- Neue Analyse: Asset über das Suchfenster ---------- */

.an-suche-knopf {
  display: flex; align-items: center; gap: 8px; width: 100%;
  text-align: left; cursor: pointer;
}
.an-suche-knopf svg { color: var(--text-faint); flex: 0 0 auto; }

@media (max-width: 760px) {
  /* Am Telefon bleibt es bei der Leiste unten; die rechte Leiste fehlt. */
  .rl-leiste { display: none; }
  .sk-rail.open, .ob-rail.open {
    position: absolute; inset: 0; width: 100%; margin: 0; z-index: 20; border: none; border-radius: 0;
  }
  .chart-legend .mz-pille .mz-text { display: none; }
  .chart-legend .mz-pille { padding: 3px; }
}

/* src/views/start.css */
/* ---------- Startseite für Angemeldete ----------
   Eigene Datei wie die übrigen Ansichten; baut auf den Tokens aus
   styles.css auf. */
.sts-page { font-variant-numeric: tabular-nums; }
.sts-innen { padding: 22px 22px 40px; max-width: 1320px; margin: 0 auto; }
.sts-page .up { color: var(--up); }
.sts-page .down { color: var(--down); }
.sts-page .dim { color: var(--text-faint); }
.sts-page .notice { margin-bottom: 16px; }
.sts-oben { display: flex; flex-direction: column; gap: 16px; min-height: calc(100dvh - var(--header-h) - 92px); }
.sts-begruessung { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.sts-begruessung h1 { margin: 0; font-size: 24px; letter-spacing: -.3px; font-weight: 650; overflow-wrap: anywhere; }
.sts-summe { color: var(--text-dim); font-size: 13.5px; }
.sts-summe b { color: var(--text); font-size: 16px; margin-left: 4px; }

.sts-karte { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 14px; padding: 16px 18px; min-width: 0; }
.sts-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sts-kopf h2 { margin: 0; font-size: 14.5px; font-weight: 640; }
.sts-link { background: none; border: none; padding: 4px 0; color: #8fa9ff; font-size: 13px; white-space: nowrap; }
.sts-link:hover { color: var(--text); text-decoration: underline; }

.sts-konten { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.sts-konto {
  display: flex; flex-direction: column; gap: 8px; text-align: left; min-width: 0;
  background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 12px;
  padding: 13px 14px; color: var(--text);
}
.sts-konto:hover { border-color: #39405a; }
.sts-konto-kopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.sts-konto-kopf b { font-weight: 620; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sts-art { flex: none; font-style: normal; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 6px; background: var(--surface-3); color: var(--text-dim); }
.sts-art.live { background: rgba(8, 153, 129, .16); color: #3fc7a8; }
.sts-art.demo { background: var(--accent-soft); color: #8fa9ff; }
.sts-wert { font-size: 19px; font-weight: 650; }
.sts-konto-fuss { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.sts-fehler { color: var(--warn); font-size: 12.5px; line-height: 1.4; }

.sts-spalten { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 16px; flex: 1; }
.sts-liste { display: flex; flex-direction: column; }
.sts-zeile {
  display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 12px; align-items: center; text-align: left;
  background: none; border: none; border-top: 1px solid var(--border-soft); padding: 11px 2px; color: var(--text);
}
.sts-zeile:first-child { border-top: none; }
.sts-zeile:hover { background: var(--surface-2); }
.sts-sym { font-weight: 650; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sts-titel { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; min-width: 0; overflow-wrap: anywhere; }
.sts-titel small { color: var(--text-faint); font-size: 12px; }
.sts-zeit { color: var(--text-faint); font-size: 12px; white-space: nowrap; }

.sts-bild { display: block; width: 100%; padding: 0; background: none; border: 1px solid var(--border-soft); border-radius: 10px; overflow: hidden; color: var(--text); }
.sts-bild:hover { border-color: #39405a; }
.sts-bild img { display: block; width: 100%; height: auto; max-height: 420px; object-fit: cover; object-position: right center; }
.sts-bild-text { display: flex; gap: 10px; align-items: baseline; padding: 9px 12px; background: var(--surface-2); font-size: 12.5px; color: var(--text-dim); flex-wrap: wrap; text-align: left; }
.sts-bild-text b { color: var(--text); font-size: 13.5px; }
.sts-bild-text .dim { margin-left: auto; }

.sts-laden { display: flex; justify-content: center; padding: 26px 0; grid-column: 1 / -1; }
.sts-leer { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 28px 12px; text-align: center; color: var(--text-faint); font-size: 13.5px; grid-column: 1 / -1; }

.sts-markt-karte { margin-top: 16px; }
.sts-kennzahlen { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.sts-kennzahl { display: flex; flex-direction: column; gap: 3px; background: var(--surface-2); border-radius: 10px; padding: 11px 13px; }
.sts-kennzahl span { font-size: 12px; color: var(--text-faint); }
.sts-kennzahl b { font-size: 18px; font-weight: 650; }
.sts-kennzahl small { font-size: 12px; color: var(--text-faint); }
.sts-kennzahl small.up { color: var(--up); }
.sts-kennzahl small.down { color: var(--down); }
.sts-muenzen { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px 18px; margin-bottom: 14px; }
.sts-muenze {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 76px; gap: 10px; align-items: baseline; width: 100%;
  background: none; border: none; border-bottom: 1px solid var(--border-soft); padding: 9px 4px; color: var(--text); text-align: left; font-size: 13px;
}
.sts-muenze:hover { background: var(--surface-2); }
.sts-muenze b { font-weight: 640; overflow: hidden; text-overflow: ellipsis; }
.sts-muenze span:last-child { text-align: right; }
.sts-muenze-preis { color: var(--text-dim); }
.sts-zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.sts-zwei h3 { margin: 4px 0 4px; font-size: 12.5px; font-weight: 620; color: var(--text-dim); }

@media (max-width: 980px) {
  .sts-muenzen { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sts-kennzahlen { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .sts-spalten { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .sts-innen { padding: 16px 14px 32px; }
  .sts-karte { padding: 14px; }
  .sts-konten { grid-template-columns: minmax(0, 1fr); }
  .sts-zwei, .sts-muenzen { grid-template-columns: minmax(0, 1fr); }
  .sts-zeile { grid-template-columns: 80px minmax(0, 1fr); }
  .sts-zeit { grid-column: 2; }
}

/* Nutzerverwaltung */
.klassen-info { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 18px; }
.klassen-info > div { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 10px; padding: 11px 13px; font-size: 12.5px; color: var(--text-dim); line-height: 1.45; }
.klassen-info b { display: block; color: var(--text); font-size: 13.5px; margin-bottom: 2px; }
@media (max-width: 760px) { .klassen-info { grid-template-columns: 1fr; } }

/* Wer keine Börse verbinden kann, handelt auf dem Papier. */
.sts-papier {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding: 10px 13px; margin-bottom: 12px; border-radius: 10px; font-size: 13px; line-height: 1.45;
  background: color-mix(in srgb, var(--warn) 11%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 32%, transparent);
  color: var(--text-dim);
}
.sts-papier b { color: var(--warn); font-weight: 650; white-space: nowrap; }

/* src/views/ew-handel.css */
/* Zielzonen handeln (Seite der Analyse und Handelsleiste ihres Charts),
   Punkte-Menü, Reiter und Asset-Namen der Analysen. */

.pm-knopf {
  flex: 0 0 auto; width: 32px; height: 28px; border-radius: 7px; background: transparent; border: none;
  color: var(--text-dim); font-size: 17px; line-height: 1;
}
.pm-knopf:hover { background: var(--surface-3); color: var(--text); }
.pm-menue {
  position: fixed; z-index: 160; min-width: 210px; max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); overflow-y: auto;
  padding: 5px; display: flex; flex-direction: column; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow);
}
.pm-menue button {
  text-align: left; background: none; border: none; color: var(--text); font: inherit; font-size: 13px; padding: 8px 10px; border-radius: 7px;
}
.pm-menue button:hover, .pm-menue button:focus-visible { background: var(--surface-3); }
.pm-menue button.danger { color: var(--down); }

.an-stift {
  display: inline-grid; place-items: center; width: 24px; height: 22px; margin: 0 2px; vertical-align: middle;
  background: transparent; border: none; border-radius: 6px; color: var(--text-faint);
}
.an-stift:hover { background: var(--surface-3); color: var(--text); }
.an-asset-name { color: var(--text); font-weight: 620; }
.an-name-form { display: flex; flex-direction: column; gap: 12px; }
.an-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.an-tab {
  padding: 9px 14px; background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -1px;
  color: var(--text-dim); font: inherit; font-size: 13.5px; font-weight: 600;
}
.an-tab:hover { color: var(--text); }
.an-tab.on { color: var(--text); border-bottom-color: var(--accent); }
.an-bausteine-raster.einspaltig { grid-template-columns: minmax(0, 720px); }

.ewh { display: flex; flex-direction: column; gap: 10px; min-width: 0; font-variant-numeric: tabular-nums; }
.ewh-block, .ewh-karte {
  display: flex; flex-direction: column; gap: 9px; padding: 12px; min-width: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
}
.tp-rail .ewh-block, .tp-rail .ewh-karte { background: var(--surface-2); border-color: var(--border-soft); padding: 11px; }
.ewh-karte.aktiv { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.ewh-kopf { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 2px 0; font-size: 13px; }
.ewh-feld { display: grid; grid-template-columns: minmax(88px, auto) minmax(0, 1fr); align-items: center; gap: 10px; font-size: 12.5px; }
.ewh-feld > span:first-child { color: var(--text-dim); }
.ewh-feld .set-select { max-width: none; width: 100%; min-width: 0; }
.ewh-wert { display: flex; align-items: center; gap: 8px; justify-content: flex-end; min-width: 0; }
.ewh-wert .set-number { width: 118px; min-width: 0; text-align: right; }
.ewh-wert small { color: var(--text-faint); font-size: 11.5px; white-space: nowrap; }
.ewh-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.ewh-chip {
  padding: 5px 10px; border-radius: 8px; border: 1px solid var(--border); background: transparent;
  color: var(--text-dim); font: inherit; font-size: 12px;
}
.ewh-chip:hover { color: var(--text); background: var(--surface-3); }
.ewh-chip.on { background: var(--accent-soft); border-color: rgba(41, 98, 255, .55); color: var(--text); }
.ewh-klein { font-size: 11.5px; color: var(--text-faint); line-height: 1.4; }
.ewh-hinweis { font-size: 12.5px; line-height: 1.5; color: var(--text-faint); }
.ewh-papier, .ewh-echt { font-size: 11.5px; font-weight: 600; padding: 4px 9px; border-radius: 7px; align-self: flex-start; }
.ewh-papier { background: color-mix(in srgb, var(--warn) 13%, transparent); color: var(--warn); }
.ewh-echt { background: rgba(8, 153, 129, .16); color: #3fc7a8; }
.ewh-meldung { font-size: 12.5px; line-height: 1.45; padding: 8px 11px; border-radius: 9px; border: 1px solid var(--border); }
.ewh-meldung.ok { border-color: color-mix(in srgb, var(--up) 45%, transparent); color: #3fc7a8; }
.ewh-meldung.error { border-color: color-mix(in srgb, var(--down) 45%, transparent); color: var(--down); }

.ewh-titel { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ewh-name { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.ewh-name b { font-size: 14px; }
.ewh-name small { color: var(--text-faint); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ewh-richtung { flex: none; font-size: 11.5px; font-weight: 650; padding: 3px 9px; border-radius: 7px; }
.ewh-richtung.long { background: rgba(8, 153, 129, .17); color: #3fc7a8; }
.ewh-richtung.short { background: rgba(242, 54, 69, .16); color: #ff7a85; }
.ewh-spanne { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-dim); }
.ewh-spanne b { color: var(--text); font-weight: 600; }
.ewh-status { color: var(--warn); }
.ewh-danach { font-size: 12.5px; color: var(--text-dim); }
.ewh-danach b { color: var(--text); font-weight: 600; }
.ewh-unklar {
  display: flex; flex-direction: column; align-items: flex-start; gap: 9px; padding: 9px 11px; border-radius: 9px;
  font-size: 12.5px; line-height: 1.45; color: var(--text-dim);
  background: color-mix(in srgb, var(--warn) 9%, transparent); border: 1px dashed color-mix(in srgb, var(--warn) 45%, transparent);
}
.ewh-werte { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ewh-werte > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ewh-werte span { font-size: 11px; color: var(--text-faint); }
.ewh-werte b { font-size: 13.5px; font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ewh-werte small { font-size: 11px; color: var(--text-faint); line-height: 1.3; }
.ewh-felder { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 0; border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); }
.ewh-felder .an-link { align-self: flex-start; font-size: 12.5px; }
.ewh-vorschau { font-size: 12px; line-height: 1.45; color: var(--text-dim); }
.ewh-vorschau:empty { display: none; }
.ewh-vorschau > div { display: flex; flex-direction: column; gap: 3px; }
.ewh-fehler { color: var(--down); font-size: 12px; }
.ewh-warnung { color: var(--warn); font-size: 12px; line-height: 1.4; }
.ewh-aktionen { display: flex; flex-wrap: wrap; gap: 7px; }
.ewh-setzen.long { background: var(--up); border-color: var(--up); color: #fff; }
.ewh-setzen.short { background: var(--down); border-color: var(--down); color: #fff; }
.ewh-setzen:disabled { opacity: .45; }
.ewh-trade { display: flex; flex-direction: column; gap: 8px; }
.ewh-mehr summary { cursor: pointer; font-size: 12.5px; color: var(--text-dim); padding: 6px 2px; }
.ewh-zeile { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: space-between; font-size: 12px; padding: 6px 2px; border-top: 1px solid var(--border-soft); }
.ewh-zeile .ew-punkt { flex: none; }
.ewh-zeile span:nth-child(2) { flex: 1; }
.ewh-zeile small { flex-basis: 100%; }

/* src/views/chartbilder.css */
/* Chartbilder: die Übersicht der Layouts mit ihrem Bild, dieselben Karten im
   Dialog „Layout öffnen“, das erneuerte Layout-Menü. */

.cb-page { font-variant-numeric: tabular-nums; }
.cb-innen { max-width: 1320px; margin: 0 auto; padding: 22px 22px 40px; display: flex; flex-direction: column; gap: 16px; }
.cb-kopf { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.cb-kopf h1 { margin: 0; font-size: 24px; letter-spacing: -.3px; font-weight: 650; }
.cb-kopf .an-hinweis { max-width: 620px; }
.cb-zahl { color: var(--text-dim); white-space: nowrap; }
.cb-werkzeuge { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cb-werkzeuge .btn { display: inline-flex; align-items: center; gap: 6px; }
.cb-suche { width: 240px; }
.cb-ordnen { min-width: 150px; }
.cb-meldung { color: var(--down); font-size: 13px; }
.cb-meldung:empty { display: none; }
.cb-analysen { margin-top: 6px; }

.cb-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.cb-raster.kompakt { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.cb-leer { grid-column: 1 / -1; background: var(--surface); border: 1px dashed var(--border); border-radius: 14px; }

.cb-karte {
  display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: 14px;
  transition: border-color .12s, transform .12s;
}
.cb-karte:hover { border-color: #39405a; }
.cb-karte.aktiv { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.cb-bildrahmen { position: relative; }
.cb-bild {
  display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 10; padding: 0; overflow: hidden; position: relative;
  background: var(--bg); border: none; border-bottom: 1px solid var(--border-soft); color: var(--text-faint); cursor: pointer;
}
.cb-bild img { width: 100%; height: 100%; object-fit: cover; object-position: right center; display: block; }
.cb-bild:hover img { filter: brightness(1.08); }
.cb-verlauf { position: absolute; inset: 0; width: 100%; height: 100%; }
.cb-ohne-bild { position: relative; font-size: 12px; font-weight: 600; letter-spacing: .3px; padding: 4px 9px; border-radius: 7px; background: color-mix(in srgb, var(--surface) 80%, transparent); }
.cb-verlauf + .cb-ohne-bild { position: absolute; left: 10px; bottom: 10px; font-weight: 500; color: var(--text-dim); }
.cb-stern {
  position: absolute; top: 8px; left: 8px; width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: 9px; border: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 85%, transparent);
  color: var(--text-faint); opacity: 0; transition: opacity .12s;
}
.cb-karte:hover .cb-stern, .cb-stern.on, .cb-stern:focus-visible { opacity: 1; }
.cb-stern.on { color: #f6c177; }
.cb-stern.on svg path { fill: currentColor; }
.cb-offen {
  position: absolute; top: 8px; right: 8px; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 7px;
  background: var(--accent); color: #fff;
}
.cb-fuss { display: flex; align-items: flex-start; gap: 4px; padding: 10px 8px 11px 13px; }
.cb-text {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: left;
  background: none; border: none; padding: 0; color: var(--text); cursor: pointer;
}
.cb-text b { font-size: 14px; font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-text span { font-size: 12.5px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-text small { font-size: 11.5px; color: var(--text-faint); }
.cb-text:hover b { color: #8fa9ff; }
.cb-karte.kompakt .cb-fuss { padding: 8px 6px 9px 11px; }
.cb-karte.kompakt .cb-text b { font-size: 13px; }

/* Startseite: zwei Links im Kopf der Karte. */
.sts-aktionen { display: flex; align-items: center; gap: 16px; }

/* Layout-Menü und Dialog „Layout öffnen“. */
.menu-pop.layout-pop { min-width: 236px; }
.menu-pop-item.mit-icon { display: flex; align-items: center; gap: 10px; }
.menu-pop-item.mit-icon svg { flex: 0 0 auto; color: var(--text-faint); }
.menu-pop-item.mit-icon:hover svg { color: var(--text); }
.menu-pop-item.mit-icon.danger svg { color: var(--down); }
.menu-pop-item.mit-icon.accent { color: #8fa9ff; }
.menu-pop-item.mit-icon.accent svg { color: #8fa9ff; }
.menu-pop-kopf-stand.dirty { color: var(--warn); }
.menu-pop-kopf-stand.error { color: var(--down); }
.modal.layout-browser { width: 760px; max-width: calc(100vw - 24px); max-height: min(86vh, 820px); display: flex; flex-direction: column; }
.layout-browser-liste { overflow-y: auto; padding: 4px 14px 14px; min-height: 160px; }
.layout-browser .modal-foot { display: flex; align-items: center; gap: 8px; }
.layout-browser .modal-foot .btn { display: inline-flex; align-items: center; gap: 6px; }
.eingabe-form { display: flex; flex-direction: column; gap: 12px; min-width: min(360px, 80vw); }

@media (max-width: 760px) {
  .cb-innen { padding: 14px 12px 30px; }
  .cb-suche { width: 100%; flex: 1 1 100%; }
  .cb-raster { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .cb-stern { opacity: 1; }
  .sts-aktionen { gap: 12px; }
}
