:root {
  --bg: #0b0a08; --karte: #16140f; --rand: #2a261d; --text: #f1ebdd; --leise: #b3a98f;
  --gold: #e9b949; --rot: #ef5350; --gruen: #3fbf7f; --blau: #4fc3f7;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { padding: env(safe-area-inset-top) env(safe-area-inset-right) calc(env(safe-area-inset-bottom) + 84px) env(safe-area-inset-left); }
.kopf { position: sticky; top: 0; z-index: 5; background: rgba(11,10,8,.96); border-bottom: 1px solid var(--rand);
  padding: 10px 14px 8px; backdrop-filter: blur(8px); }
.marke { font-weight: 800; letter-spacing: .08em; color: var(--gold); font-size: 15px; text-transform: uppercase; }
.coins { display: flex; gap: 6px; margin: 8px 0; overflow-x: auto; }
.coins button, .schalter button { min-height: 40px; min-width: 52px; padding: 6px 12px; border-radius: 20px;
  border: 1px solid var(--rand); background: transparent; color: var(--leise); font-size: 15px; font-weight: 600; }
.coins button.an, .schalter button.an { border-color: var(--gold); color: var(--gold); background: #2a2210; }
.preiszeile { display: flex; justify-content: space-between; align-items: baseline; }
#preis { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
main { padding: 12px; display: grid; gap: 12px; max-width: 900px; margin: 0 auto; }
.karte { min-width: 0; background: var(--karte); border: 1px solid var(--rand); border-radius: 14px; padding: 14px; }
h2 { margin: 0 0 8px; font-size: 17px; }
.titelzeile { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.schalter { display: flex; gap: 4px; }
.leise { color: var(--leise); }
.klein { font-size: 13px; margin: 0 0 10px; }
.zeile { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--rand); }
.zeile:last-child { border-bottom: 0; }
.zahl { font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; white-space: nowrap; }
.plus { color: var(--gruen); } .minus { color: var(--rot); } .gold { color: var(--gold); }
.gross { font-size: 22px; font-weight: 800; }
.balken { height: 10px; border-radius: 5px; background: var(--rot); overflow: hidden; margin: 4px 0 2px; }
.balken > i { display: block; height: 100%; background: var(--gruen); }
.warnung { background: #3a1414; border: 1px solid #7a2a2a; border-radius: 10px; padding: 10px; margin: 8px 0; }
.fehlerkarte { border-color: #7a2a2a; background: #2a1212; }
.fehler { color: var(--rot); }
.raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.kachel { border: 1px solid var(--rand); border-radius: 10px; padding: 10px; }
.kachel .t { color: var(--leise); font-size: 13px; }
.pos { border: 1px solid var(--rand); border-radius: 10px; padding: 10px; margin: 8px 0; }
.pos .kopfzeile { display: flex; justify-content: space-between; font-weight: 700; }
.szen { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; text-align: center; font-size: 13px; }
.szen div { border: 1px solid var(--rand); border-radius: 8px; padding: 6px 0; min-width: 0; }
.szen b { display: block; font-size: 15px; white-space: nowrap; }
.szen span { display: block; white-space: nowrap; }
details summary { cursor: pointer; color: var(--gold); padding: 8px 0; min-height: 40px; }
input { width: 100%; min-height: 44px; font-size: 16px; padding: 8px 12px; border-radius: 10px;
  border: 1px solid var(--rand); background: #0f0e0b; color: var(--text); margin: 6px 0; }
button.haupt { min-height: 44px; width: 100%; border: 0; border-radius: 10px; background: var(--gold); color: #1a1405;
  font-weight: 800; font-size: 16px; }
svg { width: 100%; height: auto; display: block; }
.seite { display: grid; gap: 12px; }
.seite[hidden] { display: none; }
.quer { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.unten { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; justify-content: space-around;
  background: rgba(11,10,8,.97); border-top: 1px solid var(--rand); padding: 6px 0 calc(env(safe-area-inset-bottom) + 6px); }
.unten button { flex: 1; min-height: 52px; background: none; border: 0; color: var(--leise); font-size: 13px; font-weight: 600;
  display: flex; flex-direction: column; align-items: center; gap: 2px; }
.unten button span { font-size: 20px; line-height: 1; }
.unten button.an { color: var(--gold); }
table.delta { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 14px; font-variant-numeric: tabular-nums; }
table.delta th { color: var(--leise); font-weight: 600; text-align: right; padding: 6px 6px; border-bottom: 1px solid var(--rand); font-size: 13px; }
table.delta td { text-align: right; padding: 7px 6px; border-bottom: 1px solid var(--rand); white-space: nowrap; }
table.delta th:first-child, table.delta td:first-child { text-align: left; position: sticky; left: 0; background: var(--karte); }

/* Interaktive Diagramme */
.rr-chart-svg { touch-action: pan-y; cursor: crosshair; -webkit-user-select: none; user-select: none; }
#rr-tipp { position: fixed; z-index: 50; pointer-events: none; background: rgba(22,20,15,.97); border: 1px solid #5a5242;
  border-radius: 10px; padding: 8px 10px; font-size: 14px; line-height: 1.45; color: var(--text); box-shadow: 0 6px 20px rgba(0,0,0,.5);
  max-width: min(320px, calc(100vw - 16px)); font-variant-numeric: tabular-nums; }
#rr-tipp .rr-tipp-kopf { color: var(--gold); font-weight: 700; margin-bottom: 2px; }
#rr-tipp i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
[data-tip] { cursor: pointer; }
#rr-tipp .rr-tipp-neben { color: var(--leise); padding-left: 16px; }

/* Breite Seiten: Teile mit data-breit (z. B. Liquidationskarte) nutzen am Rechner die volle Fensterbreite */
main:has(.seite:not([hidden]) [data-breit]) { max-width: min(1800px, 100%); }

/* ===== Navigation wie Trading-App: Handy unten 5 Reiter, Rechner Topbar ===== */
.kopf { padding: 8px 12px 0; }
.kopf-oben { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.marke { display: flex; align-items: center; gap: 8px; }
.marke img { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--gold); }
.marke span { display: none; }
.reiter-oben { display: none; }
.coin-knopf { min-height: 40px; padding: 6px 14px; border-radius: 22px; border: 1.5px solid var(--gold); background: #2a2210;
  color: var(--gold); font-weight: 800; font-size: 15px; }
.preiszeile { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
#preis { font-size: 18px; }
#stand { font-size: 13px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chips[hidden] { display: none; }
.chips button { flex: 0 0 auto; min-height: 40px; padding: 6px 14px; border-radius: 20px; border: 1px solid var(--rand);
  background: #13110d; color: var(--leise); font-size: 15px; font-weight: 600; white-space: nowrap; }
.chips button.an { border-color: var(--gold); color: var(--gold); background: #2a2210; }
.coin-wahl { position: absolute; left: 12px; top: 56px; z-index: 20; background: var(--karte); border: 1px solid var(--rand);
  border-radius: 14px; padding: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.6); }
.coin-wahl[hidden] { display: none; }
.coin-wahl .coins { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.coin-wahl .coins button { min-width: 72px; }
.unten button svg { width: 24px; height: 24px; }
.unten button span { font-size: 13px; line-height: 1.1; }
.unten button { gap: 3px; }

@media (min-width: 900px) {
  .unten { display: none; }
  body { padding-bottom: calc(env(safe-area-inset-bottom) + 16px); }
  .marke span { display: inline; font-weight: 800; letter-spacing: .08em; color: var(--gold); font-size: 15px; text-transform: uppercase; }
  .reiter-oben { display: flex; gap: 4px; margin-left: 12px; }
  .reiter-oben button { min-height: 42px; padding: 6px 16px; background: none; border: 0; border-bottom: 2px solid transparent;
    color: var(--leise); font-size: 15px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
  .reiter-oben button.an { color: var(--gold); border-bottom-color: var(--gold); }
  .reiter-oben button:hover { color: var(--text); }
  .kopf-oben { min-height: 52px; }
  #preis { font-size: 20px; }
}

/* Unterseiten: nur das aktive Modul */
.seite > .aus { display: none !important; }
.chip-fav { color: var(--gold) !important; }
.chip-werkzeug { display: flex; gap: 6px; margin-left: auto; padding-left: 8px; position: sticky; right: 0; background: linear-gradient(90deg, rgba(11,10,8,0), #0b0a08 18%); }
.chip-werkzeug button { min-width: 44px; padding: 6px 10px !important; font-size: 18px !important; }
.chip-werkzeug button.an { color: var(--gold); }
/* Vollbild eines Moduls */
.modul-vollbild { position: fixed !important; inset: 0; z-index: 40; margin: 0 !important; border-radius: 0 !important; overflow: auto;
  padding: calc(env(safe-area-inset-top) + 10px) 14px calc(env(safe-area-inset-bottom) + 14px) !important; display: block !important; }
body.hat-vollbild { overflow: hidden; }
.vollbild-zu { position: fixed; top: calc(env(safe-area-inset-top) + 8px); right: 12px; z-index: 41; min-height: 44px; padding: 8px 14px; border-radius: 10px;
  border: 1px solid var(--gold); background: #2a2210; color: var(--gold); font-weight: 700; font-size: 15px; }
@media (min-width: 900px) { main { max-width: min(1400px, 100%); } }

/* ===== Gemeinsame Modul-Bausteine (Anordnung wie Vorbild) ===== */
.modul-titel { font-size: 24px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); margin: 0; }
.modul-kopf { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.modul-unterzeile { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--leise); margin: 2px 0 10px; }
.erkl-knopf { min-height: 40px; padding: 6px 14px; border-radius: 20px; border: 1px solid #5a4020; background: transparent;
  color: var(--text); font-size: 14px; }
.erkl { border-left: 3px solid var(--gold); background: #1b1812; border-radius: 8px; padding: 10px 12px; margin: 8px 0; color: var(--leise); }
.modul-satz { border-left: 4px solid #e98a28; background: #17140f; border-radius: 6px; padding: 10px 14px; margin: 10px 0; font-size: 16px; }
.segment { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--rand); border-radius: 12px; overflow: hidden; margin: 8px 0; }
.segment button { min-height: 42px; padding: 8px 14px; background: #13110d; border: 0; border-right: 1px solid var(--rand);
  color: var(--leise); font-size: 15px; font-weight: 600; }
.segment button:last-child { border-right: 0; }
.segment button.an { background: #3a2412; color: var(--gold); box-shadow: inset 0 -2px 0 #e98a28; }
.legende { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 6px 0; font-size: 14px; color: var(--text); }
.legende i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
