:root {
  --bg: #07080b;
  --bg-2: #0c0e12;
  --card: rgba(14, 16, 20, 0.78);
  --ink: #f6f1e6;
  --muted: #b7b0a2;
  --faint: #aea79a;
  --line: rgba(212, 175, 55, 0.16);
  --line-strong: rgba(212, 175, 55, 0.38);
  --gold: #d4af37;
  --gold-bright: #f5d76e;
  --gold-deep: #c9a227;
  --up: #3ddc97;
  --down: #e24b6a;
  --ice: #f0d78c;
  --display: "Syne", "Segoe UI", sans-serif;
  --body: "Manrope", "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 46% 32% at 100% -8%, rgba(212, 175, 55, 0.14), transparent 58%),
    radial-gradient(ellipse 36% 28% at -8% 8%, rgba(61, 220, 151, 0.05), transparent 52%),
    linear-gradient(180deg, #0a0c10 0%, var(--bg) 28%, #08090c 100%);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(212, 175, 55, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212, 175, 55, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 75%);
}
a { color: var(--gold-bright); text-decoration: none; }
img, canvas { display: block; max-width: 100%; }
::selection { background: #d4af37; color: #14110a; }
:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 3px; }
.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  z-index: 9;
  background: #14110a;
  color: var(--gold-bright);
  padding: 8px 12px;
}
.skip:focus { top: 12px; }

.nav {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 64px;
  padding: 10px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 8, 11, 0.82);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand-mark { width: 34px; height: 34px; }
.word {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 1.05rem;
  text-transform: uppercase;
}
.word span {
  color: var(--gold-bright);
}
.nav nav { display: flex; gap: 4px; margin-left: 12px; }
.nav nav a {
  color: var(--muted);
  font-size: 0.92rem;
  padding: 8px 12px;
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease;
}
.nav nav a:hover { color: var(--ink); background: rgba(212, 175, 55, 0.08); }
.mode, .live {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.mode {
  margin-left: auto;
  color: var(--gold);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px 10px;
}
.live { color: var(--faint); }
.live i, .status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--faint);
  display: block;
  flex: none;
}
.live.on { color: var(--up); }
.live.on i { background: var(--up); box-shadow: 0 0 0 4px rgba(61, 220, 151, 0.16); }

.clocks {
  width: min(1440px, calc(100% - 36px));
  margin: 14px auto 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.clocks span {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(12, 14, 18, 0.72);
}
.clocks span.on {
  color: #1a1408;
  background: linear-gradient(180deg, #f5d76e, #d4af37);
  border-color: transparent;
}

.tape {
  width: min(1440px, calc(100% - 36px));
  margin: 12px auto 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(10, 12, 16, 0.8);
  backdrop-filter: blur(10px);
}
.tape article { padding: 14px 16px; border-right: 1px solid var(--line); min-width: 0; }
.tape article:last-child { border-right: 0; }
.tape span, .macro span, .highlights span, .stat span, .risk-top span {
  display: block;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.tape strong {
  display: block;
  margin-top: 6px;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}

main {
  position: relative;
  z-index: 1;
  width: min(1440px, calc(100% - 36px));
  margin: 16px auto 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 16px;
  align-items: start;
}
.stage { min-width: 0; display: grid; gap: 16px; align-content: start; }
.hero { display: grid; gap: 14px; }
#buch, #stunden, #lage, .hero { scroll-margin-top: 84px; }

.hud, .highlights article, .tape, .macro article, .stat, .risk {
  background:
    linear-gradient(180deg, rgba(245, 215, 110, 0.045), transparent 28%),
    var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.hud { position: relative; }
.hud::before, .hud::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  pointer-events: none;
}
.hud::before { top: 8px; left: 8px; border-top: 1px solid rgba(245, 215, 110, 0.7); border-left: 1px solid rgba(245, 215, 110, 0.7); }
.hud::after { right: 8px; bottom: 8px; border-right: 1px solid rgba(212, 175, 55, 0.35); border-bottom: 1px solid rgba(212, 175, 55, 0.35); }

.price-block { padding: 22px 22px 18px; }
.price-top, .name-row, .chart-head, .risk-top, .trade-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.kicker {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}
.px {
  margin: 8px 0 0;
  font-family: var(--mono);
  font-weight: 500;
  font-size: clamp(3.4rem, 7vw, 5.8rem);
  letter-spacing: -0.05em;
  line-height: 0.9;
  color: #f5d76e;
  text-shadow: 0 0 28px rgba(212, 175, 55, 0.28);
}
.px.flash-up { color: var(--up); text-shadow: none; }
.px.flash-down { color: var(--down); text-shadow: none; }
.px.flash-down { color: var(--down); }
.chg { margin: 12px 0 0; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.up { color: var(--up); }
.down { color: var(--down); }
.ice { color: var(--ice); }
.src, .quiet, .note { margin: 8px 0 0; color: var(--muted); }
.chart-wrap, .book-chart { min-width: 0; }
.board { padding: 8px 8px 12px; }
.chart-head { padding: 12px 12px 0; }
.legend { margin: 0; color: var(--faint); font-size: 0.82rem; }
.chart-wrap canvas { width: 100%; height: 440px; }
.book-chart canvas { width: 100%; height: 340px; }

.status {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.status .sub { color: var(--faint); letter-spacing: 0.04em; }
.status.live { color: var(--gold-bright); border-color: rgba(212, 175, 55, 0.45); }
.status.live i { background: var(--gold-bright); box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.15); }
.status.position { color: var(--up); border-color: rgba(61, 220, 151, 0.4); }
.status.position i { background: var(--up); box-shadow: 0 0 0 4px rgba(61, 220, 151, 0.14); }
.status.filter { color: var(--ice); }
.status.filter i { background: var(--gold); }
.status.pause { color: var(--down); border-color: rgba(226, 75, 106, 0.4); }
.status.pause i { background: var(--down); }
.status.idle i { background: var(--faint); }

.ticket {
  padding: 22px;
  align-self: start;
  position: sticky;
  top: 80px;
  z-index: 2;
  width: 100%;
  max-height: min(680px, calc(100vh - 96px));
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.45) transparent;
  background:
    linear-gradient(180deg, rgba(245, 215, 110, 0.05), transparent 28%),
    #0c0e12;
}
.ticket h1, .panel h2, .desk-name {
  margin: 0;
  font-family: var(--display);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 0.95;
}
.ticket h1 { margin-top: 8px; font-size: clamp(2.4rem, 4vw, 3.4rem); }
.levels { display: grid; gap: 0; margin: 16px 0 0; }
.levels div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.levels dt { color: var(--faint); font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
.levels dd { margin: 0; font-family: var(--mono); font-size: 1.2rem; letter-spacing: -0.04em; }
.desk { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.desk b {
  display: block;
  margin-bottom: 8px;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-bright);
}
.signal-math, .macro-context, .risk, .stats { margin-top: 14px; }
.signal-math .quiet, .signal-math .meter, .caption { grid-column: 1 / -1; }
.book .risk, .stat, .metric { box-shadow: none; }
.signal-math {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.metric, .stat {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(7, 8, 11, 0.35);
  min-width: 0;
}
.metric strong, .stat strong, .meters dd, .equity, .macro strong, .blotter td.pnl, .trade-head .result {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.metric strong, .stat strong {
  display: block;
  margin-top: 4px;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}
.metric span, .stat span, .metric small, .stat small { overflow-wrap: anywhere; }
.metric small, .stat small { display: block; margin-top: 4px; line-height: 1.35; }
.metric small, .stat small, .macro small, .rows small { color: var(--faint); font-size: 0.82rem; }
.context-line { margin: 8px 0 0; color: var(--ink); }
.meter {
  margin-top: 8px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.meter i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #8c6b1f, #f5d76e);
}
.meter.over i { background: linear-gradient(90deg, #8c2438, #e24b6a); }
.meter.ok i { background: linear-gradient(90deg, #147a52, #3ddc97); }
.risk { padding: 12px 14px; }
.risk-top strong { font-family: var(--mono); font-size: 1rem; }

.highlights {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.highlights article { padding: 14px 16px 12px; box-shadow: none; }
.highlights strong {
  display: block;
  margin-top: 8px;
  font-family: var(--display);
  font-weight: 650;
  font-size: clamp(1.5rem, 2vw, 1.9rem);
  letter-spacing: -0.03em;
  line-height: 1;
}
.highlights small { display: block; margin-top: 8px; color: var(--muted); }

.book, .panel { padding: 20px; }
.book { display: grid; gap: 8px; }
.desk-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.85fr);
  gap: 8px 22px;
  align-items: end;
}
.desk-head .meters { grid-column: 1 / -1; }
.desk-name { font-size: clamp(1.8rem, 3vw, 2.4rem); }
.book.desk-day { box-shadow: inset 0 2px 0 #d4af37, var(--shadow); }
.book.desk-hour { box-shadow: inset 0 2px 0 #3ddc97, var(--shadow); }
.desk-hour .kicker { color: #8ef0c4; }
.equity-label {
  margin: 12px 0 0;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.equity { margin: 0; font-size: clamp(2rem, 4vw, 2.8rem); letter-spacing: -0.05em; }
.meters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 8px 0 0;
}
.meters div {
  min-width: 0;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.meters dt {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.meters dd { margin: 4px 0 0; font-size: 1.15rem; letter-spacing: -0.04em; }
#equity-chart, #hour-equity-chart, #rl-day-curve, #rl-hour-curve { width: 100%; height: 168px; }
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 8px;
}
#rl-stats { grid-template-columns: 1fr 1fr; }
#rl-stats > article {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(7, 8, 11, 0.35);
}
#rl-stats > article > span,
#rl-stats > article > strong,
#rl-stats > article > small {
  display: block;
  overflow-wrap: anywhere;
}
#rl-stats > article > span {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
#rl-stats > article > strong {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.03em;
}
#rl-stats > article > small {
  margin-top: 4px;
  color: var(--faint);
  font-size: 0.82rem;
  line-height: 1.35;
}
#lernkern .spark { margin-top: 16px; }
#lernkern .spark .kicker { margin: 0 0 8px; }
#rl-copy .quiet { margin-top: 12px; }
.caption { margin: 0; }

.watch { overflow-x: auto; }
.watch .kicker { margin: 16px 0 8px; }
.blotter { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.blotter th {
  text-align: left;
  padding: 8px 10px 8px 0;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.blotter th.num, .blotter td.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.blotter td { padding: 11px 10px 11px 0; border-top: 1px solid var(--line); white-space: nowrap; }
.blotter tbody tr { transition: background 0.2s ease; }
.blotter tbody tr:hover { background: rgba(212, 175, 55, 0.045); }
.side.long { color: var(--up); }
.side.short { color: var(--down); }
.cards { display: none; }
.trade-card { padding: 12px 0; border-top: 1px solid var(--line); }
.trade-head .result { font-size: 1.15rem; }
.rail {
  position: relative;
  height: 36px;
  margin: 22px 0 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(226, 75, 106, 0.28), rgba(212, 175, 55, 0.12) 50%, rgba(61, 220, 151, 0.28));
  border: 1px solid var(--line);
}
.rail i, .rail b {
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 0 4px rgba(7, 8, 11, 0.85);
}
.rail i.stop { background: var(--down); }
.rail i.target { background: var(--up); }
.rail b {
  width: auto;
  height: auto;
  margin: 0;
  top: -16px;
  transform: translateX(-50%);
  background: none;
  box-shadow: none;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.proto { margin-top: 8px; }
.proto summary {
  cursor: pointer;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 8px 0;
}
.log { list-style: none; margin: 0; padding: 0; }
.log li { padding: 10px 0; border-top: 1px solid var(--line); }
.log time { display: block; color: var(--faint); font-family: var(--mono); font-size: 12px; }
.log .pnl { margin-left: 8px; }

.duo { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 16px; }
.panel h2 { font-size: clamp(1.8rem, 3vw, 2.5rem); margin: 4px 0 12px; }
.macro { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.macro article { padding: 14px; box-shadow: none; }
.macro strong { display: block; margin-top: 6px; font-size: 1.25rem; font-weight: 500; }
.rows { list-style: none; margin: 8px 0 0; padding: 0; }
.rows li { padding: 12px 0; border-top: 1px solid var(--line); }
.rows a { color: var(--ink); }
.rows a:hover { color: var(--gold-bright); }
.rows small, .macro small { display: block; margin-top: 4px; }

.foot {
  width: min(1440px, calc(100% - 36px));
  margin: 22px auto 0;
  padding: 22px 0 36px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.foot nav { display: flex; gap: 14px; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--gold-bright); }

@media (max-width: 1100px) {
  main { grid-template-columns: minmax(0, 1fr) 320px; }
  .stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .highlights { grid-template-columns: 1fr 1fr; }
  .desk-head, .duo, .macro { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .nav { flex-wrap: wrap; height: auto; padding: 12px 14px; }
  .nav nav { order: 5; width: 100%; margin-left: 0; overflow-x: auto; }
  .mode { margin-left: 0; }
  main, .tape, .highlights { width: min(1440px, calc(100% - 20px)); }
  main { display: block; }
  .hero, .board, .ticket, .book, .duo, .panel { margin-top: 14px; }
  .ticket { position: static; max-height: none; width: auto; }
  main { grid-template-columns: 1fr; }
  .clocks, .foot { width: min(1440px, calc(100% - 20px)); }
  .tape, .highlights, .signal-math { grid-template-columns: 1fr 1fr; }
  .chart-wrap canvas { height: 280px; }
  .book-chart canvas { height: 240px; }
  .stats { grid-template-columns: 1fr 1fr; }
  #lernkern { grid-column: auto; }
  .meters { grid-template-columns: 1fr; }
  .watch .blotter { display: none; }
  .cards { display: block; }
  .legend { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
