*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 15px; line-height: 1.5;
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 2400px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 48px); }

/* Header */
.header { display: flex; align-items: center; justify-content: space-between; padding: var(--s5) 0; }
.brand { display: flex; align-items: center; gap: var(--s3); font-weight: 650; letter-spacing: -0.01em; font-size: 17px; }
.brand-mark { width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), #8f9bff); }
.nav { display: flex; gap: var(--s5); color: var(--text-muted); font-size: 14px; }
.nav a { color: inherit; text-decoration: none; }
.nav a:hover, .nav a.active { color: var(--text); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-muted); font-size: 12px; font-weight: 500; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-faint); }

/* Hero */
.hero { padding: var(--s6) 0 var(--s5); }
.hero h1 { margin: var(--s3) 0 var(--s2); font-size: clamp(28px, 4vw, 40px); line-height: 1.1; letter-spacing: -0.03em; font-weight: 700; }
.hero p { margin: 0; color: var(--text-muted); max-width: 56ch; }

/* Karten */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: var(--s5); }
.grid { display: grid; gap: var(--s4); }
.grid-kpi { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: var(--s4); }
.grid-charts { grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); }
@media (max-width: 520px) { .grid-charts { grid-template-columns: 1fr; } .nav { display: none; } }

/* KPI */
.kpi-label { color: var(--text-muted); font-size: 13px; }
.kpi-row { display: flex; align-items: baseline; gap: var(--s3); margin: var(--s1) 0 var(--s3); }
.kpi-value { font-size: 30px; font-weight: 650; letter-spacing: -0.02em; }
.chip { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.chip.pos { color: var(--pos); background: var(--pos-soft); }
.chip.neg { color: var(--neg); background: var(--neg-soft); }
.spark { height: 40px; }

/* Chart-Karte */
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s4); margin-bottom: var(--s4); }
.card-title { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -0.01em; }
.card-sub { margin: 2px 0 0; color: var(--text-muted); font-size: 13px; }
.legend { display: flex; gap: var(--s4); flex-wrap: wrap; margin-top: var(--s3); font-size: 12px; color: var(--text-muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .tt { position: absolute; pointer-events: none; opacity: 0; transition: opacity .12s;
  background: var(--text); color: var(--bg); padding: 6px 10px; border-radius: var(--radius-sm);
  font-size: 12px; line-height: 1.35; white-space: nowrap; transform: translate(-50%, -100%); }
.chart .tt b { display: block; font-size: 14px; font-weight: 650; }

.footer { color: var(--text-faint); font-size: 12px; padding: var(--s6) 0 var(--s7); }

/* ---- Makro → Mikro: Abschnitte und Granularitäts-Leiste ---- */
.level { padding: var(--s6) 0 var(--s5); scroll-margin-top: var(--s5); }
.level-head { margin-bottom: var(--s5); max-width: 62ch; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.level-head h2 { margin: var(--s2) 0 var(--s2); font-size: clamp(24px, 3vw, 32px); letter-spacing: -0.025em; line-height: 1.15; }
.level-head p { margin: 0; color: var(--text-muted); }
.src { margin: var(--s3) 0 0; font-size: 12px; color: var(--text-faint); }
.placeholder { display: grid; place-items: center; min-height: 160px; color: var(--text-faint); border-style: dashed; box-shadow: none; background: transparent; }


/* Erklärung + aktuelle Lage pro Chart */
.about { margin: calc(var(--s2) * -1) 0 var(--s4); color: var(--text-muted); font-size: 13px; max-width: 60ch; }
.now { display: flex; gap: var(--s3); align-items: flex-start; margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--border); }
.now p { margin: 0; font-size: 14px; line-height: 1.45; }
.now .label { flex: none; }
.chip.hot { color: var(--warn); background: var(--warn-soft); }
.chip.cool { color: var(--accent); background: var(--accent-soft); }
.chip.mid { color: var(--text-muted); background: var(--surface-2); }
.tag { display: inline-block; margin-left: var(--s2); font-size: 11px; color: var(--text-faint); border: 1px dashed var(--border); border-radius: 6px; padding: 0 6px; white-space: nowrap; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---- Zeithorizont-Strahl ---- */
.beam { position: fixed; top: 20px; bottom: 20px; right: 18px; width: 160px; z-index: 10; pointer-events: none; }
.beam-hud { position: absolute; top: 0; right: 0; text-align: right; line-height: 1.15; }
.beam-hud small { display: block; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); }
.beam-hud b { display: block; margin-top: 2px; font-size: 16px; font-weight: 650; letter-spacing: -0.02em; color: var(--text); }
.beam-hud span { display: block; margin-top: 2px; font-size: 11px; color: var(--accent); }
.beam-body { position: absolute; top: 72px; bottom: 0; left: 0; right: 0; }
.beam-track { position: absolute; top: 0; bottom: 0; right: 0; width: 2px; border-radius: 2px; background: var(--border); }
.beam-track::before { content: ""; position: absolute; top: 0; bottom: 0; right: 7px; width: 6px;
  background: repeating-linear-gradient(to bottom, var(--border) 0 1px, transparent 1px 9px); opacity: .9; }
.beam-fill { position: absolute; top: 0; right: 0; width: 2px; height: 0; border-radius: 2px;
  background: linear-gradient(to bottom, transparent, var(--accent)); box-shadow: 0 0 14px var(--accent-soft); }
.beam-thumb { position: absolute; top: 0; right: -5.5px; width: 13px; height: 13px; margin-top: -6.5px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--accent); box-shadow: 0 0 0 5px var(--accent-soft), 0 0 18px var(--accent); will-change: transform; }
.beam-mark { position: absolute; right: 22px; display: flex; align-items: center; gap: 8px; white-space: nowrap; pointer-events: auto;
  transform: translateY(-50%) translateX(calc(var(--w, 0) * -6px)); color: var(--text-faint); text-decoration: none; font-size: 13px;
  opacity: calc(.45 + var(--w, 0) * .55); font-weight: 500; }
.beam-mark i { width: calc(8px + var(--w, 0) * 14px); height: 1px; background: currentColor; }
.beam-mark.on { color: var(--text); font-weight: 650; }
@media (max-width: 1299px) {
  .beam { width: 12px; right: 6px; top: 16px; bottom: 16px; }
  .beam-hud, .beam-mark { display: none; }
  .beam-body { top: 0; }
  .beam-track::before { display: none; }
}

.grid-fit3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-fit3 .card { padding: var(--s4) var(--s5) var(--s5); }

/* Layouts: eine Spalte (Dekaden) und zwei Spalten (Monate, Tage) */
.grid-one { grid-template-columns: 1fr; }
.grid-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 820px) { .grid-two { grid-template-columns: 1fr; } }
.grid-two .card { padding: var(--s4) var(--s5) var(--s5); }
.now-body { flex: 1; min-width: 0; }
.now-body p { margin: 0; font-size: 14px; line-height: 1.5; }
.facts { margin: var(--s3) 0 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 13px; color: var(--text-muted); line-height: 1.45; }
.facts li { position: relative; padding-left: 14px; }
.facts li::before { content: ""; position: absolute; left: 0; top: .6em; width: 5px; height: 5px; border-radius: 50%; background: var(--axis); }
.facts b { color: var(--text); font-weight: 600; }

.outlook { display: flex; gap: var(--s3); align-items: flex-start; margin-bottom: var(--s5); }
.outlook .chip { flex: none; font-size: 13px; padding: 3px 10px; }
.outlook-note { margin: var(--s3) 0 0 !important; font-size: 12px !important; color: var(--text-faint); line-height: 1.45 !important; }
.sigline { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin-top: var(--s3); padding-top: var(--s3); border-top: 1px dashed var(--border); font-size: 12px; color: var(--text-muted); line-height: 1.45; }
.overview { margin-bottom: var(--s6); }
.ov-card { padding: var(--s5); }
.ov-head h2 { margin: 0; font-size: 18px; }
.ov-head p { margin: 4px 0 var(--s4); font-size: 13px; color: var(--text-muted); line-height: 1.45; }
.ov-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--s4); }
.ov-col { display: block; padding: var(--s4); border: 1px solid var(--border); border-radius: var(--radius-sm); text-decoration: none; color: inherit; background: var(--surface); transition: border-color .15s, background .15s; }
.ov-col:hover { border-color: var(--accent); background: var(--surface-2); }
.ov-verdict { display: flex; align-items: center; gap: var(--s3); margin: var(--s2, 8px) 0 var(--s3); }
.ov-verdict b { font-size: 20px; font-variant-numeric: tabular-nums; }
.ov-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 12.5px; }
.ov-list li { display: flex; align-items: center; gap: 8px; }
.ov-name { flex: 1; min-width: 0; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-w { width: 22px; text-align: right; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.ov-list .chip { min-width: 30px; text-align: center; padding: 1px 6px; }
.ov-chart { margin-top: var(--s5); padding-top: var(--s5); border-top: 1px solid var(--border); }
.ov-chart h3 { margin: 0; font-size: 15px; }
.ov-chart > p { margin: 4px 0 var(--s3); font-size: 13px; color: var(--text-muted); line-height: 1.45; }
.ov-sub { margin: var(--s5) 0 var(--s3) !important; font-size: 14px !important; }
.sc-bar { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s5); align-items: center; margin-bottom: var(--s3); }
.sc-group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sc-lab { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); margin-right: 2px; }
.sc-chip { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 12.5px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-faint); cursor: pointer; }
.sc-chip i { width: 9px; height: 9px; border-radius: 50%; opacity: .35; }
.sc-chip.on { color: var(--text); border-color: var(--axis); }
.sc-chip.on i { opacity: 1; }
.sc-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.sc-seg button { font: inherit; font-size: 12px; padding: 4px 10px; border: 0; background: var(--surface); color: var(--text-muted); cursor: pointer; }
.sc-seg button + button { border-left: 1px solid var(--border); }
.sc-seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sc-plot { position: relative; }
.sc-plot svg { display: block; width: 100%; user-select: none; }
.sc-tt { position: absolute; opacity: 0; pointer-events: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 8px 10px; font-size: 12px; line-height: 1.5; white-space: nowrap; transition: opacity .1s; }
.sc-tt b { display: block; margin-bottom: 2px; }
.sc-tt span { display: block; color: var(--text-muted); }
.sc-tt i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.sc-tt em { color: var(--text-faint); font-style: normal; }
.sc-hint { margin: var(--s3) 0 0; font-size: 12px; color: var(--text-faint); line-height: 1.45; }
.sc-table-wrap { overflow-x: auto; }
.sc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sc-table th { text-align: left; font-weight: 500; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); padding: 0 12px 8px 0; }
.sc-table td { padding: 10px 12px 10px 0; border-top: 1px solid var(--border); vertical-align: top; font-variant-numeric: tabular-nums; }
.sc-table small { display: block; font-size: 11.5px; color: var(--text-faint); margin-top: 2px; }
.sc-table .muted { color: var(--text-faint); }

/* Zusammenhang Score / Rezessionen */
.rel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--s5); margin-top: var(--s3); }
.rel-grid h4 { margin: 0 0 var(--s3); font-size: 13px; color: var(--text-muted); font-weight: 600; }
.rel-row { display: grid; grid-template-columns: 112px 1fr 38px 70px; align-items: center; gap: 8px; margin: 8px 0; font-size: 12.5px; }
.rel-lab { color: var(--text-muted); }
.rel-bar { height: 12px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.rel-bar i { display: block; height: 100%; border-radius: 6px; background: var(--text-faint); }
.rel-bar i.pos { background: var(--pos); } .rel-bar i.neg { background: var(--warn); } .rel-bar i.mid { background: var(--text-faint); } .rel-bar i.base { background: var(--border-strong, var(--border)); }
.rel-val { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.rel-n { color: var(--text-faint); font-size: 11.5px; text-align: right; }
.rel-base { padding-top: 8px; border-top: 1px dashed var(--border); }
.rel-tab { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.rel-tab th, .rel-tab td { padding: 6px 8px; text-align: right; border-bottom: 1px solid var(--border); }
.rel-tab th:first-child { text-align: left; font-weight: 500; color: var(--text-muted); }
.rel-tab thead th { font-size: 11.5px; color: var(--text-faint); font-weight: 500; }
.rel-tab td small { display: block; font-size: 10.5px; color: var(--text-faint); }

.ov-total { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin: 0 0 var(--s4); }
.ov-total b { font-size: 24px; font-variant-numeric: tabular-nums; }
.ov-total p { flex: 1 1 320px; margin: 0; font-size: 13px; color: var(--text-muted); line-height: 1.45; }

/* Zusammenhang-Streifen */
.rel { margin-top: var(--s3); }
.rel-cells { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rel-cell { display: grid; gap: 4px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.rel-cell.is-now { border-color: var(--text); box-shadow: 0 0 0 1px var(--text) inset; background: var(--surface-2); }
.rel-l { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 11.5px; color: var(--text-muted); }
.rel-l em { font-style: normal; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; padding: 1px 6px; border-radius: 999px; background: var(--text); color: var(--surface); }
.rel-cell b { font-size: 19px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.rel-cell .rel-bar { display: block; height: 5px; border-radius: 3px; background: var(--border); overflow: hidden; }
.rel-cell .rel-bar i { display: block; height: 100%; border-radius: 3px; background: var(--text-faint); }
.rel-cell.neg .rel-bar i { background: var(--warn); } .rel-cell.pos .rel-bar i { background: var(--pos); }
.rel-cell small { font-size: 10.5px; color: var(--text-faint); line-height: 1.3; }
.rel-cap { margin: 6px 0 0; font-size: 11.5px; color: var(--text-faint); line-height: 1.4; }
.ov-card .rel { margin: 0 0 var(--s4); }
@media (max-width: 520px) { .rel-cells { gap: 6px; } .rel-cell { padding: 6px 7px; } .rel-cell b { font-size: 16px; } }
/* Kacheln gleich hoch, aktuelle nicht absenken */
.rel-cells { align-items: stretch; }
.rel-cell { align-content: start; }
.rel-l { min-height: 20px; }
.rel-l em { line-height: 1.4; }

.rel-cell.is-click { cursor: pointer; transition: box-shadow .15s, transform .15s; }
.rel-cell.is-click:hover { box-shadow: 0 0 0 1px var(--text-faint); }
.rel-cell.is-click:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rel-cell.is-sel.neg { box-shadow: 0 0 0 2px var(--warn); }
.rel-cell.is-sel.mid { box-shadow: 0 0 0 2px var(--text-muted); }
.rel-cell.is-sel.pos { box-shadow: 0 0 0 2px var(--accent); }

.scale { margin: 22px 0 14px; padding: 0 2px; }
.scale-bar { position: relative; display: flex; height: 8px; border-radius: 999px; }
.scale-bar i { display: block; height: 100%; }
.scale-bar .z-neg { background: var(--warn); opacity: .35; border-radius: 999px 0 0 999px; }
.scale-bar .z-mid { background: var(--text-faint); opacity: .3; }
.scale-bar .z-pos { background: var(--pos); opacity: .35; border-radius: 0 999px 999px 0; }
.scale-pin { position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--text); border: 3px solid var(--surface, #fff); box-shadow: 0 0 0 1px var(--text); }
.scale-pin b { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); font-size: 12px; font-weight: 700; white-space: nowrap; color: var(--text); }
.scale-ticks { position: relative; height: 16px; margin-top: 8px; font-size: 11px; color: var(--text-faint); }
.scale-ticks span { position: absolute; transform: translateX(-50%); }
.scale-ticks span:first-child { transform: none; }
.scale-ticks span:last-child { transform: translateX(-100%); }

.ov-build { margin: 18px 0 10px; font-size: 14px; color: var(--text-muted); }
.ov-build b { color: var(--text); font-weight: 600; }

.rel-t { display: block; font-size: 11px; font-weight: 400; color: var(--text-faint); margin-top: 1px; }
.rel-cell .rel-l { min-height: 34px; align-items: flex-start; }

/* ---- Refinement: ruhiger, mathematischer Charakter ---- */
h1, h2, h3, .ov-total b, .ov-verdict b, .rel-cell b, .scale-pin b { font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; }
h2 { font-weight: 600; }
.ov-total b { font-size: 34px; }
.ov-verdict b { font-size: 26px; }
.rel-cell b { font-size: 26px; font-weight: 500; }
.scale-pin b { font-size: 13px; font-weight: 600; }
.eyebrow { color: var(--text-muted); font-size: 11px; letter-spacing: .16em; }
.chip { border-radius: 4px; letter-spacing: .01em; }
.brand { font-family: var(--serif); font-weight: 600; font-size: 19px; letter-spacing: .01em; }
.brand-mark { position: relative; border-radius: 4px; background: var(--accent); }
.brand-mark::after { content: "\03A3"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font: 600 16px/1 var(--serif); }
.header { border-bottom: 1px solid var(--border); margin-bottom: var(--s5); }
.rel-bar { height: 3px; border-radius: 0; }
.rel-bar i { border-radius: 0; }
.scale-bar { height: 6px; border-radius: 0; }
.scale-bar .z-neg, .scale-bar .z-pos { border-radius: 0; }
.scale-ticks { font-family: var(--serif); font-style: italic; font-size: 12px; }
.card, .ov-col, .rel-cell { box-shadow: none; }
.ov-col { border-radius: var(--radius); }
.ov-chart, .ov-head { border-color: var(--border); }
.rel-cell .rel-bar { height: 3px; border-radius: 0; }
.rel-cell .rel-bar i { border-radius: 0; }
.rel-l em, .pill, .sc-chip { border-radius: 4px; }
.sc-seg { border-radius: 4px; }
.scale-bar { height: 6px; }
.scale-bar .z-neg, .scale-bar .z-pos { border-radius: 0; }
.rel-cell.is-now { border-color: var(--text); }

/* ---- Layout: Fast-Charts in 3 Spalten, Kacheln passen sich der Kartenbreite an, Kopfbereiche zentriert ---- */
.grid-fast { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1280px) { .grid-fast { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .grid-fast { grid-template-columns: 1fr; } }
.card { container-type: inline-size; min-width: 0; }
.rel-cells > * { min-width: 0; }
@container (max-width: 540px) {
  .rel-cells { grid-template-columns: 1fr; }
  .rel-cell { grid-template-columns: 1fr auto; grid-template-areas: "l b" "bar bar" "s s"; align-items: center; }
  .rel-cell .rel-l { grid-area: l; min-height: 0; }
  .rel-cell b { grid-area: b; justify-self: end; }
  .rel-cell .rel-bar { grid-area: bar; }
  .rel-cell small { grid-area: s; }
}
.level-head { margin-left: auto; margin-right: auto; max-width: 72ch; text-align: center; }
.ov-head, .ov-build, .ov-chart h3, .ov-chart > p { text-align: center; }
.ov-total { justify-content: center; }
.outlook { flex-direction: column; align-items: center; text-align: center; }
.outlook .now-body { width: 100%; }
.outlook .rel, .outlook .rel-cap { text-align: left; }
.footer { text-align: center; }

/* Bewertung (z. B. "Well above target") zentriert, Rest darunter */
.now { flex-direction: column; align-items: stretch; gap: var(--s3); }
.now .label { align-self: center; }
.now-body { width: 100%; }
.now-body > p { text-align: center; }
.sigline { justify-content: center; text-align: center; }

/* Bernoulli logo: inline SVG mark replaces the Σ placeholder */
.brand-mark { background: none; border-radius: 0; display: block; }
.brand-mark::after { content: none; }
