/* ──────────────────────────────────────────────────────────
   Page-specific styles (light version).
   ────────────────────────────────────────────────────────── */

.mini-kpi-label {
  font-size: 10.5px; color: var(--text-subtle);
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600;
}
.mini-kpi-value {
  font-family: var(--ff-mono);
  font-size: 20px; font-weight: 600; color: var(--text);
  letter-spacing: -0.01em; line-height: 1.1; margin-top: 2px;
}
.mini-kpi-sub {
  font-size: 11px; color: var(--text-subtle); margin-top: 2px;
  font-family: var(--ff-mono);
}
.mini-kpi-sub.up { color: var(--profit); }

/* ── HOME ───────────────────────────────────────────────── */
.home-modules {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.home-module-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  text-decoration: none; color: var(--text);
  transition: all .15s;
}
.home-module-card:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.home-module-icon {
  width: 36px; height: 36px; border-radius: var(--r-sm);
  background: var(--brand-soft); color: var(--brand-deep);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
}
.home-module-title { font-size: 15px; font-weight: 600; }
.home-module-body { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }

.home-section-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

/* ── HOME HERO ──────────────────────────────────────────── */
.home-hero {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  background: linear-gradient(135deg, var(--surface) 0%, var(--brand-soft) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  position: relative;
}
.home-hero::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--brand) 0%, var(--profit) 100%);
}
.home-hero-left { padding: 26px 28px; }
.home-hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-muted);
  padding: 5px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  margin-bottom: 12px;
}
.home-hero-eyebrow-sep { color: var(--text-subtle); }
.home-hero-title {
  font-size: 32px; font-weight: 700;
  letter-spacing: -0.02em; color: var(--text);
  line-height: 1.15;
}
.home-hero-title .profit-text, .home-hero-title .loss-text {
  font-family: var(--ff-mono);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.home-hero-sub {
  margin-top: 6px; color: var(--text-muted); font-size: 13px;
}
.home-hero-kpis {
  display: flex; gap: 28px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line-accent);
}
.home-hero-right {
  background: var(--surface);
  border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.home-hero-chart-label {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--text-muted);
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--line);
}
.home-hero-chart-label .num {
  color: var(--text); font-weight: 600; font-size: 14px;
}
.home-hero-chart {
  flex: 1; overflow: hidden; min-height: 120px;
}
.home-hero-chart svg { width: 100%; height: 100%; display: block; }

/* Mobile: collapse home-hero to one column and hide the BTC chart — on a
   narrow phone the chart is too small to be useful and competes with the
   key stats for limited vertical real estate. */
@media (max-width: 760px) {
  .home-hero { grid-template-columns: 1fr; }
  .home-hero-right { display: none; }
}

/* ── HOME GRID ──────────────────────────────────────────── */
.home-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
}
/* When the megasweep card is hidden (no active sweep / not available),
   expand the briefing card to full width instead of leaving a dead column. */
.home-grid:has(> [hidden]) { grid-template-columns: 1fr; }
@media (max-width: 760px) { .home-grid { grid-template-columns: 1fr; } }

.briefing-headline {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.briefing-headline:hover { border-color: var(--brand); transform: translateY(-1px); }
.briefing-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.briefing-headline-link {
  font-size: 12px; color: var(--brand); font-weight: 500;
  display: inline-flex; align-items: center; gap: 4px;
  white-space: nowrap;
}
.briefing-headline-title {
  font-size: 18px; font-weight: 600; line-height: 1.3;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}
.briefing-headline-list {
  list-style: none; display: flex; flex-direction: column; gap: 8px;
  color: var(--text-muted); font-size: 13px; line-height: 1.5;
  padding: 0; margin: 0;
}
.briefing-headline-list li {
  display: flex; gap: 10px; align-items: baseline;
}
.briefing-headline-list li span { color: var(--brand); font-weight: 700; flex-shrink: 0; }

.position-card {
  display: flex; flex-direction: column;
}
.position-main {
  display: flex; gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.position-big {
  font-size: 20px; font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin-top: 2px;
}
.position-levels {
  display: flex; flex-direction: column; gap: 0;
  padding-top: 12px;
}
.level-row {
  display: grid;
  grid-template-columns: 10px 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  font-size: 13px;
}
.level-row:not(:last-child) { border-bottom: 1px solid var(--line); }
.level-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.loss-dot   { background: var(--loss); }
.entry-dot  { background: var(--text-subtle); }
.profit-dot { background: var(--profit); }
.level-label { color: var(--text-muted); }
.level-meta {
  font-family: var(--ff-mono);
  font-size: 12px; color: var(--text-subtle);
  min-width: 64px; text-align: right;
}
.profit-text { color: var(--profit); }
.loss-text   { color: var(--loss); }

/* ── SWEEP HOME CARD ────────────────────────────────────── */
.sweep-home-bar {
  height: 6px; background: var(--surface-3);
  border-radius: var(--r-full); overflow: hidden;
}
.sweep-home-bar-fill {
  height: 100%; background: var(--brand);
  border-radius: var(--r-full); transition: width .5s ease;
}
.sweep-home-lb-row {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 12px;
}
.sweep-home-lb-row:last-child { border-bottom: none; }
.sweep-home-lb-rank {
  width: 16px; text-align: center; color: var(--text-subtle);
  font-size: 10px; font-weight: 600; flex-shrink: 0;
}
.sweep-home-lb-label {
  flex: 1; color: var(--text-muted); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--ff-mono); font-size: 11px;
}

/* ── HOME LIVE STATUS ───────────────────────────────────── */
.live-status-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.live-status-title { font-size: 13px; font-weight: 600; }
.live-status-sub   { font-size: 12px; color: var(--text-subtle); }

.live-strat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}
.live-strat-card {
  padding: 16px 20px;
  border-right: 1px solid var(--line);
}
.live-strat-card:last-child { border-right: none; }

.live-strat-loading {
  opacity: 0.4;
  animation: lsc-fade 1.4s ease-in-out infinite;
}
@keyframes lsc-fade {
  0%, 100% { opacity: 0.35; }
  50%       { opacity: 0.65; }
}

.lsc-label   { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--brand-deep); margin-bottom: 6px; }
.lsc-balance { font-size: 20px; font-weight: 600; font-family: var(--ff-mono); letter-spacing: -0.01em; margin-bottom: 8px; }
.lsc-row     { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; font-size: 12px; }
.lsc-key     { color: var(--text-subtle); }
.lsc-val     { font-family: var(--ff-mono); font-size: 12px; color: var(--text); }
.lsc-pnl     { font-family: var(--ff-mono); font-size: 12px; font-weight: 600; }
.lsc-pos     { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: var(--r-full); }
.lsc-pos-long  { background: var(--profit-bg); color: var(--profit); }
.lsc-pos-short { background: var(--loss-bg); color: var(--loss); }
.lsc-pos-flat  { font-size: 11px; color: var(--text-subtle); }

@media (max-width: 700px) {
  .live-strat-grid { grid-template-columns: 1fr; }
  .live-strat-card { border-right: none; border-bottom: 1px solid var(--line); }
  .live-strat-card:last-child { border-bottom: none; }
}

/* ── BRIEFINGS ─────────────────────────────────────────── */
.briefings-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .briefings-layout { grid-template-columns: 1fr; }
}

.briefings-archive {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 14px 18px;
  position: sticky; top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
@media (max-width: 900px) {
  .briefings-archive { position: static; max-height: none; }
}
.briefings-archive-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 4px 10px;
}
.briefings-archive-search { margin-bottom: 14px; }
.briefings-archive-group { margin-bottom: 14px; }
.briefings-archive-month {
  font-size: 10px; color: var(--text-subtle);
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 6px 8px 4px; font-weight: 600;
}
.briefings-archive-list { list-style: none; padding: 0; margin: 0; }
.briefings-archive-list a {
  display: flex; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  text-decoration: none; color: var(--text);
  transition: background .12s;
  border: 1px solid transparent;
  align-items: baseline;
}
.briefings-archive-list a:hover { background: var(--surface-2); }
.briefings-archive-list a.active {
  background: var(--brand-soft);
  border-color: var(--brand-tint);
}
.archive-date {
  font-size: 11px; color: var(--text-muted);
  min-width: 60px; flex-shrink: 0;
  font-family: var(--ff-mono);
}
.briefings-archive-list a.active .archive-date { color: var(--brand-deep); font-weight: 600; }
.briefings-archive-empty { color: var(--text-subtle); font-size: 13px; padding: 8px 10px; }

.briefings-run {
  margin-top: 10px; padding-top: 12px;
  border-top: 1px solid var(--line-accent);
}
.briefings-run-status {
  margin-top: 8px;
  font-size: 12px; color: var(--text-subtle); text-align: center;
}

.briefings-article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 36px 48px 40px;
  min-width: 0;
}
@media (max-width: 700px) {
  .briefings-article { padding: 20px; }
}
.briefings-article > h1,
.briefings-article > h2 {
  font-size: 24px; font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-accent);
}
.briefings-article h3 {
  font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--brand-deep);
  font-weight: 700;
  margin: 24px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-accent);
}
.briefings-article p {
  font-size: 14.5px; line-height: 1.7;
  color: var(--text);
  margin: 10px 0;
}
.briefings-article ul, .briefings-article ol {
  margin: 10px 0 10px 24px;
  line-height: 1.7;
}
.briefings-article li { margin: 4px 0; }
.briefings-article a { color: var(--brand); text-decoration: none; }
.briefings-article a:hover { text-decoration: underline; }
.briefings-article code {
  background: var(--surface-2); padding: 1px 6px; border-radius: 4px;
  font-family: var(--ff-mono); font-size: 12.5px; color: var(--text);
}
.briefings-article blockquote {
  margin: 18px 0; padding: 14px 20px;
  border-left: 3px solid var(--warn-solid);
  background: var(--warn-bg);
  color: var(--text);
  font-size: 14.5px; line-height: 1.55; font-style: italic;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.briefings-article strong { color: var(--text); font-weight: 600; }
.briefings-article em { color: var(--text-muted); font-style: italic; }
.briefings-article hr { border: none; border-top: 1px solid var(--line); margin: 20px 0; }
.briefings-article table {
  width: 100%; border-collapse: collapse; margin: 14px 0;
  font-size: 13px;
}
.briefings-article th, .briefings-article td {
  padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left;
}
.briefings-article th {
  font-size: 11px; color: var(--text-subtle); text-transform: uppercase;
  letter-spacing: 0.06em; background: var(--surface-2);
}

.briefings-empty-hint {
  color: var(--text-subtle); font-style: italic; text-align: center;
  padding: 80px 20px;
}

/* ── BRIEFINGS: Structured overlays ─────────────────────── */
.briefing-summary-callout {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-tint);
  border-radius: var(--r-sm);
  padding: 12px 16px;
  margin-bottom: 20px;
  color: var(--text);
  font-size: 13.5px; line-height: 1.6;
}
.briefing-summary-callout svg { flex-shrink: 0; margin-top: 2px; color: var(--brand); }

.briefing-btc-tiles {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-bottom: 18px;
}
.btc-kpi-tile {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 8px 14px; min-width: 120px;
}
.btc-kpi-key {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.09em; color: var(--text-subtle); margin-bottom: 4px;
}
.btc-kpi-val {
  font-size: 13px; font-weight: 600; color: var(--text);
  font-family: var(--ff-mono); letter-spacing: -0.01em;
}
.btc-kpi-val.btc-bull { color: var(--profit); }
.btc-kpi-val.btc-bear { color: var(--loss); }
.btc-kpi-val.btc-neutral { color: var(--warn); }

.briefing-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 24px;
}

.briefing-body { /* main article content wrapper */ }
.briefing-body > h1:first-child { margin-top: 0; }

.briefing-connections {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.briefing-connection-card {
  background: var(--warn-bg);
  border-left: 3px solid var(--warn-solid);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: 12px 16px;
  font-size: 13.5px; line-height: 1.65; color: var(--text);
  margin-bottom: 12px;
}

/* apply article prose styles to .briefing-body children */
.briefing-body h1, .briefing-body h2 {
  font-size: 24px; font-weight: 700;
  letter-spacing: -0.02em; line-height: 1.2; color: var(--text);
  margin: 28px 0 14px; padding-bottom: 10px;
  border-bottom: 1px solid var(--line-accent);
}
.briefing-body h3 {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--brand-deep); font-weight: 700;
  margin: 24px 0 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line-accent);
}
.briefing-body p { font-size: 14.5px; line-height: 1.7; color: var(--text); margin: 10px 0; }
.briefing-body ul, .briefing-body ol { margin: 10px 0 10px 24px; line-height: 1.7; }
.briefing-body li { margin: 4px 0; }
.briefing-body a { color: var(--brand); text-decoration: none; }
.briefing-body a:hover { text-decoration: underline; }
.briefing-body strong { color: var(--text); font-weight: 600; }
.briefing-body em { color: var(--text-muted); font-style: italic; }
.briefing-body hr { border: none; border-top: 1px solid var(--line); margin: 20px 0; }
.briefing-body blockquote {
  margin: 18px 0; padding: 14px 20px;
  border-left: 3px solid var(--warn-solid);
  background: var(--warn-bg); color: var(--text);
  font-size: 14.5px; line-height: 1.55; font-style: italic;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.briefing-body code {
  background: var(--surface-2); padding: 1px 6px; border-radius: 4px;
  font-family: var(--ff-mono); font-size: 12.5px; color: var(--text);
}
.briefing-body table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 13px; }
.briefing-body th, .briefing-body td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.briefing-body th {
  font-size: 11px; color: var(--text-subtle); text-transform: uppercase;
  letter-spacing: 0.06em; background: var(--surface-2);
}

/* ── WISSEN ─────────────────────────────────────────────── */
.wissen-searchbar {
  display: flex; gap: 14px; align-items: center;
  margin-top: 4px;
  flex-wrap: wrap;
}

.wissen-group-label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 11px; font-weight: 600;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.wissen-group-label .count { color: var(--text-subtle); font-weight: 500; letter-spacing: 0; font-family: var(--ff-mono); }
.wissen-group { margin-bottom: 28px; }
.wissen-group.hidden { display: none; }

.wissen-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.wissen-cards.compact {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.wissen-card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
  transition: all .15s;
  position: relative;
}
.wissen-card:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.wissen-card.hidden { display: none; }
.wissen-card-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 10px;
}
.wissen-card-term {
  font-size: 16px; font-weight: 600; color: var(--text);
  letter-spacing: -0.01em;
}
.wissen-card-fullname {
  font-size: 11.5px; color: var(--text-subtle);
  margin-top: 2px;
}
.wissen-card-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.wissen-card-short {
  font-size: 13px; line-height: 1.5; color: var(--text-muted);
}
.wissen-card-foot {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--brand);
  margin-top: auto;
  padding-top: 6px;
  opacity: 0; transition: opacity .15s;
  font-weight: 500;
}
.wissen-card:hover .wissen-card-foot { opacity: 1; }

.wissen-strat-score {
  display: flex; align-items: baseline;
  padding: 4px 10px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-tint);
  border-radius: var(--r-full);
  color: var(--brand-deep);
  flex-shrink: 0;
}
.score-num { font-size: 14px; font-weight: 700; font-family: var(--ff-mono); }
.score-max { font-size: 10px; color: var(--text-subtle); margin-left: 2px; font-family: var(--ff-mono); }

.wissen-iframe-wrap {
  width: 100%;
  height: calc(100vh - 200px);
  border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden;
  background: var(--surface);
}
.wissen-iframe-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }

.wissen-empty { color: var(--text-subtle); text-align: center; padding: 40px 20px; font-style: italic; }

/* ── WISSEN DETAIL ──────────────────────────────────────── */
.detail-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 20px;
  margin-top: -4px;
}
.detail-fullname {
  font-size: 14px; color: var(--text-muted);
  margin-bottom: 10px;
}
.detail-chiprow { display: flex; flex-wrap: wrap; gap: 6px; }

.detail-lede {
  display: flex; gap: 14px;
  padding: 16px 20px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-tint);
  border-left: 3px solid var(--brand);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 14.5px; line-height: 1.55;
}
.detail-lede svg { color: var(--brand-deep); flex-shrink: 0; margin-top: 2px; }

.detail-chart-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
  padding: 4px 6px;
  flex-wrap: wrap; gap: 10px;
}

.detail-legend {
  display: flex; gap: 16px;
  font-size: 12px; color: var(--text-muted);
  padding: 10px 6px 2px;
  flex-wrap: wrap;
}
.legend-swatch {
  display: inline-block; width: 14px; height: 3px; border-radius: 2px;
  margin-right: 6px; vertical-align: middle;
}

.detail-chart-box {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 12px;
}
.chart-container { width: 100%; }
.chart-price    { height: 320px; }
.chart-subpanel { height: 160px; margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
.chart-loading, .chart-error {
  color: var(--text-subtle); font-style: italic; padding: 24px 4px;
  text-align: center; font-size: 13px;
}
.chart-error { color: var(--loss); }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 28px;
}
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }

.detail-md h1, .detail-md h2, .detail-md h3, .detail-md h4 {
  margin-top: 22px; margin-bottom: 10px; line-height: 1.3;
}
.detail-md h2 { font-size: 18px; padding-bottom: 6px; border-bottom: 1px solid var(--line); font-weight: 600; }
.detail-md h3 {
  font-size: 12px; color: var(--brand-deep);
  text-transform: uppercase; letter-spacing: 0.1em;
  font-weight: 700;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-accent);
}
.detail-md p {
  font-size: 14.5px; line-height: 1.7;
  color: var(--text); margin: 10px 0;
}
.detail-md ul, .detail-md ol {
  padding-left: 6px; list-style: none;
  display: flex; flex-direction: column; gap: 8px;
  margin: 12px 0;
}
.detail-md li {
  position: relative; padding-left: 20px;
  font-size: 14px; line-height: 1.55;
  color: var(--text);
}
.detail-md li::before {
  content: '→'; position: absolute; left: 0; top: 0;
  color: var(--brand); font-weight: 700;
}
.detail-md code {
  background: var(--surface-2); padding: 2px 6px; border-radius: 4px;
  font-family: var(--ff-mono); font-size: 12.5px; color: var(--text);
}
.detail-md pre {
  background: var(--surface-2); padding: 12px 14px; border-radius: 6px;
  overflow-x: auto; margin: 12px 0;
}
.detail-md pre code { background: none; padding: 0; font-size: 12.5px; }
.detail-md a { color: var(--brand); text-decoration: none; }
.detail-md a:hover { text-decoration: underline; }
.detail-md table {
  border-collapse: collapse; margin: 12px 0; width: 100%; font-size: 13px;
}
.detail-md th, .detail-md td {
  padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left;
}
.detail-md th {
  font-size: 11px; color: var(--text-subtle); text-transform: uppercase;
  letter-spacing: 0.06em; background: var(--surface-2);
}

.detail-side { display: flex; flex-direction: column; gap: 12px; }
.side-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
}
.side-card h4 {
  font-size: 11px; font-weight: 600;
  color: var(--text-subtle);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 12px;
}
.side-params {
  width: 100%; border-collapse: collapse; font-size: 12.5px;
}
.side-params td { padding: 3px 0; vertical-align: top; }
.side-params .p-name { color: var(--text); font-weight: 600; font-family: var(--ff-mono); }
.side-params .p-default { color: var(--warn); font-family: var(--ff-mono); }
.side-params .p-desc {
  color: var(--text-muted); line-height: 1.45;
  padding-bottom: 10px; border-bottom: 1px solid var(--line);
  padding-top: 2px;
}
.side-params tr:last-child .p-desc { border: none; }

.side-list { list-style: none; display: flex; flex-direction: column; gap: 8px; padding: 0; margin: 0; }
.side-list a {
  color: var(--brand); text-decoration: none; font-size: 12.5px;
  display: inline-flex; align-items: center; gap: 6px;
}
.side-list a:hover { text-decoration: underline; }
.side-list code { font-family: var(--ff-mono); font-size: 11.5px; color: var(--text-muted); background: var(--surface-2); padding: 1px 5px; border-radius: 3px; }
.side-list li { line-height: 1.5; }

/* ── WISSEN STRATEGY ─────────────────────────────────────── */
.strat-score-big {
  padding: 14px 18px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-tint);
  border-radius: var(--r-md);
  text-align: center;
  min-width: 130px;
  flex-shrink: 0;
}
.score-big-num {
  font-size: 32px; font-weight: 700; color: var(--brand-deep);
  letter-spacing: -0.02em; line-height: 1;
  font-family: var(--ff-mono);
}
.score-big-num span {
  font-size: 14px; color: var(--text-subtle);
}
.score-big-label {
  font-size: 10px; color: var(--text-subtle);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-top: 4px; font-weight: 600;
}

.strat-section { margin-top: 8px; }
.strat-section .section-label { margin-bottom: 10px; }
.strat-twocol {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
@media (max-width: 720px) { .strat-twocol { grid-template-columns: 1fr; } }
.rule-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 18px;
}
.rule-card h4 {
  font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 600;
}
.rule-card ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0; }
.rule-card li {
  font-size: 13.5px; line-height: 1.5; color: var(--text);
  padding: 8px 0 8px 22px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.rule-card li:last-child { border: none; padding-bottom: 0; }
.rule-card li::before {
  content: '→'; position: absolute; left: 0; top: 8px;
  color: var(--brand); font-weight: 700;
}
.rule-card.pros li::before { content: '+'; color: var(--profit); }
.rule-card.cons li::before { content: '−'; color: var(--loss); }

.relevance-card {
  display: flex; gap: 14px;
  background: var(--warn-bg);
  border: 1px solid transparent;
  border-left: 3px solid var(--warn-solid);
  padding: 16px 20px;
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 14px; line-height: 1.55;
}
/* langer notes/verdict-Text darf den Flex-Container nicht sprengen */
.relevance-card > div { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.relevance-title { font-weight: 700; font-size: 13px; margin-bottom: 4px; color: var(--text); }

.perf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.perf-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
}
.perf-tile .k {
  font-size: 10px; color: var(--text-subtle);
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600;
}
.perf-tile .v {
  font-size: 17px; font-weight: 600;
  color: var(--text); margin-top: 6px;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.concept-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 20px;
  font-size: 14px; line-height: 1.65;
  color: var(--text);
}

/* ── PRODUCT ─────────────────────────────────────────────── */
.product-tabpanes { display: contents; }
.product-tabpane { display: none; }
.product-tabpane.active { display: block; }

.product-md h1, .product-md h2, .product-md h3, .product-md h4 {
  margin-top: 20px; margin-bottom: 10px; line-height: 1.3;
}
.product-md h1 {
  font-size: 20px; border-bottom: 1px solid var(--line); padding-bottom: 8px; font-weight: 700;
}
.product-md h2 { font-size: 16px; color: var(--text); font-weight: 600; }
.product-md h3 {
  font-size: 11px; color: var(--brand-deep);
  text-transform: uppercase; letter-spacing: 0.1em;
  font-weight: 700; padding-bottom: 6px;
  border-bottom: 1px solid var(--line-accent);
}
.product-md p  { margin: 10px 0; line-height: 1.6; font-size: 14px; }
.product-md ul, .product-md ol { margin: 10px 0 10px 24px; line-height: 1.7; }
.product-md li input[type="checkbox"] { margin-right: 8px; }
.product-md li { margin: 4px 0; }
.product-md code {
  background: var(--surface-2); padding: 2px 6px; border-radius: 4px;
  font-family: var(--ff-mono); font-size: 12.5px; color: var(--text);
}
.product-md pre {
  background: var(--surface-2); padding: 12px 14px; border-radius: 6px;
  overflow-x: auto; margin: 12px 0;
}
.product-md pre code { background: none; padding: 0; font-size: 12.5px; }
.product-md a { color: var(--brand); text-decoration: none; }
.product-md a:hover { text-decoration: underline; }
.product-md table { border-collapse: collapse; margin: 12px 0; width: 100%; font-size: 13px; }
.product-md th, .product-md td {
  padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left;
}
.product-md th { background: var(--surface-2); font-weight: 600; color: var(--text-subtle); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.product-md em { color: var(--text-muted); font-style: italic; }
.product-md hr { border: none; border-top: 1px solid var(--line); margin: 20px 0; }
.product-md strong { color: var(--text); font-weight: 600; }

/* Memory */
.memory-layout { display: grid; grid-template-columns: 260px 1fr; gap: 16px; }
@media (max-width: 800px) { .memory-layout { grid-template-columns: 1fr; } }
.memory-list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 8px;
  height: fit-content;
}
.memory-list .item {
  display: block; padding: 8px 12px; border-radius: var(--r-sm); cursor: pointer;
  color: var(--text-muted); text-decoration: none; font-size: 13px;
  border: 1px solid transparent;
}
.memory-list .item:hover { background: var(--surface-2); color: var(--text); }
.memory-list .item.active { background: var(--brand-soft); color: var(--brand-deep); border-color: var(--brand-tint); }
.memory-list .group-label {
  font-size: 10px; font-weight: 600; color: var(--text-subtle);
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 14px 12px 6px; border-top: 1px solid var(--line); margin-top: 6px;
}
.memory-list .group-label:first-child { border-top: none; margin-top: 0; padding-top: 4px; }

/* Journal */
.journal-filter {
  display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap;
}
.journal-filter .botty-input { flex: 1; min-width: 200px; }
.journal-filter select {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  color: var(--text); padding: 8px 12px; font-size: 13px; font-family: inherit;
  outline: none;
}
.journal-filter select:focus { border-color: var(--brand); }

.journal-list { display: flex; flex-direction: column; }
.journal-entry {
  display: grid; grid-template-columns: 18px 1fr;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.journal-entry:last-child { border-bottom: none; }
.journal-rail {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
}
.journal-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--brand);
  margin-top: 6px;
  box-shadow: 0 0 0 3px var(--brand-soft);
  flex-shrink: 0;
}
.journal-line {
  width: 1px; flex: 1;
  background: var(--line);
  margin-top: 4px;
}
.journal-head {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin-bottom: 6px;
}
.journal-id { font-size: 11px; color: var(--text-subtle); font-family: var(--ff-mono); }
.journal-ts { font-size: 11px; color: var(--text-subtle); font-family: var(--ff-mono); }
.journal-title { font-size: 14px; font-weight: 600; color: var(--text); }
.journal-what { font-size: 13.5px; line-height: 1.55; color: var(--text-muted); margin-top: 4px; }
.journal-what strong { color: var(--text); font-weight: 600; }
.journal-entry details { margin-top: 6px; }
.journal-entry summary {
  cursor: pointer; color: var(--brand); font-size: 12px; user-select: none; font-weight: 500;
}
.journal-entry details[open] summary { color: var(--brand-deep); }
.journal-entry .journal-more { margin-top: 6px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-muted); line-height: 1.55; }

.journal-empty { color: var(--text-subtle); text-align: center; padding: 40px 20px; font-style: italic; }

/* ── MARKT ──────────────────────────────────────────────── */
.markt-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 32px;
  padding: 24px 28px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--brand-soft) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  position: relative;
  overflow: hidden;
}
.markt-hero::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--brand) 0%, var(--profit) 100%);
}
.markt-hero-price { min-width: 180px; }
.markt-hero-price .botty-kpi-label {
  font-size: 10.5px; color: var(--text-subtle);
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600;
  margin-bottom: 4px;
}
.markt-hero-price .botty-kpi-value {
  font-size: 34px; font-weight: 700; color: var(--text);
  font-family: var(--ff-mono); letter-spacing: -0.02em; line-height: 1.1;
}
.markt-hero-price .botty-kpi-delta {
  margin-top: 4px; font-family: var(--ff-mono); font-size: 14px; font-weight: 600;
}
.markt-hero-stats {
  display: flex; gap: 32px; flex-wrap: wrap; align-items: center;
}
@media (max-width: 700px) {
  .markt-hero {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 18px 18px;
  }
  .markt-hero-price { min-width: 0; }
  .markt-hero-price .botty-kpi-value { font-size: 26px; }
  .markt-hero-stats { gap: 18px; }
  .markt-stat-val { font-size: 13.5px; }
}
.markt-stat-label {
  font-size: 10.5px; color: var(--text-subtle);
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600;
  margin-bottom: 3px;
}
.markt-stat-val {
  font-size: 15px; font-weight: 600; color: var(--text);
  font-family: var(--ff-mono);
}

.markt-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 900px) { .markt-grid-2 { grid-template-columns: 1fr; } }

.markt-chart-box {
  height: 180px;
  margin-top: 8px;
  position: relative;
}

.markt-opts-svg-wrap {
  width: 100%; height: 440px; margin-top: 12px;
  overflow: hidden;
}

.markt-liqmap-wrap {
  width: 100%; overflow: hidden;
  margin-top: 4px;
}

.impact-high   { color: var(--loss);         font-weight: 600; }
.impact-medium { color: var(--warn-solid, #F5A623); font-weight: 500; }
.impact-low    { color: var(--text-subtle); }

.cal-filter-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-subtle);
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  text-transform: uppercase;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.cal-filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.cal-filter-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.cal-filter-btn[data-impact="high"].active   { background: var(--loss);   border-color: var(--loss); }
.cal-filter-btn[data-impact="medium"].active { background: var(--warn-solid, #F5A623); border-color: var(--warn-solid, #F5A623); color: #111; }
.cal-filter-btn[data-impact="low"].active    { background: var(--text-subtle); border-color: var(--text-subtle); }

.cal-flag-btn { padding: 3px 6px; line-height: 0; }
.cal-flag-btn img,
.cal-flag-btn svg { display: inline-block; vertical-align: middle; border-radius: 2px; }
.cal-flag-btn:not(.active) img { filter: saturate(0.85); opacity: 0.85; }
.cal-flag-btn:hover img { filter: none; opacity: 1; }
.cal-flag-btn.active { box-shadow: 0 0 0 2px var(--accent); }
.cal-flag-btn.active img { filter: none; opacity: 1; }

.markt-unavail {
  padding: 32px 20px; text-align: center;
  color: var(--text-subtle); font-size: 13px; font-style: italic;
}

@media (max-width: 700px) {
  .markt-hero { grid-template-columns: 1fr; gap: 20px; }
  .markt-hero-stats { gap: 18px; }
}

/* ── ML / Pattern Discovery ───────────────────────────── */

.botty-page-title {
  font-size: 22px; font-weight: 700; letter-spacing: -0.01em;
  color: var(--text); margin: 0;
}
.botty-page-sub {
  margin-top: 4px;
  font-size: 12.5px; color: var(--text-muted);
}

.ml-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 1000px) {
  .ml-layout { grid-template-columns: 1fr; }
}

.ml-sidebar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px;
  position: sticky; top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
@media (max-width: 1000px) {
  .ml-sidebar { position: static; max-height: none; }
}

.ml-side-section {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 6px 8px;
  font-size: 10px; color: var(--text-subtle);
  text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600;
}
.ml-side-section .num {
  font-family: var(--ff-mono); font-size: 11px;
  color: var(--text-subtle);
}

.ml-side-link {
  display: block;
  padding: 10px 12px;
  margin-bottom: 4px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  text-decoration: none; color: var(--text);
  transition: background .12s, border-color .12s;
}
.ml-side-link:hover { background: var(--surface-2); }
.ml-side-link.active {
  background: var(--brand-soft);
  border-color: var(--brand-tint);
}
.ml-side-link-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px;
}
.ml-side-link-title {
  font-size: 13px; font-weight: 600; color: var(--text);
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ml-side-link.active .ml-side-link-title { color: var(--brand-deep); }
.ml-side-link-meta {
  display: flex; gap: 6px; margin-top: 4px;
  font-size: 10.5px; color: var(--text-subtle);
}
.ml-side-link-sub {
  margin-top: 4px;
  font-size: 11.5px; color: var(--text-muted);
  line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.ml-side-empty {
  padding: 16px; color: var(--text-subtle);
  font-size: 12px; line-height: 1.5;
}
.ml-side-empty code {
  background: var(--surface-2); padding: 1px 5px;
  border-radius: 3px; font-family: var(--ff-mono); font-size: 11px;
}

.ml-date {
  font-family: var(--ff-mono);
  font-size: 10.5px; color: var(--text-subtle);
}
.ml-tag {
  font-size: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: var(--r-full);
  color: var(--text-muted);
}

.ml-pill {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--r-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.ml-pill-lg { font-size: 11px; padding: 4px 12px; }
.ml-pill-info    { background: var(--brand-soft); color: var(--brand-deep); border: 1px solid var(--brand-tint); }
.ml-pill-good    { background: rgba(51,214,170,0.12); color: var(--profit); border: 1px solid rgba(51,214,170,0.3); }
.ml-pill-warn    { background: #FFF6DF; color: #8B6B00; border: 1px solid #F5DC7C; }
.ml-pill-bad     { background: rgba(220,53,69,0.10); color: var(--loss); border: 1px solid rgba(220,53,69,0.3); }
.ml-pill-neutral { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--line); }

.ml-article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 32px 40px 40px;
  min-width: 0;
}
@media (max-width: 700px) {
  .ml-article { padding: 20px; }
}

.ml-art-head { margin-bottom: 24px; }
.ml-art-title-row {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 8px;
}
.ml-art-title-row h2 {
  font-size: 24px; font-weight: 700;
  letter-spacing: -0.01em; color: var(--text);
  margin: 0;
}
.ml-art-meta {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-bottom: 16px;
}

.ml-callout {
  margin: 10px 0;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  border-left: 3px solid var(--brand);
  background: var(--brand-soft);
  font-size: 13.5px; line-height: 1.6;
  color: var(--text);
}
.ml-callout-label {
  font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.1em; font-weight: 700;
  color: var(--brand-deep); margin-bottom: 4px;
}
.ml-callout-verdict {
  border-left-color: var(--profit);
  background: rgba(51,214,170,0.08);
}
.ml-callout-verdict .ml-callout-label { color: var(--profit); }

.ml-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin: 16px 0 4px;
}
.ml-metric-tile {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 14px;
}
.ml-metric-label {
  font-size: 10px; color: var(--text-subtle);
  text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 600;
}
.ml-metric-value {
  font-family: var(--ff-mono);
  font-size: 15px; font-weight: 600;
  color: var(--text);
  margin-top: 2px;
  letter-spacing: -0.01em;
}

.ml-art-body img {
  max-width: 100%; height: auto;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  margin: 12px 0;
  display: block;
}
.ml-art-body h1 {
  font-size: 22px; font-weight: 700; margin: 18px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-accent);
}
.ml-art-body h2 {
  font-size: 17px; font-weight: 700;
  margin: 24px 0 10px;
  color: var(--text);
}
.ml-art-body h3 {
  font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--brand-deep);
  font-weight: 700;
  margin: 18px 0 8px;
}
.ml-art-body p {
  font-size: 14px; line-height: 1.7;
  color: var(--text); margin: 8px 0;
}
.ml-art-body ul, .ml-art-body ol {
  margin: 8px 0 8px 24px; line-height: 1.7;
}
.ml-art-body code {
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--ff-mono); font-size: 12.5px;
}
.ml-art-body pre {
  background: var(--surface-2);
  padding: 12px 14px;
  border-radius: var(--r-sm);
  font-family: var(--ff-mono); font-size: 12px;
  overflow-x: auto;
  border: 1px solid var(--line);
}
.ml-art-body blockquote {
  margin: 14px 0; padding: 10px 16px;
  border-left: 3px solid var(--brand-tint);
  background: var(--brand-soft);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: 13.5px; color: var(--text);
}
.ml-art-body table {
  width: 100%; border-collapse: collapse;
  margin: 14px 0; font-size: 12.5px;
}
.ml-art-body th, .ml-art-body td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.ml-art-body th {
  font-size: 11px;
  background: var(--surface-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
}
.ml-art-body tr:hover td { background: var(--surface-2); }

.ml-empty-hint {
  color: var(--text-subtle); font-style: italic;
  text-align: center; padding: 60px 20px;
}
.ml-empty-hint pre {
  display: inline-block;
  background: var(--surface-2); padding: 6px 12px;
  border-radius: var(--r-sm); font-size: 12px;
  margin-top: 8px; font-style: normal;
}
