/* TradingBot — hell und dunkel (ADR-029). Ohne Wahl folgt die Seite dem Gerät; im Profil fest „Hell“ oder „Dunkel“ wählbar
   (boot.js setzt data-thema auf <html>, bevor die Seite gezeichnet wird).
   Dunkel bewusst ruhig: grau statt tiefblau, kein reines Weiß, gedämpfte Farben — kein Nachbild beim Wegschauen.
   Volle Breite (B9): Kopf und Inhalt auf denselben Kanten, Inhalt 1600 px. */
:root {
  color-scheme: light dark;
  /*                hell        dunkel */
  --bg:         light-dark(#f4f5f7, #17191d);
  --flaeche:    light-dark(#ffffff, #1e2126);
  --flaeche-2:  light-dark(#eceef2, #24282e);
  --text:       light-dark(#1d232b, #d5d7db);
  --leise:      light-dark(#59626d, #969ca5);
  --rand-farbe: light-dark(#d5d9df, #31363e);
  --akzent:     light-dark(#2257a8, #86a9d6);
  --akzent-flaeche: light-dark(#2a5db0, #3f679e);
  --auf-akzent: #fff;
  --plus:       light-dark(#16783a, #74b98f);
  --minus:      light-dark(#b42323, #d68888);
  --warnung:    light-dark(#8a5a00, #cfb064);
  --fehler:     light-dark(#b42323, #d68888);
  --gold:       light-dark(#7a5c00, #d2b965);
  --streifen-flaeche: light-dark(#fbf4d9, #212329);
  --auf-warnung: light-dark(#fff, #1a1300);
  --auf-minus:  light-dark(#fff, #1a0505);
  --reihe-1:    light-dark(#2f6fbf, #5f9ad6);
  --reihe-2:    light-dark(#c25a1c, #d08a55);
  --auf-reihe:  light-dark(#fff, #17191d);
  --radius: 10px;
  --inhalt: 1600px; --rand: 1.25rem;
  --kante: max(var(--rand), calc((100% - var(--inhalt)) / 2));
  --nav-hoehe: 0px;
}
:root[data-thema="hell"] { color-scheme: light; }
:root[data-thema="dunkel"] { color-scheme: dark; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scrollbar-gutter: stable; background: var(--bg); color: var(--text); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; line-height: 1.5; font-size: 1rem;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding-bottom: calc(var(--nav-hoehe) + env(safe-area-inset-bottom));
}
#view:empty { min-height: 40vh; }

/* Streifen oben: Demo-Kennzeichnung immer, Entwicklung nur, wenn ein Schalter wirkt */
.streifen { padding: .35rem var(--kante); font-size: .875rem; }
.streifen--demo { background: var(--streifen-flaeche); color: var(--gold); border-bottom: 1px solid var(--rand-farbe); }
.streifen--entwicklung { background: var(--warnung); color: var(--auf-warnung); font-weight: 600; }

/* Kopfleiste */
.kopf {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 1rem;
  padding: .6rem var(--kante); background: var(--flaeche); border-bottom: 1px solid var(--rand-farbe);
}
.marke { color: var(--text); font-weight: 700; font-size: 1.1rem; text-decoration: none; }
.nav { display: flex; gap: .25rem; margin-left: auto; }
.nav a {
  position: relative; display: flex; align-items: center; gap: .4rem; min-height: 44px; padding: 0 .8rem;
  color: var(--leise); text-decoration: none; border-radius: 8px;
}
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); background: color-mix(in srgb, var(--akzent) 18%, transparent); }
.nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.zahl {
  min-width: 1.2rem; padding: 0 .3rem; border-radius: 999px; background: var(--minus); color: var(--auf-minus);
  font-size: .75rem; font-weight: 700; text-align: center; line-height: 1.2rem;
}
.netz { font-size: .8rem; color: var(--fehler); }
.nav:not([hidden]) ~ .netz { margin-left: 0; }

/* Handy: Reiter unten (D39), Start links, Profil rechts */
@media (max-width: 767px) {
  body.mit-nav { --nav-hoehe: 64px; }
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; margin: 0; justify-content: space-around;
    padding: .25rem .5rem calc(.25rem + env(safe-area-inset-bottom));
    background: var(--flaeche); border-top: 1px solid var(--rand-farbe);
  }
  .nav a { flex: 1; flex-direction: column; justify-content: center; gap: .1rem; min-height: 54px; font-size: .75rem; }
  .nav a[aria-current="page"] { background: none; color: var(--akzent); }
  .zahl { position: absolute; top: 2px; left: calc(50% + 6px); }
}

main { padding: 1.25rem var(--kante) 2rem; outline: none; }
h1 { font-size: 1.6rem; margin: 0; line-height: 1.25; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
.seitenkopf { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 1.5rem; margin-bottom: 1rem; }
.unterzeile, .stand { color: var(--leise); margin: 0; }
.stand { margin-top: 1rem; font-size: .875rem; }

.karte { background: var(--flaeche); border: 1px solid var(--rand-farbe); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1rem; }
.hinweis { border-color: color-mix(in srgb, var(--gold) 45%, var(--rand-farbe)); }
.hinweis p { margin: 0; }

/* Watchlist als Raster, das am Handy umbricht */
.gruppe { margin-bottom: 1.5rem; }
.gruppe h2 { color: var(--leise); text-transform: none; font-weight: 600; }
.tabelle { background: var(--flaeche); border: 1px solid var(--rand-farbe); border-radius: var(--radius); overflow: hidden; }
.zeile {
  display: grid; grid-template-columns: minmax(12rem, 2fr) minmax(7rem, 1fr) minmax(9rem, 1fr) minmax(14rem, 2fr);
  gap: .25rem 1rem; align-items: center; padding: .7rem 1rem; border-top: 1px solid var(--rand-farbe);
}
.zeile:first-child { border-top: 0; }
.zeile--kopf { font-size: .8rem; color: var(--leise); background: var(--flaeche-2); padding-block: .45rem; }
.tabelle--quellen .zeile { grid-template-columns: minmax(12rem, 1.5fr) minmax(10rem, 1fr) minmax(9rem, 1fr) minmax(12rem, 2fr); }
.wert-name { display: flex; flex-direction: column; min-width: 0; }
.wert-name strong { font-size: 1.05rem; }
.wert-name span { color: var(--leise); font-size: .875rem; overflow-wrap: anywhere; }
.wert-kurs { font-variant-numeric: tabular-nums; font-size: 1.05rem; font-weight: 600; }
.wert-veraenderung { font-variant-numeric: tabular-nums; }
.wert-veraenderung small { color: var(--leise); }
.wert-veraenderung--plus { color: var(--plus); }
.wert-veraenderung--minus { color: var(--minus); }
.wert-status { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .6rem; }
.wert-status small { color: var(--leise); }

.marke-status { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 600; border: 1px solid; }
.marke-status--live { color: var(--plus); border-color: color-mix(in srgb, var(--plus) 50%, transparent); }
.marke-status--verzoegert { color: var(--warnung); border-color: color-mix(in srgb, var(--warnung) 50%, transparent); }
.marke-status--veraltet { color: var(--minus); border-color: color-mix(in srgb, var(--minus) 50%, transparent); }
.marke-status--geschlossen { color: var(--akzent); border-color: color-mix(in srgb, var(--akzent) 50%, transparent); }
.marke-status--keine { color: var(--leise); border-color: var(--rand-farbe); }

@media (max-width: 767px) {
  .zeile, .tabelle--quellen .zeile { grid-template-columns: 1fr auto; }
  .zeile:has(.wert-name) { grid-template-areas: "name kurs" "status veraenderung"; }
  .zeile--kopf { display: none; }
  .wert-name { grid-area: name; }
  .wert-kurs { grid-area: kurs; }
  .wert-status { grid-area: status; }
  .wert-veraenderung { grid-area: veraenderung; }
  .wert-kurs, .wert-veraenderung { text-align: right; justify-self: end; }
  .tabelle--quellen .zeile > :nth-child(n+3) { grid-column: 1 / -1; color: var(--leise); font-size: .875rem; }
}

/* Listen und Angaben */
.liste { display: grid; grid-template-columns: minmax(10rem, max-content) 1fr; gap: .4rem 1.5rem; margin: 0; }
.liste dt { color: var(--leise); }
.liste dd { margin: 0; }
.liste dd.warnung { color: var(--warnung); font-weight: 600; }
@media (max-width: 480px) { .liste { grid-template-columns: 1fr; gap: 0; } .liste dd { margin-bottom: .5rem; } }

.alarme { list-style: none; margin: 0; padding: 0; }
.alarme li { padding: .6rem 0; border-top: 1px solid var(--rand-farbe); }
.alarme li:first-child { border-top: 0; }
.alarme li.neu strong { color: var(--warnung); }
.alarme p { margin: .2rem 0; }
.alarme small { color: var(--leise); }
.knopfreihe { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }

/* Formulare */
.formular { display: flex; flex-direction: column; gap: .5rem; }
.formular h1 { margin-bottom: .25rem; }
.formular p { margin: 0 0 .5rem; }
label { font-weight: 600; margin-top: .5rem; }
input[type="text"], input[type="password"], input:not([type]) {
  font: inherit; font-size: 1rem; width: 100%; min-height: 44px; padding: .55rem .75rem;
  color: var(--text); background: var(--bg); border: 1px solid var(--rand-farbe); border-radius: 8px;
}
input:focus-visible { outline: 2px solid var(--akzent); outline-offset: 1px; }
button, .knopf-link {
  font: inherit; min-height: 44px; padding: .55rem 1rem; border: 1px solid transparent; border-radius: 8px; cursor: pointer;
  background: var(--akzent-flaeche); color: var(--auf-akzent); text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
.formular > button { align-self: flex-start; margin-top: .5rem; }
button.leise { background: transparent; color: var(--akzent); border-color: var(--rand-farbe); }
button:disabled { opacity: .55; cursor: not-allowed; }
button:focus-visible, .knopf-link:focus-visible, a:focus-visible, input[type="checkbox"]:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
a { color: var(--akzent); }

.meldung { margin: .25rem 0; padding: .5rem .75rem; border-radius: 8px; }
.meldung--fehler { color: var(--fehler); background: color-mix(in srgb, var(--fehler) 12%, transparent); }
.meldung--ok { color: var(--plus); background: color-mix(in srgb, var(--plus) 12%, transparent); }

.pruefliste { list-style: none; margin: .25rem 0; padding: 0; font-size: .9rem; }
.pruefliste li { padding-left: 1.4rem; position: relative; }
.pruefliste li::before { position: absolute; left: 0; }
.pruefliste li.ok { color: var(--plus); } .pruefliste li.ok::before { content: "✓"; }
.pruefliste li.nein { color: var(--fehler); } .pruefliste li.nein::before { content: "✗"; }
.pruefliste li.info { color: var(--leise); } .pruefliste li.info::before { content: "i"; font-weight: 700; padding-left: .3rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.schluessel { font-family: ui-monospace, Consolas, monospace; font-size: 1.15rem; letter-spacing: .05em; overflow-wrap: anywhere;
  background: var(--bg); border: 1px dashed var(--rand-farbe); border-radius: 8px; padding: .75rem; }
.codes { font-family: ui-monospace, Consolas, monospace; font-size: 1.1rem; columns: 2; margin: 0 0 .5rem; }
.haken { display: flex; align-items: center; gap: .6rem; }
.haken input { width: 22px; height: 22px; }
.haken label { margin: 0; font-weight: 400; }

/* Zustände (auch von boot.js benutzt) */
.zustand, .state { display: grid; place-items: center; gap: .75rem; min-height: 40vh; text-align: center; color: var(--leise); }
.zustand--fehler, .state--error { color: var(--fehler); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--rand-farbe); border-top-color: var(--akzent); border-radius: 50%; animation: drehen .8s linear infinite; }
@keyframes drehen { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } html { scroll-behavior: auto; } }

/* ===================== Ausbau: Übersicht, Wert, Depot, Nachrichten, Auswertung ===================== */
.klein { font-size: .875rem; }
.leise { color: var(--leise); }
.leer { color: var(--leise); margin: .25rem 0; }
.gross { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
h3 { font-size: 1.05rem; margin: 1rem 0 .5rem; }
h4 { font-size: .95rem; margin: .9rem 0 .35rem; color: var(--leise); }
.abschnitt-titel { margin-top: .5rem; }
.gruppe h3 { color: var(--leise); font-weight: 600; margin-top: 0; }

/* Zwei Spalten auf breiten Bildschirmen */
.spalten { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; align-items: start; }
.spalten--breit-schmal { grid-template-columns: 2fr 1fr; }
.spalten > * { min-width: 0; }
@media (max-width: 1023px) { .spalten, .spalten--breit-schmal { grid-template-columns: 1fr; } }

/* Kennzahl-Kacheln */
.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.kachel { background: var(--flaeche); border: 1px solid var(--rand-farbe); border-radius: var(--radius); padding: .9rem 1.1rem; }
.kachel p { margin: 0; }
.kachel-titel { color: var(--leise); font-size: .875rem; }
.kachel-wert { font-size: 1.45rem; font-weight: 700; font-variant-numeric: tabular-nums; margin: .15rem 0; }
.kachel-unter { color: var(--leise); font-size: .8rem; }

/* Gewinn, Verlust, Richtung: Farbe plus Zeichen */
.gv { font-variant-numeric: tabular-nums; white-space: nowrap; }
.gv--plus { color: var(--plus); } .gv--minus { color: var(--minus); } .gv--null { color: var(--leise); }
.richtung { display: inline-block; font-weight: 600; white-space: nowrap; }
.richtung small { font-weight: 400; color: var(--leise); }
.richtung--positiv { color: var(--plus); } .richtung--negativ { color: var(--minus); } .richtung--neutral { color: var(--leise); }
.warnung { color: var(--warnung); }

/* Listen der Übersicht */
.mini-positionen, .fazits, .nachrichten, .termine, .positionen, .buchungen, .verlauf, .quellen { list-style: none; margin: 0; padding: 0; }
.mini-positionen li, .termine li, .quellen li { padding: .4rem 0; border-top: 1px solid var(--rand-farbe); }
.mini-positionen li:first-child, .termine li:first-child, .quellen li:first-child { border-top: 0; }
.fazit { border-top: 1px solid var(--rand-farbe); }
.fazit:first-child { border-top: 0; }
.fazit summary { display: flex; flex-wrap: wrap; gap: .2rem .6rem; align-items: baseline; padding: .55rem 0; cursor: pointer; min-height: 44px; }
.fazit-satz { flex-basis: 100%; }
.fazit-mehr { padding: 0 0 .6rem; }
.fazit-mehr p { margin: .2rem 0; }

.nachricht { padding: .65rem 0; border-top: 1px solid var(--rand-farbe); }
.nachricht:first-child { border-top: 0; }
.nachricht-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; margin-bottom: .2rem; }
.nachricht-kopf small { color: var(--leise); }
.nachricht-titel { display: block; margin: 0; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
a.nachricht-titel:hover { color: var(--akzent); }
.nachricht p { margin: .15rem 0 0; }
.chip { display: inline-block; padding: .05rem .5rem; border-radius: 999px; background: var(--flaeche-2); font-size: .8rem; font-weight: 600; }
.chip a { text-decoration: none; }
.relevanz { font-size: .75rem; font-weight: 700; padding: .05rem .45rem; border-radius: 4px; border: 1px solid var(--rand-farbe); color: var(--leise); }
.relevanz--hoch { color: var(--warnung); border-color: color-mix(in srgb, var(--warnung) 50%, transparent); }
.relevanz--mittel { color: var(--text); }
.termine li { display: grid; grid-template-columns: 9.5rem 1fr auto; gap: .5rem; align-items: baseline; }
.termin-datum { font-variant-numeric: tabular-nums; color: var(--leise); }
@media (max-width: 600px) { .termine li { grid-template-columns: 1fr; gap: 0; } }

/* Wert-Seite */
.wert-kopf-kurs { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem .8rem; margin: -.25rem 0 1rem; }
.zeitraeume { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; }
.zeitraeume button { min-width: 3.5rem; }
.zeitraeume button[aria-pressed="true"] { background: var(--akzent-flaeche); color: var(--auf-akzent); border-color: transparent; }
.kennzahlen { margin: 0; padding-left: 0; list-style: none; }
.kennzahlen li { padding: .35rem 0; border-top: 1px solid var(--rand-farbe); }
.kennzahlen li:first-child { border-top: 0; }
.ki-status { color: var(--akzent); margin: .25rem 0; }
.ki-status:empty { display: none; }
.analyse p { margin: .3rem 0; }
.fazit-gross { font-size: 1.15rem; font-weight: 600; }
.horizonte { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin: .75rem 0; }
.horizont { background: var(--flaeche-2); border-radius: 8px; padding: .6rem .8rem; }
.horizont p { margin: .2rem 0; }
@media (max-width: 767px) { .horizonte { grid-template-columns: 1fr; } }
.belege, .kette, .szenarien { margin: 0; padding-left: 1.2rem; }
.belege li, .kette li { margin: .2rem 0; }
.szenarien li { margin: .5rem 0; }
.pruefhinweis { border-left: 3px solid var(--warnung); padding-left: .75rem; margin-top: .75rem; }
.frage, .antwort { background: var(--flaeche-2); border-radius: 8px; padding: .5rem .75rem; }
.verlauf li { border-top: 1px solid var(--rand-farbe); padding: .4rem 0; }
.verlauf summary { cursor: pointer; min-height: 44px; display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }

/* Formulare des Ausbaus */
textarea, select, input[inputmode="decimal"] {
  font: inherit; font-size: 1rem; width: 100%; min-height: 44px; padding: .55rem .75rem;
  color: var(--text); background: var(--bg); border: 1px solid var(--rand-farbe); border-radius: 8px;
}
textarea { resize: vertical; }
textarea:focus-visible, select:focus-visible, summary:focus-visible, [tabindex="0"]:focus-visible { outline: 2px solid var(--akzent); outline-offset: 1px; }
input.kurz { width: 6rem; display: inline-block; }
.kauf { display: flex; flex-direction: column; gap: .4rem; }
.kauf > button { align-self: flex-start; margin-top: .4rem; }
.vorschau { background: var(--flaeche-2); border: 1px solid var(--rand-farbe); border-radius: var(--radius); padding: .75rem 1rem; margin-top: .75rem; }
.vorschau h3 { margin-top: 0; }
.warnungen { list-style: none; margin: .75rem 0; padding: .5rem .75rem; border-left: 3px solid var(--warnung); background: color-mix(in srgb, var(--warnung) 8%, transparent); }
.warnungen li { margin: .2rem 0; }
.warnungen strong { color: var(--warnung); }
.filter { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-bottom: 1rem; }
.filter label { margin: 0; }
.filter select { width: auto; min-width: 10rem; }
.neu-wert { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .25rem 1rem; align-items: end; }
.neu-wert label { margin-top: .25rem; }
.neu-wert button { grid-column: 1 / -1; justify-self: start; margin-top: .5rem; }
.neu-wert .meldung { grid-column: 1 / -1; }

/* Positionen */
.position { border-top: 1px solid var(--rand-farbe); padding: .8rem 0; }
.position:first-child { border-top: 0; }
.position-kopf { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .8rem; }
.position-zahlen { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: .4rem 1rem; margin: .5rem 0; }
.position-zahlen dt { color: var(--leise); font-size: .8rem; }
.position-zahlen dd { margin: 0; font-variant-numeric: tabular-nums; }
.position .knopfreihe { margin: 0; }
.buchungen li { border-top: 1px solid var(--rand-farbe); padding: .6rem 0; }
.buchungen li:first-child { border-top: 0; }
.buchungen p { margin: .2rem 0; }

/* Tabellen */
.tab { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tab th { text-align: left; font-size: .8rem; color: var(--leise); font-weight: 600; padding: .4rem .5rem; border-bottom: 1px solid var(--rand-farbe); }
.tab td { padding: .45rem .5rem; border-bottom: 1px solid var(--rand-farbe); vertical-align: middle; }
.tab td.ohne-umbruch { white-space: nowrap; }
.tab tr.inaktiv td { color: var(--leise); }
.tab-huelle, #ausw-horizonte, #ausw-liste, #depot-geschlossen, #watchlist-pflege { overflow-x: auto; }

/* Diagramme (Skill dataviz) */
.diagramm { margin: 0; position: relative; }
.laedt { opacity: .55; transition: opacity .2s; }
.diagramm-flaeche { width: 100%; min-height: 300px; position: relative; }
.diagramm-svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.diagramm-svg .raster { stroke: var(--rand-farbe); stroke-width: 1; }
.diagramm-svg .achse { fill: var(--leise); font-size: 12px; font-variant-numeric: tabular-nums; }
.diagramm-svg .linie { fill: none; stroke: var(--reihe-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.diagramm-svg .marke-punkt { fill: var(--reihe-2); stroke: var(--flaeche); stroke-width: 2; }
.diagramm-svg .einstieg-linie { stroke: var(--reihe-2); stroke-width: 1; stroke-dasharray: 5 4; opacity: .8; }
.diagramm-svg .marke-stiel { stroke: var(--reihe-2); stroke-width: 1.5; }
.diagramm-svg .marke-schild { fill: var(--reihe-2); }
.diagramm-svg .marke-text { fill: var(--auf-reihe); font-size: 12px; font-weight: 700; }
.diagramm-svg .kreuz { stroke: var(--leise); stroke-width: 1; }
.diagramm-svg .kreuz-punkt { fill: var(--reihe-1); stroke: var(--flaeche); stroke-width: 2; }
.diagramm-tip { position: absolute; top: 2.2rem; transform: translateX(-50%); pointer-events: none; background: var(--bg); border: 1px solid var(--rand-farbe);
  border-radius: 6px; padding: .3rem .6rem; display: flex; flex-direction: column; font-size: .85rem; }
.diagramm-tip strong { font-size: 1rem; font-variant-numeric: tabular-nums; }
.diagramm-tip span { color: var(--leise); }
.legende { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; font-size: .85rem; color: var(--leise); margin-bottom: .4rem; }
.legende > span { display: inline-flex; align-items: center; gap: .4rem; }
.legende-linie { width: 18px; height: 2px; background: var(--reihe-1); }
.legende-punkt { width: 10px; height: 10px; border-radius: 50%; background: var(--reihe-2); }
.diagramm-tabelle { margin-top: .5rem; }
.diagramm-tabelle summary { cursor: pointer; color: var(--akzent); min-height: 44px; display: flex; align-items: center; }
.diagramm-tabelle table { border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .875rem; max-height: 20rem; overflow-y: auto; display: block; }
.diagramm-tabelle td, .diagramm-tabelle th { padding: .2rem 1rem .2rem 0; text-align: left; }

.balken-liste { display: flex; flex-direction: column; gap: .5rem; }
.balken-zeile { display: grid; grid-template-columns: 4.5rem 1fr minmax(6rem, auto); gap: .6rem; align-items: center; border-radius: 6px; }
.balken-zeile:hover .balken-wert, .balken-zeile:focus-visible .balken-wert { filter: brightness(1.2); }
.balken-name { font-weight: 600; }
.balken-spur { position: relative; height: 14px; }
.balken-wert { height: 100%; background: var(--reihe-1); border-radius: 0 4px 4px 0; }
.balken-wert--ueber { background: repeating-linear-gradient(135deg, var(--reihe-1) 0 6px, color-mix(in srgb, var(--reihe-1) 55%, var(--flaeche)) 6px 9px); }
.balken-grenze { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text); }
.balken-zahl { font-variant-numeric: tabular-nums; font-size: .875rem; }

/* Mittlerer Reiter am Handy hervorgehoben (Erstellen in der Mitte, D39) */
@media (max-width: 767px) {
  .nav a.nav-mitte svg { width: 26px; height: 26px; }
  .nav a { font-size: .7rem; padding: 0 .2rem; }
}

/* ---------- KI-Signal (ADR-022): Kaufen, Halten, Verkaufen ---------- */
.signal { display: inline-flex; align-items: baseline; gap: .3rem; font-weight: 700; padding: .1rem .55rem; border-radius: 6px; border: 1px solid currentColor; white-space: nowrap; }
.signal small { font-weight: 400; color: var(--leise); }
.signal--positiv { color: var(--plus); }
.signal--negativ { color: var(--minus); }
.signal--neutral { color: var(--text); }
.signal--keins { color: var(--leise); font-weight: 400; border-style: dashed; }
.signal--gross { font-size: 1.25rem; padding: .25rem .8rem; }
.wert-signal { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: .4rem 0 1rem; }
.signale { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: .75rem; margin: .75rem 0; }
.signal-feld { background: var(--flaeche-2); border-radius: 8px; padding: .7rem .9rem; border-left: 4px solid var(--leise); }
.signal-feld--positiv { border-left-color: var(--plus); }
.signal-feld--negativ { border-left-color: var(--minus); }
.signal-feld p { margin: .3rem 0; }
.zeitachse { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1rem 0; }
.zeitachse section { background: var(--flaeche-2); border-radius: 8px; padding: .8rem 1rem; }
.zeitachse h4 { margin: 0 0 .4rem; font-size: 1.05rem; }
.zeitachse p { margin: .3rem 0; }
.zeitachse .szenarien { margin-top: .6rem; }
.analyse-mehr { margin: 1rem 0; }
.analyse-mehr > summary { cursor: pointer; font-weight: 600; padding: .5rem 0; min-height: 44px; display: flex; align-items: center; }
.fazit-horizonte { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.hinweis-zeile { border-left: 4px solid var(--leise); padding-left: .7rem; }
@media (max-width: 900px) { .signale, .zeitachse { grid-template-columns: 1fr; } }
.empfehlung { flex-basis: 100%; font-weight: 600; }
.wert-signal .empfehlung { flex-basis: auto; }

/* ---------- Vereinfachung (ADR-025): Liste auf der Startseite, „Was tun?“ ---------- */
.tun { display: inline-flex; align-items: baseline; gap: .15rem; font-weight: 700; padding: .15rem .6rem; border-radius: 6px; border: 1px solid currentColor; white-space: nowrap; }
.tun--plus { color: var(--plus); } .tun--minus { color: var(--minus); } .tun--null { color: var(--text); }
.tun--keins { color: var(--leise); font-weight: 400; border-style: dashed; }
.tun--gross { font-size: 1.6rem; padding: .3rem 1rem; margin: .2rem 0; }
.start-liste { display: grid; margin: .5rem 0 1rem; }
.liste-zeile { display: grid; grid-template-columns: minmax(12rem, 2fr) minmax(9rem, 1.2fr) minmax(9rem, 1.2fr) minmax(8rem, 1fr); gap: .4rem 1rem; align-items: center;
  padding: .7rem .5rem; border-bottom: 1px solid var(--rand-farbe); color: var(--text); text-decoration: none; min-height: 56px; }
a.liste-zeile:hover { background: var(--flaeche-2); }
a.liste-zeile:focus-visible { outline: 2px solid var(--text); outline-offset: -2px; }
.liste-kopf { color: var(--leise); font-size: .85rem; min-height: 0; padding-top: 0; }
.lz-name { display: flex; flex-direction: column; } .lz-name span { color: var(--leise); font-size: .9rem; }
.lz-kurs { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; } .lz-kurs small { font-size: .85rem; }
.lz-depot { font-variant-numeric: tabular-nums; }
.was-tun { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; }
.was-tun-text { flex: 1 1 24rem; } .was-tun-text p { margin: .2rem 0; } .was-tun .empfehlung { font-size: 1.1rem; font-weight: 600; }
.was-tun .knopfreihe button { min-width: 8rem; }
.knopf-zweit { background: transparent; border-color: var(--akzent); color: var(--akzent); }
details.mehr { padding: 0 1rem; } details.mehr > summary { cursor: pointer; font-weight: 600; min-height: 48px; display: flex; align-items: center; }
details.mehr[open] { padding-bottom: 1rem; }
@media (max-width: 700px) {
  .liste-kopf { display: none; }
  .liste-zeile { grid-template-columns: 1fr auto; }
  .lz-tun { grid-column: 1; } .lz-depot { grid-column: 2; text-align: right; }
}

/* Startliste: Kursalter je Wert (Codex-Prüfung, Vorlage A) */
.lz-stand { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; color: var(--leise); }
.lz-stand .marke-status { font-size: .72rem; padding: .05rem .4rem; }

/* Belegqualität (ADR-028) und Auswertung 1 neben 2 */
.beleg { display: inline-block; font-size: .8rem; font-weight: 600; padding: .05rem .5rem; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.beleg--hoch { color: var(--plus); }
.beleg--mittel { color: var(--akzent); }
.beleg--niedrig { color: var(--warnung); }
.beleg--keine { color: var(--leise); }
.beleg--abweichung { color: var(--akzent); border-style: dashed; }
.beleg-zeile { margin: .4rem 0 0; }
.tun--leer { color: var(--leise); }
.auswertung-paar { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 1280px) { .auswertung-paar { grid-template-columns: 1fr 1fr; align-items: start; } }
.auswertung-paar .karte { min-width: 0; }
/* Wahl der Darstellung im Profil */
.thema-wahl { display: flex; flex-wrap: wrap; gap: .5rem; }
.thema-wahl button[aria-pressed="true"] { background: var(--akzent-flaeche); color: var(--auf-akzent); border-color: var(--akzent-flaeche); }
