:root {
  --bg: #0d1117;
  --panel: #151b23;
  --panel-2: #1b222c;
  --line: #262f3b;
  --text: #e6edf3;
  --muted: #8b97a6;
  --faint: #5b6675;
  --accent: #5aa9ff;
  --pos: #3fb97a;
  --neg: #f0645a;
  --warn: #e3a93b;
  --fan: rgba(90, 169, 255, 0.16);
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
html[data-theme="light"] {
    --bg: #f4f6f9; --panel: #ffffff; --panel-2: #f0f3f7; --line: #e1e6ed;
    --text: #12171d; --muted: #5d6874; --faint: #98a2ae; --accent: #1f6fd1;
    --pos: #188a52; --neg: #cf3b30; --warn: #b7791f; --fan: rgba(31, 111, 209, 0.12);
    color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; -webkit-text-size-adjust: 100%; }
body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.pos { color: var(--pos); } .neg { color: var(--neg); } .muted { color: var(--muted); } .faint { color: var(--faint); }

/* Kopf */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line); padding: calc(10px + env(safe-area-inset-top)) 16px 10px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; }
.logo { width: 28px; height: 28px; color: var(--accent); }
.brand h1 { font-size: 17px; }
.stamp { font-size: 12px; color: var(--muted); }
.tabs { display: none; gap: 4px; background: var(--panel); padding: 4px; border-radius: 10px; border: 1px solid var(--line); }
.tabs button { padding: 7px 14px; border-radius: 7px; color: var(--muted); font-size: 14px; }
.tabs button.active { background: var(--panel-2); color: var(--text); }
.banner { margin: 12px 16px 0; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); font-size: 13px; }

main { max-width: 1120px; margin: 0 auto; padding: 14px 16px 8px; }
.tab { display: none; } .tab.active { display: block; }
.foot { max-width: 1120px; margin: 8px auto 0; padding: 12px 16px 20px; font-size: 12px; color: var(--faint); }

/* Untere Navigation (mobil) */
.bottombar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--panel) 94%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.bottombar button { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: var(--faint); padding: 4px 0; }
.bottombar svg { width: 22px; height: 22px; fill: currentColor; }
.bottombar button.active { color: var(--accent); }
@media (min-width: 820px) {
  .tabs { display: flex; } .bottombar { display: none; } body { padding-bottom: 0; }
}

/* Karten & Raster */
.grid { display: grid; gap: 12px; }
.grid.two { align-items: start; }
@media (min-width: 820px) { .grid.two { grid-template-columns: 1.4fr 1fr; } .grid.three { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.card h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; margin-bottom: 12px; }
.card h2 .hint { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--faint); }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; margin: 22px 2px 10px; }

.hero .total { font-size: 34px; font-weight: 650; letter-spacing: -0.03em; }
.hero .sub { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 6px; font-size: 14px; color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 16px; margin-top: 14px; }
@media (min-width: 560px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi .l { font-size: 12px; color: var(--muted); } .kpi .v { font-size: 16px; font-weight: 600; margin-top: 2px; }

.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: var(--font); font-size: 11px; fill: var(--faint); }
.chart .lbl { font-size: 11px; font-weight: 600; paint-order: stroke; stroke: var(--panel); stroke-width: 4px; stroke-linejoin: round; }

/* Allokationsbalken */
.alloc { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--panel-2); }
.alloc span { display: block; height: 100%; }
.legend { display: grid; grid-template-columns: 1fr auto auto; gap: 6px 12px; margin-top: 12px; font-size: 13px; }
.legend .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }

/* Listen */
.list { display: flex; flex-direction: column; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); text-align: left; width: 100%; }
.row:last-child { border-bottom: 0; }
.row:hover { background: color-mix(in srgb, var(--panel-2) 60%, transparent); }
.row .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .s { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .r { text-align: right; }

.pill { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.lv0 { background: color-mix(in srgb, var(--pos) 15%, transparent); color: var(--pos); }
.lv1 { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.lv2 { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.lv3 { background: color-mix(in srgb, var(--neg) 18%, transparent); color: var(--neg); }
.tag { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 5px; background: var(--panel-2); color: var(--muted); margin-right: 4px; }
.tag.warn { color: var(--warn); }

.alert { display: flex; gap: 10px; padding: 11px 2px; border-bottom: 1px solid var(--line); text-align: left; width: 100%; }
.alert:last-child { border-bottom: 0; }
.alert .bar { width: 4px; border-radius: 2px; flex: none; }
.alert .t { font-weight: 600; font-size: 14px; } .alert .d { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* Krypto-Karten */
.coin-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.coin-head .px { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.stat .l { font-size: 11.5px; color: var(--muted); } .stat .v { font-size: 14px; font-weight: 600; margin-top: 1px; }
.ladder { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.ladder span { font-size: 12px; padding: 4px 8px; border-radius: 7px; background: var(--panel-2); color: var(--muted); }
.ladder span.hit { background: color-mix(in srgb, var(--pos) 18%, transparent); color: var(--pos); }
.signals { margin: 10px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.signals li { margin: 3px 0; }

.fc { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.fc th { text-align: left; font-weight: 500; color: var(--muted); padding: 6px 4px; border-bottom: 1px solid var(--line); }
.fc td { padding: 6px 4px; border-bottom: 1px solid var(--line); }
.fc td.n, .fc th.n { text-align: right; white-space: nowrap; }
.fc small { display: block; font-size: 11px; color: var(--faint); }

/* Screener */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; color: var(--muted); background: var(--panel); }
.chip.on { border-color: var(--accent); color: var(--accent); }
.score { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.score .b { width: 54px; height: 6px; border-radius: 3px; background: var(--panel-2); overflow: hidden; }
.score .b i { display: block; height: 100%; background: var(--accent); }
.score .v { font-weight: 650; width: 24px; text-align: right; }
.metrics { display: flex; gap: 10px; font-size: 12px; color: var(--muted); margin-top: 3px; flex-wrap: wrap; }
.explain { font-size: 13px; color: var(--muted); line-height: 1.5; }
.explain b { color: var(--text); font-weight: 600; }

/* Detail-Sheet */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); z-index: 40; }
.sheet { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; max-height: 92vh; overflow-y: auto; background: var(--panel);
  border-radius: 18px 18px 0 0; border-top: 1px solid var(--line); padding: 18px 16px calc(24px + env(safe-area-inset-bottom)); }
@media (min-width: 820px) { .sheet { left: 50%; right: auto; bottom: auto; top: 50%; transform: translate(-50%, -50%); width: 760px; border-radius: 18px; border: 1px solid var(--line); } }
.sheet-close { position: absolute; top: 10px; right: 12px; font-size: 26px; color: var(--muted); width: 36px; height: 36px; }
.sheet h3 { font-size: 20px; padding-right: 40px; }
.sheet .sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.sheet .block { margin-top: 18px; }
.sheet .block > .h { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.ind-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 560px) { .ind-grid { grid-template-columns: repeat(4, 1fr); } }
.empty { padding: 24px 4px; text-align: center; color: var(--muted); font-size: 14px; }
.status-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

.top-right { display: flex; align-items: center; gap: 10px; }
.theme-btn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 17px; }

/* Markt */
.strip { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
@media (min-width: 560px) { .strip { grid-template-columns: repeat(4, 1fr); } }
.strip .tile { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; text-align: left; }
.strip .tile .l { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip .tile .v { font-size: 16px; font-weight: 650; margin-top: 2px; }
.strip .tile .c { font-size: 12.5px; margin-top: 1px; }
.mkt { display: grid; grid-template-columns: minmax(0, 1fr) 70px 64px; gap: 4px 12px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.mkt:last-child { border-bottom: 0; }
.mkt .t { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mkt .s { font-size: 12px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.mkt .r { text-align: right; } .mkt .r .v { font-weight: 600; } .mkt .r .c { font-size: 12.5px; }
.spark { width: 70px; height: 28px; display: block; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }
.mood { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 560px) { .mood { grid-template-columns: repeat(3, 1fr); } }
.mood .m { background: var(--panel-2); border-radius: 12px; padding: 12px; }
.mood .m .l { font-size: 12px; color: var(--muted); } .mood .m .v { font-size: 18px; font-weight: 650; margin: 2px 0; } .mood .m .d { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.hbar { display: grid; grid-template-columns: 130px 1fr 44px; gap: 8px; align-items: center; font-size: 13px; padding: 4px 0; }
.hbar .b { height: 8px; background: var(--panel-2); border-radius: 4px; overflow: hidden; position: relative; }
.hbar .b i { position: absolute; top: 0; bottom: 0; }
.hbar .n { text-align: right; } .hbar .k { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.news a { display: block; padding: 11px 2px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.news a:last-child { border-bottom: 0; }
.news a:hover .t { color: var(--accent); }
.news .t { font-size: 14px; font-weight: 550; line-height: 1.35; }
.news .s { font-size: 12px; color: var(--muted); margin-top: 3px; }

.theme-btn { display: inline-flex; align-items: center; justify-content: center; }
.search { width: 100%; margin-top: 14px; padding: 12px 14px; font: inherit; font-size: 16px; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; outline: none; }
.search:focus { border-color: var(--accent); }
.sheet { min-height: 50vh; }

.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--pos); margin-right: 6px; vertical-align: 1px; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.stamp { cursor: pointer; }
