@font-face { font-family: "Plex Sans"; src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

/* ---------------------------------------------------------------- Tokens */
:root {
  color-scheme: light dark;
  --paper: #f3f2ed;
  --surface: #fffefa;
  --surface-2: #f8f7f2;
  --ink: #17191b;
  --muted: #5b6066;
  --rule: #e2dfd6;
  --rule-strong: #c9c5ba;
  --accent: #1d4f91;
  --accent-ink: #ffffff;
  --accent-soft: #e3ebf6;
  --pos: #16714a;
  --neg: #b0261d;
  --pos-soft: #e2f1e8;
  --neg-soft: #fbe8e5;
  --warn: #7d5200;
  --warn-soft: #f8edd3;
  --info-soft: #e6edf6;
  /* Datenfarben: geprüfte, farbenblind-taugliche Reihenfolge (fest, nie rotieren) */
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  --ref: #8a8f96;
  --good: #0ca30c; --critical: #d03b3b;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(40 30 10 / 0.05), 0 8px 24px -8px rgb(40 30 10 / 0.10);
  --sans: "Plex Sans", system-ui, sans-serif;
  --mono: "Plex Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1113;
    --surface: #171a1d;
    --surface-2: #1d2024;
    --ink: #ebe9e4;
    --muted: #a2a7ad;
    --rule: #272b30;
    --rule-strong: #383d44;
    --accent: #8db4ea;
    --accent-ink: #0d1726;
    --accent-soft: #1a2738;
    --pos: #5fc28f;
    --neg: #f08b81;
    --pos-soft: #15291f;
    --neg-soft: #33191a;
    --warn: #e9b65c;
    --warn-soft: #2f2410;
    --info-soft: #18222f;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
    --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
    --ref: #7b8189;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.35), 0 10px 28px -10px rgb(0 0 0 / 0.5);
  }
}

/* ---------------------------------------------------------------- Basis */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--rule-strong) transparent; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 15px/1.55 var(--sans); }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.02em; text-wrap: balance; margin: 0; }
h1 { font-size: 1.85rem; line-height: 1.15; }
h2 { font-size: 1.08rem; margin: 2.5rem 0 0.85rem; }
h3 { font-size: 0.95rem; margin: 1.5rem 0 0.5rem; }
p { margin: 0.25rem 0; }
code { font: 0.88em var(--mono); background: var(--surface-2); padding: 0.05em 0.35em; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.block { display: block; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 0.92em; letter-spacing: -0.01em; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- Kopfleiste */
.topbar { background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 10; }
.topbar-inner { max-width: 1240px; margin: 0 auto; padding: 0.6rem 1.25rem; display: flex; align-items: center; gap: 1.75rem; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; font-weight: 600; font-size: 1.05rem; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--ink); color: var(--paper); display: grid; place-items: center; }
.brand-mark svg { width: 18px; height: 18px; }
.nav { display: flex; gap: 0.15rem; }
.nav a { color: var(--muted); text-decoration: none; padding: 0.42rem 0.75rem; border-radius: 9px; transition: background-color 180ms var(--ease), color 180ms; }
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); font-weight: 600; box-shadow: inset 0 0 0 1px var(--rule); }
.count { display: inline-block; min-width: 1.35em; padding: 0 0.35em; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font: 500 0.72rem/1.4 var(--mono); text-align: center; }
.count-plain { font: 500 0.8rem var(--mono); color: var(--muted); margin-left: 0.3rem; }
.topbar-end { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }
.level { font: 500 0.78rem var(--mono); color: var(--muted); padding: 0.3rem 0.55rem; border-radius: 7px; text-decoration: none; border: 1px solid var(--rule); }
.level:hover { color: var(--ink); border-color: var(--rule-strong); }

/* ---------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.45rem; font: 600 0.88rem/1 var(--sans);
  padding: 0.6rem 0.9rem; border-radius: 9px; border: 1px solid var(--rule-strong);
  background: var(--surface); color: var(--ink); cursor: pointer; white-space: nowrap;
  transition: background-color 180ms var(--ease), border-color 180ms, box-shadow 180ms, transform 120ms;
}
.btn:hover { border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 2px rgb(0 0 0 / 0.1), 0 6px 16px -8px var(--accent); }
.btn-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 86%, var(--ink)); border-color: transparent; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--ink); border-color: var(--rule); }
.btn-danger-quiet { color: var(--neg); border-color: var(--rule); }
.btn-danger-quiet:hover { border-color: var(--neg); background: var(--neg-soft); }
.btn-halted { background: var(--neg); border-color: var(--neg); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-halted { color: #1a0d0b; } }
.icon { width: 1.05em; height: 1.05em; flex: none; }

/* ---------------------------------------------------------------- Seite */
.page { max-width: 1240px; margin: 0 auto; padding: 2.25rem 1.25rem 5rem; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.75rem; }
.head p { margin-top: 0.4rem; }
.h-sub { font-weight: 400; color: var(--muted); font-size: 1.1rem; letter-spacing: 0; }
.price { font-size: 1.75rem; font-weight: 500; margin: 0; }
.back { display: inline-flex; align-items: center; gap: 0.25rem; color: var(--muted); text-decoration: none; margin-bottom: 1rem; font-size: 0.9rem; }
.back:hover { color: var(--ink); }
.footnote { font-size: 0.85rem; margin-top: 1rem; max-width: 80ch; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin: 2.25rem 0 0.85rem; }
.section-head h2 { margin: 0; }

.flash { padding: 0.7rem 0.95rem; border-radius: 10px; margin: 0 0 1.25rem; background: var(--info-soft); }
.flash-ok { background: var(--accent-soft); }
.flash-warn { background: var(--warn-soft); color: var(--warn); }

/* Kontozeile */
.ledger { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 2rem; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.ledger > div { padding: 1rem 1.25rem 1.1rem; }
.ledger > div + div { border-left: 1px solid var(--rule); }
.ledger dt { color: var(--muted); font-size: 0.8rem; }
.ledger dd { margin: 0.2rem 0 0; font-size: 1.35rem; font-weight: 500; }
.ledger dd:not(.num) { font-size: 1.05rem; padding-top: 0.2rem; }

/* Panels & Grafiken */
.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.25rem 0.9rem; min-width: 0; }
.panel-head { margin-bottom: 0.6rem; }
.panel-head h2 { margin: 0 0 0.2rem; }
.viz-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 1.25rem; margin-bottom: 0.5rem; }
.viz { position: relative; min-height: 120px; }
.chart-note { margin-top: 0.4rem; }
.chart-stage { position: relative; width: 100%; }
.chart-stage svg { display: block; overflow: visible; }
.chart-controls { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.segmented { display: inline-flex; padding: 3px; border-radius: 9px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--rule); }
.segmented button { font: 500 0.8rem var(--mono); color: var(--muted); background: none; border: 0; padding: 0.3rem 0.65rem; border-radius: 7px; cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / 0.12); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 0.15rem 0.5rem; }
.legend-item { display: inline-flex; align-items: center; gap: 0.4rem; font: 400 0.82rem var(--sans); color: var(--muted); background: none; border: 0; padding: 0.2rem 0.3rem; border-radius: 6px; cursor: pointer; }
.legend-item:disabled { cursor: default; }
.legend-item:hover:not(:disabled) { color: var(--ink); background: var(--surface-2); }
.legend-item[aria-pressed="false"] { opacity: 0.4; }
.select { font: 500 0.88rem var(--sans); color: var(--ink); background: var(--surface-2); border: 1px solid var(--rule-strong); border-radius: 9px; padding: 0.4rem 0.6rem; }

.swatch { display: inline-block; width: 14px; height: 0; border-top: 2px solid currentColor; flex: none; }
.swatch.dash { border-top-style: dashed; }
.s1 { color: var(--s1); stroke: var(--s1); } .s2 { color: var(--s2); stroke: var(--s2); }
.s3 { color: var(--s3); stroke: var(--s3); } .s4 { color: var(--s4); stroke: var(--s4); }
.s5 { color: var(--s5); stroke: var(--s5); } .s6 { color: var(--s6); stroke: var(--s6); }
.s7 { color: var(--s7); stroke: var(--s7); } .s8 { color: var(--s8); stroke: var(--s8); }
.ref-line { color: var(--ref); stroke: var(--ref); }
.vol { color: var(--rule-strong); fill: var(--rule-strong); }

svg .grid { stroke: var(--rule); stroke-width: 1; }
svg .grid.zero { stroke: var(--rule-strong); }
svg .axis { fill: var(--muted); font: 11.5px var(--mono); }
svg .axis-title { fill: var(--muted); font: 600 11.5px var(--sans); }
svg .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
svg .line.thin { stroke-width: 1.25; }
svg .line.dash { stroke-dasharray: 5 4; stroke-width: 1.5; }
svg .area { stroke: none; fill: currentColor; fill-opacity: 0.14; }
svg .bar { fill: var(--rule-strong); }
svg .band { fill: var(--s7); fill-opacity: 0.07; }
svg .ref { stroke-width: 1.25; stroke-dasharray: 2 4; }
svg .ref-label { font: 500 11px var(--mono); paint-order: stroke; stroke: var(--surface); stroke-width: 4px; }
svg .ref-stop { stroke: var(--critical); fill: var(--critical); }
svg .ref-target { stroke: var(--good); fill: var(--good); }
svg text.ref-stop, svg text.ref-target { stroke: var(--surface); }
svg .end-label { fill: var(--muted); font: 500 11px var(--mono); }
svg .crosshair { stroke: var(--ink); stroke-opacity: 0.35; stroke-width: 1; }
svg .hover-dot { fill: currentColor; stroke: var(--surface); stroke-width: 2; }
svg .hit { fill: transparent; cursor: crosshair; outline: none; }
.chart-tip {
  position: absolute; z-index: 3; pointer-events: none; min-width: 9rem;
  background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(6px);
  border-radius: 10px; padding: 0.5rem 0.65rem; font-size: 0.8rem;
  box-shadow: 0 2px 4px rgb(0 0 0 / 0.08), 0 12px 32px -8px rgb(0 0 0 / 0.25);
}
.tip-date { font-weight: 600; margin-bottom: 0.25rem; }
.tip-row { display: flex; align-items: center; gap: 0.45rem; line-height: 1.6; }
.tip-label { color: var(--muted); flex: 1; }
.tip-val { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* Streudiagramm */
svg .quad-good { fill: var(--pos); fill-opacity: 0.05; }
svg .quad-bad { fill: var(--neg); fill-opacity: 0.04; }
svg .quad-label { fill: var(--muted); font: 600 11px var(--sans); text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.8; }
svg .pt { stroke: var(--surface); stroke-width: 2; transition: r 160ms var(--ease); }
svg .pt-link:hover .pt, svg .pt-link:focus .pt { r: 8; }
svg .pt-link { outline: none; }
svg .pt-label { fill: var(--ink); font: 500 11.5px var(--mono); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
svg .pt-bullish { fill: var(--pos); } svg .pt-bearish { fill: var(--neg); } svg .pt-neutral { fill: var(--ref); }
svg .pt-cat1 { fill: var(--s1); } svg .pt-cat2 { fill: var(--s2); } svg .pt-cat3 { fill: var(--s3); }
.dot-key { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin: 0 0.25rem 0 0.4rem; vertical-align: 0; }
.dot-key.pt-cat1 { background: var(--s1); } .dot-key.pt-cat2 { background: var(--s2); } .dot-key.pt-cat3 { background: var(--s3); }

/* Balken */
svg .hbar.pos { fill: var(--pos); } svg .hbar.neg { fill: var(--neg); }
svg .bar-label { fill: var(--ink); font: 500 12px var(--mono); }
svg .bar-val { font: 500 12px var(--mono); }
svg .bar-val.pos { fill: var(--pos); } svg .bar-val.neg { fill: var(--neg); }

/* Mini-Trends */
.spark-box { width: 100%; min-width: 90px; height: 28px; }
.spark-cell { width: 120px; padding-top: 0.55rem !important; padding-bottom: 0.4rem !important; }
.spark .spark-line { fill: none; stroke-width: 1.5; stroke-linejoin: round; }
.spark .spark-area { stroke: none; fill-opacity: 0.12; }
.spark.up .spark-line { stroke: var(--pos); } .spark.up .spark-area { fill: var(--pos); }
.spark.down .spark-line { stroke: var(--neg); } .spark.down .spark-area { fill: var(--neg); }

/* ---------------------------------------------------------------- Tabellen */
.table-wrap { overflow-x: auto; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.table th, .table td { padding: 0.72rem 0.95rem; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.table thead th { font-size: 0.78rem; font-weight: 600; color: var(--muted); border-bottom-color: var(--rule-strong); }
.table tbody tr:last-child > * { border-bottom: 0; }
.table tbody tr { transition: background-color 140ms; }
.table tbody tr:hover { background: var(--surface-2); }
.table .r { text-align: right; }
.table td:has(.block) { white-space: normal; min-width: 14rem; }
.sym { font: 500 0.95rem var(--mono); color: var(--ink); text-decoration: none; }
.sym:hover { color: var(--accent); text-decoration: underline; }

.signal, .reco, .status, .tag, .setup { display: inline-block; font-size: 0.78rem; font-weight: 600; padding: 0.12rem 0.5rem; border-radius: 6px; background: var(--surface-2); white-space: nowrap; }
.signal-bullish, .reco-kaufen { color: var(--pos); background: var(--pos-soft); }
.signal-bearish, .reco-verkaufen, .reco-meiden { color: var(--neg); background: var(--neg-soft); }
.signal-neutral, .reco-halten { color: var(--muted); }
.status-pending { color: var(--accent); background: var(--accent-soft); }
.status-submitted { color: var(--pos); }
.status-rejected, .status-error { color: var(--neg); }
.tag { font-weight: 500; font-size: 0.72rem; color: var(--muted); padding: 0.05rem 0.4rem; }
.tag-aktie { color: var(--s1); } .tag-etf { color: var(--s2); } .tag-krypto { color: var(--s3); }
.tag-active { color: var(--accent-ink); background: var(--accent); margin-left: 0.4rem; vertical-align: 0.15em; }
.setup { color: var(--accent); background: var(--accent-soft); font-size: 0.74rem; }

/* ---------------------------------------------------------------- Radar */
.filters { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: -0.5rem 0 0.5rem; }
.chip { font: 500 0.84rem var(--sans); color: var(--muted); background: var(--surface); border: 1px solid var(--rule); border-radius: 99px; padding: 0.35rem 0.85rem; cursor: pointer; transition: all 160ms var(--ease); }
.chip:hover { color: var(--ink); border-color: var(--rule-strong); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.deals { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); counter-reset: deal; }
.deal {
  display: grid; grid-template-columns: minmax(10rem, 1.3fr) minmax(90px, 1fr) minmax(0, 2fr) minmax(0, 1.5fr) 5.5rem;
  gap: 1.25rem; align-items: center; padding: 0.9rem 1.25rem; border-bottom: 1px solid var(--rule);
  transition: background-color 140ms;
}
.deal:last-child { border-bottom: 0; }
.deal:hover { background: var(--surface-2); }
.deal-id { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.5rem; }
.deal-sym { font-size: 1.05rem; }
.setups { display: flex; gap: 0.3rem; flex-wrap: wrap; width: 100%; }
.deal-spark { height: 34px; }
.deal-stats, .deal-plan { display: grid; grid-auto-flow: column; gap: 1rem; margin: 0; }
.deal-stats dt, .deal-plan dt { font-size: 0.72rem; color: var(--muted); }
.deal-stats dd, .deal-plan dd { margin: 0; }
.score { display: grid; gap: 0.3rem; justify-items: end; }
.score-num { font-size: 1.25rem; font-weight: 500; }
.meter { display: block; width: 100%; height: 4px; border-radius: 4px; background: var(--rule); overflow: hidden; }
.meter-fill { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--accent); transition: width 600ms var(--ease); }

/* ---------------------------------------------------------------- Stufen */
.stages { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.stage { display: grid; grid-template-columns: 2.5rem 1fr; gap: 1.1rem; padding: 1.25rem 1.4rem; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.stage.is-active { box-shadow: var(--shadow), inset 0 0 0 2px var(--accent); }
.stage-mark { width: 2.5rem; height: 2.5rem; border-radius: 50%; display: grid; place-items: center; font: 500 1rem var(--mono); background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--rule-strong); }
.stage.is-active .stage-mark { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.stage.is-done .stage-mark { background: var(--pos-soft); color: var(--pos); box-shadow: none; }
.stage-body h2 { margin: 0.35rem 0 0.4rem; }
.stage-body > p { max-width: 70ch; color: var(--muted); }
.checklist { list-style: none; margin: 0.8rem 0 0; padding: 0; display: grid; gap: 0.35rem; }
.checklist li { display: flex; gap: 0.5rem; align-items: flex-start; }
.checklist .icon { margin-top: 0.2rem; }
.checklist .ok .icon { color: var(--pos); }
.checklist .todo { color: var(--muted); }
.checklist .todo .icon { color: var(--rule-strong); }

/* ---------------------------------------------------------------- Detailseite */
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 3rem; }
.facts { margin: 0; }
.facts > div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0; border-bottom: 1px solid var(--rule); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; }
.facts-text > div { display: grid; grid-template-columns: 7.5rem 1fr; }
.facts-text dd { text-align: left; max-width: 65ch; }
.assessment-head { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.75rem; }
.reasons { margin: 0; padding-left: 1.1rem; max-width: 70ch; }
.reasons li { margin: 0.3rem 0; }
.history, .news { list-style: none; margin: 0; padding: 0; }
.history li { padding: 0.35rem 0; display: flex; gap: 0.6rem; align-items: center; }
.news li { padding: 0.65rem 0; border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; gap: 0.1rem; }
.news a { color: var(--ink); text-decoration: none; max-width: 80ch; }
.news a:hover { color: var(--accent); text-decoration: underline; }
.news .icon { width: 0.8em; height: 0.8em; margin-left: 0.3em; color: var(--muted); vertical-align: baseline; }

/* Orders */
.pending { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.pending-item { display: flex; justify-content: space-between; gap: 1.5rem; padding: 1.1rem 1.25rem; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.order-line { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: baseline; }
.actions { display: flex; gap: 0.5rem; align-items: flex-start; }

/* ---------------------------------------------------------------- Login */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background:
  radial-gradient(60rem 40rem at 85% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%), var(--paper); }
.login { width: min(100%, 23rem); background: var(--surface); padding: 2rem 1.75rem 1.75rem; border-radius: 18px; box-shadow: var(--shadow); }
.login .brand { margin-bottom: 1.25rem; }
.login h1 { margin-bottom: 0.4rem; font-size: 1.5rem; }
.login > p { margin-bottom: 1.5rem; }
.stack { display: grid; gap: 1rem; }
label { display: grid; gap: 0.3rem; font-size: 0.86rem; font-weight: 600; }
input {
  font: 400 1rem var(--sans); color: var(--ink); background: var(--surface-2);
  padding: 0.68rem 0.8rem; border: 1px solid var(--rule-strong); border-radius: 9px;
  transition: border-color 160ms, box-shadow 160ms;
}
input::placeholder { color: var(--muted); }
input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
input[name="code"] { font-family: var(--mono); letter-spacing: 0.2em; }
.login .btn-primary { justify-content: center; padding: 0.8rem; font-size: 0.95rem; margin-top: 0.4rem; }

/* ---------------------------------------------------------------- Responsiv */
@media (max-width: 1080px) {
  .deal { grid-template-columns: minmax(9rem, 1fr) minmax(80px, 1fr) minmax(0, 2fr) 4.5rem; }
  .deal-plan { grid-column: 1 / -1; justify-content: start; }
}
@media (max-width: 900px) {
  .viz-grid, .split { grid-template-columns: 1fr; gap: 1.25rem; }
  .ledger { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ledger > div:nth-child(3) { border-left: 0; }
  .ledger > div:nth-child(n + 3) { border-top: 1px solid var(--rule); }
}
@media (max-width: 640px) {
  .topbar-inner { flex-wrap: wrap; gap: 0.5rem 1rem; padding: 0.5rem 1rem; }
  .nav { order: 3; width: calc(100% + 1rem); margin: 0 -0.5rem; overflow-x: auto; scrollbar-width: none; }
  .nav a { white-space: nowrap; }
  .level { display: none; }
  .page { padding: 1.5rem 1rem 3rem; }
  h1 { font-size: 1.5rem; }
  .panel { padding: 0.9rem 0.85rem 0.7rem; }
  .pending-item { flex-direction: column; }
  .deal { grid-template-columns: 1fr auto; gap: 0.6rem 1rem; padding: 0.9rem 1rem; }
  .deal-spark { grid-column: 1 / -1; grid-row: 2; }
  .deal-stats, .deal-plan { grid-column: 1 / -1; gap: 0.5rem; justify-content: space-between; }
  .score { grid-column: 2; grid-row: 1; min-width: 4rem; }
  .ledger dd { font-size: 1.15rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------------------------------------------------------------- Gruppen */
.group-tabs { display: flex; gap: 0.25rem; margin: 0 0 0.75rem; border-bottom: 1px solid var(--rule); }
.group-tab { font: 600 0.86rem var(--sans); color: var(--muted); background: none; border: 0; padding: 0.45rem 0.7rem; margin-bottom: -1px; border-bottom: 2px solid transparent; cursor: pointer; }
.group-tab:hover { color: var(--ink); }
.group-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.group-title { display: flex; align-items: center; gap: 0.15rem; }
.group-title .dot-key { margin-left: 0; margin-right: 0.45rem; width: 10px; height: 10px; }
.group { scroll-margin-top: 5rem; }
.lead { margin: -0.75rem 0 0.5rem; }
.empty { padding: 0.5rem 0 0.25rem; }
.leaders { margin-top: 0.85rem; }
.leaders summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: 0.9rem; padding: 0.35rem 0; list-style-position: inside; }
.leaders summary:hover { color: var(--ink); }
.leaders[open] summary { margin-bottom: 0.6rem; }
.filters .chip { text-decoration: none; }
.table-fixed { table-layout: fixed; }
.table-fixed th:nth-child(1) { width: 9%; } .table-fixed th:nth-child(2) { width: 10%; } .table-fixed th:nth-child(3) { width: 13%; }
.table-fixed th:nth-child(4), .table-fixed th:nth-child(5) { width: 10%; } .table-fixed th:nth-child(6) { width: 6%; }
.table-fixed th:nth-child(7) { width: 11%; } .table-fixed th:nth-child(8) { width: 15%; }
@media (max-width: 900px) { .table-fixed { table-layout: auto; } }

/* ---------------------------------------------------------------- Navigation-Icons & Handy-Leiste */
.nav a { display: inline-flex; align-items: center; gap: 0.4rem; }
.nav .icon { display: none; }
@media (max-width: 640px) {
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; width: auto; margin: 0; order: 0;
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; overflow: visible;
    padding: 0.35rem 0.25rem calc(0.35rem + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(12px);
    border-top: 1px solid var(--rule);
  }
  .nav a { flex-direction: column; gap: 0.15rem; padding: 0.35rem 0; font-size: 0.7rem; position: relative; border-radius: 10px; }
  .nav a[aria-current="page"] { box-shadow: none; background: none; color: var(--accent); }
  .nav .icon { display: block; width: 1.45rem; height: 1.45rem; }
  .nav .count { position: absolute; top: 0.1rem; left: calc(50% + 0.45rem); }
  body { padding-bottom: calc(4.25rem + env(safe-area-inset-bottom)); }
  .topbar-inner { flex-wrap: nowrap; }
  .topbar-end .btn-danger-quiet, .topbar-end .btn-halted { padding: 0.5rem 0.7rem; }
  .ledger > div { padding: 0.75rem 0.9rem 0.8rem; }
  .ledger dd { font-size: 1.05rem; }
  .ledger dd:not(.num) { font-size: 0.92rem; }
  .head { margin-bottom: 1.25rem; }
  .head .btn-primary { width: 100%; justify-content: center; padding: 0.75rem; }
  .head form { width: 100%; }
  .group-tabs { overflow-x: auto; }
  .chart-controls { gap: 0.5rem; }
  .table th, .table td { padding: 0.65rem 0.7rem; }
}
@media (max-width: 640px) {
  /* backdrop-filter würde die feste Leiste an die Kopfzeile binden statt an den Bildschirm */
  .topbar { backdrop-filter: none; background: var(--surface); }
}

/* ---------------------------------------------------------------- Marktklima, Säulen, Ausstiege */
.top-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 1.25rem; margin-bottom: 1.25rem; }
.climate-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.climate-head h2 { margin: 0 0 0.2rem; }
.climate-scale { display: inline-grid; grid-template-columns: repeat(5, 2.4rem); gap: 3px; }
.climate-scale .step { text-align: center; font: 500 0.8rem/2rem var(--mono); color: var(--muted); background: var(--surface-2); border-radius: 6px; }
.climate-scale .step.on { color: #fff; font-weight: 600; box-shadow: 0 4px 12px -4px rgb(0 0 0 / 0.35); }
.climate-scale .step-2.on { background: var(--neg); }
.climate-scale .step-1.on { background: color-mix(in srgb, var(--neg) 70%, var(--ref)); }
.climate-scale .step0.on { background: var(--ref); }
.climate-scale .step1.on { background: color-mix(in srgb, var(--pos) 70%, var(--ref)); }
.climate-scale .step2.on { background: var(--pos); }
@media (prefers-color-scheme: dark) { .climate-scale .step.on { color: #0d0f10; } }
.climate-label { font-size: 1.15rem; font-weight: 600; margin: 0.6rem 0 0.75rem; }
.components { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem 1.5rem; }
.components li { display: grid; grid-template-columns: 4.5rem 1fr; grid-template-rows: auto auto; column-gap: 0.7rem; align-items: center; font-size: 0.86rem; }
.comp-bar { grid-row: 1 / 3; position: relative; height: 6px; border-radius: 3px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--rule); }
.comp-bar::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--rule-strong); }
.comp-fill { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.comp-fill.pos { background: var(--pos); }
.comp-fill.neg { background: var(--neg); }
.comp-title { font-weight: 600; }
.comp-detail { font-size: 0.76rem; font-family: var(--mono); }
.exit-list { list-style: none; margin: 0; padding: 0; }
.exit-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.5rem; padding: 0.55rem 0; border-bottom: 1px solid var(--rule); }
.exit-list li:last-child { border-bottom: 0; }
.decision { display: inline-block; font-size: 0.76rem; font-weight: 600; padding: 0.1rem 0.45rem; border-radius: 6px; white-space: nowrap; }
.tone-pos { color: var(--pos); background: var(--pos-soft); }
.tone-neg { color: var(--neg); background: var(--neg-soft); }
.tone-warn { color: var(--warn); background: var(--warn-soft); }
.tone-neutral { color: var(--muted); background: var(--surface-2); }
.pscores { display: inline-flex; gap: 0.25rem; margin-right: 0.4rem; vertical-align: middle; }
.pscore { display: inline-flex; align-items: baseline; gap: 0.15rem; font: 500 0.8rem var(--mono); padding: 0.05rem 0.35rem; border-radius: 5px; background: var(--surface-2); }
.pscore.pos { color: var(--pos); }
.pscore.neg { color: var(--neg); }
.pscore.zero { color: var(--muted); }
.pscore-k { font: 600 0.66rem var(--sans); color: var(--muted); }
.pillar-cell { white-space: normal !important; }
.pillar-cell .decision { margin-top: 0.15rem; }
.pillars { margin: 1.25rem 0 0; }
.pillar-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem; }
.pillar { display: grid; align-content: start; gap: 0.35rem; }
.pillar + .pillar { border-left: 1px solid var(--rule); padding-left: 1.25rem; }
.pillar-k { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.pillar > .pscore { font-size: 1.5rem; padding: 0.1rem 0.5rem; justify-self: start; }
.pillar ul { list-style: none; margin: 0; padding: 0; font-size: 0.82rem; color: var(--muted); }
.pillar-decision p { margin: 0.2rem 0 0.35rem; }
.flag-row { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 1rem; padding-top: 0.9rem; border-top: 1px solid var(--rule); }
.flag { font-size: 0.78rem; padding: 0.15rem 0.5rem; border-radius: 6px; }
@media (max-width: 900px) {
  .top-grid { grid-template-columns: 1fr; }
  .pillar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pillar:nth-child(3) { border-left: 0; padding-left: 0; }
}
@media (max-width: 640px) {
  .components { grid-template-columns: 1fr; }
  .climate-scale { grid-template-columns: repeat(5, 1fr); width: 100%; }
}
.pillar .decision, .exit-list .decision, .pillar-cell .decision { white-space: normal; }

/* ---------------------------------------------------------------- Einordnung */
.insight { margin-top: 1rem; padding: 0.8rem 0.95rem; border-radius: 10px; background: var(--surface-2); display: grid; gap: 0.45rem; font-size: 0.88rem; line-height: 1.5; }
.insight p { margin: 0; display: grid; grid-template-columns: 6.6rem 1fr; gap: 0.75rem; max-width: 95ch; }
.insight-k { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); padding-top: 0.15rem; }
.insight.tone-pos { background: color-mix(in srgb, var(--pos-soft) 70%, var(--surface)); color: inherit; }
.insight.tone-neg { background: color-mix(in srgb, var(--neg-soft) 70%, var(--surface)); color: inherit; }
.insight.tone-warn { background: color-mix(in srgb, var(--warn-soft) 70%, var(--surface)); color: inherit; }
.insight.tone-neutral { background: var(--surface-2); color: inherit; }
.insight.tone-pos p:last-child .insight-k { color: var(--pos); }
.insight.tone-neg p:last-child .insight-k { color: var(--neg); }
.insight.tone-warn p:last-child .insight-k { color: var(--warn); }
.table-wrap + .insight { margin-top: 0.75rem; }
.stack-tile { display: grid; }
@media (max-width: 640px) {
  .insight p { grid-template-columns: 1fr; gap: 0.1rem; }
}

/* ---------------------------------------------------------------- Claude-Einordnung */
.insight-rules { display: grid; gap: 0.45rem; }
.insight-ai { padding-top: 0.55rem; border-top: 1px dashed color-mix(in srgb, var(--ink) 18%, transparent); }
.insight-ai p { margin: 0; display: grid; grid-template-columns: 6.6rem 1fr; gap: 0.75rem; max-width: 95ch; }
.insight-rules:empty + .insight-ai { border-top: 0; padding-top: 0; }
.ai-k { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--s7) !important; }
.ai-k .icon { width: 0.95rem; height: 0.95rem; }
.overall { margin-bottom: 1.25rem; background: linear-gradient(135deg, color-mix(in srgb, var(--s7) 7%, var(--surface)), var(--surface) 60%); }
.overall-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.overall-head h2 { margin: 0; display: flex; gap: 0.6rem; align-items: baseline; flex-wrap: wrap; }
.overall-text { font-size: 1.02rem; margin: 0.6rem 0 0.35rem; max-width: 90ch; }
.overall-action { margin: 0; max-width: 90ch; }
@media (max-width: 640px) {
  .insight-ai p { grid-template-columns: 1fr; gap: 0.1rem; }
}

/* ---------------------------------------------------------------- Sortierbare Liste */
.sort-h { cursor: pointer; user-select: none; }
.sort-h:hover { color: var(--ink); }
.sort-h[aria-sort]::after { content: " ↓"; color: var(--accent); }
.sort-h[aria-sort="ascending"]::after { content: " ↑"; }
.tag-wl { color: var(--s7); background: color-mix(in srgb, var(--s7) 12%, transparent); }
.wl-note { margin: 1.75rem 0 -1rem; max-width: 90ch; }
.sortable td .setup { margin: 0.05rem 0; }

/* ---------------------------------------------------------------- Handy-Navigation (eigenes Element, unabhängig von der Kopfzeile) */
.tabbar { display: none; }
.nav-top .icon { display: none; }
@media (max-width: 640px) {
  .nav-top { display: none !important; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    padding: 0.35rem 0.25rem calc(0.4rem + env(safe-area-inset-bottom, 0px));
    background: var(--surface); /* Fallback für Browser ohne color-mix */
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
    border-top: 1px solid var(--rule);
    box-shadow: 0 -4px 16px -8px rgb(0 0 0 / 0.15);
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; gap: 0.15rem; position: relative;
    padding: 0.35rem 0; font-size: 0.7rem; color: var(--muted); text-decoration: none; border-radius: 10px;
    -webkit-tap-highlight-color: transparent;
  }
  .tabbar a[aria-current="page"] { color: var(--accent); font-weight: 600; }
  .tabbar .icon { display: block; width: 1.45rem; height: 1.45rem; }
  .tabbar .count { position: absolute; top: 0.1rem; left: calc(50% + 0.45rem); }
  body { padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px)); }
  .topbar { position: sticky; -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--surface); }
}

/* ---------------------------------------------------------------- Limits */
.limits { margin-bottom: 1.25rem; }
.limits h2 { margin: 0 0 0.2rem; }
.limits-row { display: flex; justify-content: space-between; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.limits-row > div { max-width: 60ch; }
.limits-form { display: flex; gap: 0.5rem; align-items: center; }
.money { display: flex; align-items: center; border: 1px solid var(--rule-strong); border-radius: 9px; background: var(--surface-2); padding-right: 0.7rem; }
.money input { border: 0; background: transparent; width: 7rem; text-align: right; font-family: var(--mono); font-size: 1.05rem; }
.money input:focus-visible { box-shadow: none; }
.money:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.money span { color: var(--muted); font-size: 0.85rem; }
.limits .flash { margin: 0.9rem 0 0; }
@media (max-width: 640px) { .limits-form { width: 100%; } .money { flex: 1; } .money input { width: 100%; } }

.limits-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem 1.25rem; margin-top: 1rem; }
.field { display: grid; gap: 0.35rem; border: 0; margin: 0; padding: 0; min-width: 0; }
.field > label, .field > legend { font-size: 0.8rem; font-weight: 600; color: var(--muted); padding: 0; }
.seg-form label { display: block; font-weight: 500; font-size: 0.86rem; }
.seg-form input { position: absolute; opacity: 0; pointer-events: none; }
.seg-form span { display: block; padding: 0.45rem 0.8rem; border-radius: 7px; color: var(--muted); cursor: pointer; }
.seg-form input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / 0.12); }
.seg-form input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.field-note { margin-top: 0.75rem; max-width: 90ch; }
@media (max-width: 640px) { .limits-form .field, .limits-form .btn { width: 100%; } .limits-form .btn { justify-content: center; } .seg-form { display: grid; grid-template-columns: 1fr 1fr; } .seg-form span { text-align: center; } }

/* ---------------------------------------------------------------- Suche & feste Titel */
.icon-btn { padding: 0.5rem 0.6rem; }
.icon-btn[aria-current="page"] { color: var(--ink); border-color: var(--rule); }
.searchbar { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; }
.searchbar input { flex: 1; font-size: 1.05rem; }
.results { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.result { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.8rem 1.1rem; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.result:last-child { border-bottom: 0; }
.result-id { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 0.6rem; min-width: 0; }
.result-name { width: 100%; color: var(--muted); font-size: 0.88rem; }
.result-actions { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.head-side { display: grid; justify-items: end; gap: 0.5rem; }
.pin { font-size: 0.8rem; }
@media (max-width: 640px) {
  .head-side { justify-items: start; }
  .result-actions { width: 100%; }
  .result-actions .btn, .result-actions form { flex: 1; }
  .result-actions form .btn { width: 100%; justify-content: center; }
  .topbar-end .level { display: none; }
}
