:root {
  --bg: #08090a;
  --bg-2: #0e1011;
  --panel: #121516;
  --panel-2: #171b1c;
  --line: #22282a;
  --line-2: #2c3336;
  --text: #e8eeec;
  --muted: #8a9592;
  --faint: #5b6461;
  --green: #34d399;
  --green-deep: #0f3d2e;
  --teal: #2dd4bf;
  --red: #f05565;
  --red-deep: #3a1419;
  --amber: #f5b53d;
  --violet: #9b87f5;
  --blue: #5b9dff;
  --pink: #ff4d8d;
  --radius: 14px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 600px at 70% -200px, #0d2a22 0%, transparent 60%), var(--bg);
  color: var(--text);
  font: 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "tnum" 1, "cv11" 1;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.up { color: var(--green); }
.down { color: var(--red); }

/* ---------- Kopfleiste ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: auto minmax(0, 520px) auto; justify-content: space-between; align-items: center; gap: 24px;
  padding: 14px 28px;
  background: rgba(8, 9, 10, .82); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand svg { width: 26px; height: 26px; color: var(--green); }
.brand em { font-style: normal; font-weight: 500; color: var(--muted); }
.search { position: relative; }
.search > svg { position: absolute; left: 14px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: var(--muted); }
.search input {
  width: 100%; height: 42px; padding: 0 16px 0 42px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px;
  color: var(--text); font: inherit; outline: none;
}
.search input:focus { border-color: #2f5f50; box-shadow: 0 0 0 3px rgba(52, 211, 153, .12); }
.search-results {
  position: absolute; top: 48px; left: 0; right: 0; max-height: 420px; overflow: auto;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 6px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .6);
}
.search-results a { display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; }
.search-results a:hover, .search-results a.active { background: #1f2527; }
.search-results .empty { padding: 12px; color: var(--muted); }
.status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.status.live .dot { background: var(--green); box-shadow: 0 0 0 4px rgba(52, 211, 153, .15); }
.status.stale .dot { background: var(--amber); }

main { max-width: 1440px; margin: 0 auto; padding: 22px 28px 60px; }

/* ---------- Karten ---------- */
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .018), transparent 40%), var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px;
}
.card h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.card h3 { margin: 0 0 12px; font-size: 13px; font-weight: 500; color: var(--muted); }
.card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head .spacer { flex: 1; }
.info { display: inline-grid; place-items: center; width: 15px; height: 15px; margin-left: 4px; border: 1px solid var(--faint); border-radius: 50%; font-size: 10px; color: var(--muted); cursor: help; vertical-align: 1px; }

/* ---------- KPI-Reihe ---------- */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { min-height: 128px; display: flex; flex-direction: column; }
.kpi .kpi-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.kpi .kpi-label { color: var(--text); font-size: 13px; font-weight: 500; }
.kpi .kpi-value { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.kpi .kpi-delta { font-size: 12px; margin-right: 6px; }
.kpi .kpi-sub { color: var(--faint); font-size: 11px; display: flex; justify-content: space-between; }
.kpi svg.spark { flex: 1; width: 100%; min-height: 50px; margin: 6px 0 2px; }
.kpi.center { align-items: center; }
.gauge-num { font-size: 26px; font-weight: 700; }
.bar-legend { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; }
.stackbar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--line); margin-top: 10px; }
.stackbar span { display: block; height: 100%; }

/* ---------- Segmente / Chips ---------- */
.seg { display: inline-flex; padding: 3px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 7px; color: var(--muted); cursor: pointer; font-size: 13px; }
.seg button.on { background: #22282a; color: var(--text); }
.seg button:hover:not(.on) { color: var(--text); }
select.select {
  appearance: none; background: var(--bg-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238a9592' fill='none' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 10px center / 10px;
  border: 1px solid var(--line); border-radius: 10px; color: var(--text); padding: 7px 30px 7px 12px; font: inherit; font-size: 13px; cursor: pointer;
}
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px;
  font-size: 11.5px; font-weight: 500; line-height: 18px; white-space: nowrap;
  background: #1c2224; border: 1px solid var(--line-2); color: var(--muted);
}
.chip.pass { color: var(--green); border-color: #1f4a3b; background: #0e1f19; }
.chip.fail { color: var(--red); border-color: #5a2029; background: #1f0f12; }
.chip.unknown { color: var(--muted); }
.chip.stage-candidate { color: var(--muted); }
.chip.stage-watch { color: var(--amber); border-color: #4d3a14; background: #1d1709; }
.chip.stage-alert { color: var(--pink); border-color: #5a1d36; background: #200c15; }
.chip.stage-confirmed { color: var(--green); border-color: #1f4a3b; background: #0e1f19; }
.chip.stage-closed { color: var(--faint); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Signal-Karte ---------- */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 12px; }
.map-wrap { position: relative; }
/* Die Liste richtet sich nach der Höhe der Karte und scrollt. */
.top-card { position: relative; min-height: 360px; }
.top-card .list { position: absolute; inset: 58px 12px 12px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #2c3336 transparent; }
.map-wrap svg { display: block; width: 100%; height: auto; }
.map-bubble { cursor: pointer; transition: transform .15s; transform-box: fill-box; transform-origin: center; }
.map-bubble:hover { transform: scale(1.12); }
.map-dot { cursor: pointer; }
.map-dot:hover { fill: #cfd8d5; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }

/* ---------- Tabellen ---------- */
.list { display: flex; flex-direction: column; }
.list-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 6px; border-radius: 10px; }
.list-row:hover { background: #1a1f21; }
.list-row .t1 { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .t2 { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .score { text-align: right; font-weight: 700; font-size: 15px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; letter-spacing: -.02em; color: #06110d; flex: none;
}
.avatar.lg { width: 40px; height: 40px; font-size: 13px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.tbl td { padding: 8px 10px; border-bottom: 1px solid #1a1f21; vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl td.num, table.tbl th.num { text-align: right; }
table.tbl tbody tr.link { cursor: pointer; }
table.tbl tbody tr.link:hover td { background: #171c1d; }
.tbl-wrap { overflow-x: auto; }

.row2 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.hbar { display: grid; grid-template-columns: 90px 1fr 44px; gap: 10px; align-items: center; margin: 7px 0; font-size: 13px; }
.hbar .track { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 99px; }
.hbar .v { text-align: right; color: var(--muted); }

/* ---------- Detail ---------- */
.detail-head { display: flex; align-items: center; gap: 14px; margin: 4px 0 6px; }
.back { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); cursor: pointer; }
.back:hover { border-color: var(--line-2); }
.detail-head .title { font-size: 18px; font-weight: 600; }
.tabs { display: flex; gap: 30px; border-bottom: 1px solid var(--line); margin: 10px 0 20px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 12px 0; font-size: 15px; font-weight: 500; color: var(--muted); cursor: pointer; position: relative; white-space: nowrap; }
.tabs button.on { color: var(--text); }
.tabs button.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; border-radius: 3px; background: var(--pink); }
.detail-wrap { max-width: 1200px; margin: 0 auto; }
.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; padding: 22px; }
.hero-left .name-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hero-left .name { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.hero-left .sym { font-size: 18px; color: var(--muted); }
.price-row { display: flex; align-items: center; gap: 14px; margin: 14px 0 12px; }
.price-row .price { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.link-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.pill-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 99px; font-size: 13px; color: var(--text); cursor: pointer; background: transparent; }
.pill-link:hover { border-color: #3d4649; background: #161a1b; }
.desc { color: #b9c3c0; font-size: 13.5px; margin: 0 0 16px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.stat .k { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.stat .v { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.stat .v .tag { font-size: 11px; font-weight: 500; padding: 1px 6px; background: #1f2527; border-radius: 5px; color: var(--muted); }
.heat { background: linear-gradient(160deg, #10201b 0%, #121516 55%); border: 1px solid var(--line); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; }
.heat-top { display: grid; grid-template-columns: 1fr 200px; gap: 12px; }
.heat .pattern { font-size: 24px; font-weight: 700; color: var(--pink); letter-spacing: -.01em; margin: 0 0 12px; }
.heat .pattern.ok { color: var(--green); }
.heat .pattern.warn { color: var(--amber); }
.heat .blurb { color: #c3ccc9; font-size: 13.5px; margin: 12px 0 0; }
.core { margin-top: 14px; }
.core-row { display: grid; grid-template-columns: 158px 34px 1fr; gap: 10px; align-items: center; padding: 6px 0; }
.core-row .lbl { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.core-row .lbl::before { content: ""; width: 3px; height: 16px; border-radius: 2px; background: var(--c, var(--muted)); }
.core-row .val { font-weight: 700; color: var(--c); }
.outlook { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 16px; padding: 16px; border-color: #4a2332; }
.outlook .steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 18px 0 8px; }
.outlook .steps span { height: 8px; border-radius: 99px; background: #2a3033; }
.outlook .steps span.on { background: var(--green); }
.outlook .steps span.cur { background: var(--pink); }
.outlook .step-lbl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; font-size: 12.5px; color: var(--muted); }
.outlook .step-lbl .cur { color: var(--pink); font-weight: 600; }
.why { border-radius: 10px; padding: 12px 14px; font-size: 13.5px; }
.why.pro { background: #0f1917; }
.why.con { background: #1a0f12; }
.why h4 { margin: 0 0 8px; font-size: 13.5px; font-weight: 500; }
.why.pro h4 { color: var(--teal); }
.why.con h4 { color: var(--red); }
.why ul { margin: 0; padding-left: 16px; }
.why li { margin: 4px 0; }
.why.pro li::marker { color: var(--teal); }
.why.con li::marker { color: var(--red); }
.chart-card { margin-top: 16px; padding: 18px 20px; }
.chart-card .chart-title { display: flex; align-items: center; gap: 12px; font-size: 17px; font-weight: 600; }
.chart-card .chart-title .sep { width: 1px; height: 18px; background: var(--line-2); }
.chart-meta { display: flex; align-items: center; gap: 12px; margin: 10px 0 4px; flex-wrap: wrap; }
.chart-meta .price { font-size: 24px; font-weight: 700; }
.chart-meta .spacer { flex: 1; }
.ranges { display: flex; gap: 4px; }
.ranges button { background: none; border: 0; padding: 5px 9px; border-radius: 7px; font-size: 13px; color: var(--muted); cursor: pointer; }
.ranges button.on { background: #22282a; color: var(--text); }
.chart svg { display: block; width: 100%; height: auto; }
.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; font-size: 13.5px; }
.kv .k { color: var(--muted); }
.kv .v { text-align: right; font-weight: 500; overflow-wrap: anywhere; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 150px 110px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid #1a1f21; font-size: 13px; align-items: center; }
.timeline li:last-child { border-bottom: 0; }
.label-card .big { font-size: 24px; font-weight: 700; margin: 4px 0; }

.loading, .error-box { padding: 60px 20px; text-align: center; color: var(--muted); }
.error-box { color: var(--red); }
.skeleton { background: linear-gradient(90deg, #15191a 0%, #1c2123 50%, #15191a 100%); background-size: 200% 100%; animation: sk 1.4s infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }

.tooltip {
  position: fixed; z-index: 50; pointer-events: none;
  background: rgba(24, 29, 30, .97); border: 1px solid var(--line-2); border-radius: 10px;
  padding: 10px 12px; font-size: 12.5px; box-shadow: 0 12px 30px rgba(0, 0, 0, .5); max-width: 280px;
}
.tooltip .tt-title { font-weight: 600; font-size: 13.5px; margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }
.tooltip .tt-row { display: flex; justify-content: space-between; gap: 18px; color: var(--muted); }
.tooltip .tt-row b { color: var(--text); font-weight: 600; }

@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
  .top-card .list { position: static; max-height: 520px; }
  .hero { grid-template-columns: 1fr; }
  .outlook { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .topbar { grid-template-columns: 1fr; gap: 10px; padding: 12px 16px; }
  .status { display: none; }
  main { padding: 16px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row2, .grid2, .grid3 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .heat-top { grid-template-columns: 1fr; }
  .timeline li { grid-template-columns: 1fr; gap: 2px; }
}
