:root {
  --bg: #cfc8bc;
  --card: #fbfaf7;
  --ink: #1c1916;
  --muted: #8a847b;
  --line: #e4dfd6;
  --blue: #2f6bff;
  --orange: #e07a3a;
  --yellow: #e2b43a;
  --pink: #e25b8d;
  --up: #2f6bff;
  --down: #e07a3a;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
  --sans: "Segoe UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  --serif: Georgia, "Iowan Old Style", Palatino, "Palatino Linotype", serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 13px; }
button, input, select { font-family: inherit; color: inherit; }
#app { height: 100%; display: flex; flex-direction: column; min-height: 0; }
#strip {
  display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center;
  padding: 10px 14px 0;
}
.brand { letter-spacing: 0.16em; font-size: 12px; font-weight: 650; }
.pill, .metric {
  border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 3px 8px; font-size: 11px; letter-spacing: 0.06em;
}
.metric { display: flex; gap: 6px; letter-spacing: 0; }
.k { color: var(--muted); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.up { color: var(--up); }
.down { color: var(--down); }
.book-switch { display: flex; gap: 4px; }
.book-switch button {
  border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 3px 8px; font-size: 11px; letter-spacing: 0.04em; cursor: pointer;
}
.book-switch button.on { border-color: var(--ink); background: var(--ink); color: #fbfaf7; }
.strip-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
#btn-halt {
  background: transparent; border: 1px solid #e7b2a2; color: #b42318;
  border-radius: 999px; padding: 4px 10px; cursor: pointer;
}
#btn-resume {
  border: 1px solid #1f7a4d; background: #1f7a4d; color: #fbfaf7;
  border-radius: 999px; padding: 4px 10px; font-size: 11px; letter-spacing: 0.06em;
  cursor: pointer;
}
#btn-halt[hidden],
#btn-resume[hidden] { display: none; }
#btn-tds { border-color: var(--ink); background: var(--ink); color: #fbfaf7; font-weight: 650; letter-spacing: 0.12em; }
#btn-admin, #btn-yield, #btn-field, #btn-account, #btn-tds {
    border: 1px solid var(--line); background: var(--card); color: var(--ink);
    border-radius: 999px; padding: 4px 10px; font-size: 11px; letter-spacing: 0.06em;
    text-decoration: none; cursor: pointer;
  }
#btn-account {
  max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border-color: var(--ink);
}
  #btn-yield[href="/yield"] { border-color: var(--ink); }
.lang-switch {
  display: flex; border: 1px solid var(--line); background: var(--card);
  border-radius: 999px; overflow: hidden;
}
.lang-switch button {
  border: 0; background: transparent; color: var(--muted);
  padding: 4px 8px; font-size: 11px; cursor: pointer;
}
.lang-switch button.on { background: var(--ink); color: #fbfaf7; }
.signal-tf select {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: 4px 8px; font-size: 11px; cursor: pointer;
}
#signal-tf-wrap[hidden] { display: none; }
html[lang="zh-CN"] .pill,
html[lang="zh-CN"] .k,
html[lang="zh-CN"] h3,
html[lang="zh-CN"] .tag,
html[lang="zh-CN"] #btn-resume,
html[lang="zh-CN"] #btn-admin,
html[lang="zh-CN"] #btn-yield,
html[lang="zh-CN"] #btn-field,
html[lang="zh-CN"] #btn-account,
html[lang="zh-CN"] #btn-halt {
  letter-spacing: 0;
  text-transform: none;
}
html[lang="zh-CN"] .feature-title { font-family: var(--sans); font-weight: 650; }
html[lang="zh-CN"] .dot-tip .tip { width: 280px; }
#reason { margin: 8px 14px 0; color: #9a5b12; }
#desk {
  flex: 1; min-height: 0; display: grid;
  grid-template-columns: minmax(280px, 3fr) minmax(0, 7fr);
  gap: 14px; padding: 12px 16px 16px;
}
#board { min-width: 0; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
#panel { min-width: 0; min-height: 0; overflow: auto; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 14px 16px; box-shadow: var(--shadow);
}
.card-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; margin-bottom: 10px; }
h2, h3 { margin: 0; font-size: 13px; font-weight: 600; }
h3 { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(220px, 0.8fr); gap: 16px; align-items: stretch; }
.kicker { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.equity { font-family: var(--serif); font-size: 64px; line-height: 0.92; letter-spacing: -0.04em; font-weight: 500; }
.sub { margin-top: 8px; color: #5e594f; font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
  border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; min-width: 92px;
  background: #f7f4ee;
}
.chip b { display: block; font-variant-numeric: tabular-nums; }
.chip span { color: var(--muted); font-size: 11px; }
.feature { border-left: 1px solid var(--line); padding-left: 16px; display: flex; flex-direction: column; min-width: 0; }
.feature-top { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; letter-spacing: 0.08em; }
.feature-title { font-family: var(--serif); font-size: 28px; margin: 6px 0 2px; }
.feature-title.yellow { color: #a88416; }
.feature-title.pink { color: var(--pink); }
#chart { cursor: crosshair; }
.feature-meta { color: var(--muted); min-height: 18px; }
#spark { width: 100%; height: 86px; display: block; margin-top: 6px; }
.lattice { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 12px; min-height: 210px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; align-content: start; }
.stats div b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; font-weight: 600; }
.stats div span { color: var(--muted); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
#lattice { width: 100%; height: 210px; display: block; }
.fold > summary { list-style: none; cursor: pointer; margin: 0; align-items: center; flex-wrap: wrap; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after { content: '›'; color: var(--muted); font-size: 16px; line-height: 1; transition: transform 0.15s; }
.fold[open] > summary { margin-bottom: 8px; }
.fold[open] > summary::after { transform: rotate(90deg); }
.fold-sum { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.fold-sum b { font-weight: 600; }
.fold-note { margin-bottom: 8px; }
.fold .lattice { display: block; min-height: 0; }
.fold .stats { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.fold .stats div b { font-size: 13px; }
.fold .stats div span { font-size: 10px; }
.fold #lattice { height: 120px; }
.legend-dots { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: center; }
.dot-tip { position: relative; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: default; }
.dot-tip .swatch { width: 14px; height: 14px; }
.dot-tip b { font-weight: 650; }
.dot-tip .tip {
  display: none; position: absolute; left: 0; top: calc(100% + 8px); z-index: 8; width: 230px;
  background: var(--ink); color: #fbfaf7; border-radius: 10px; padding: 8px 10px;
  font-size: 12px; line-height: 1.35; font-weight: 450;
}
.dot-tip:hover .tip, .dot-tip:focus .tip, .dot-tip:focus-within .tip { display: block; }
.swatch { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.swatch.yellow { background: var(--yellow); }
.swatch.pink { background: var(--pink); }
.swatch.blue { background: var(--blue); }
.swatch.orange { background: var(--orange); }
.swatch.ink { background: var(--ink); }
#positions { margin-top: 12px; }
.pos {
  display: grid; grid-template-columns: 72px 64px 1fr 1fr 1fr 1fr; gap: 8px;
  padding: 7px 0; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums;
}
.pos-hold { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.pos-close {
  grid-column: 1 / -1; justify-self: start; margin-top: 2px;
  border: 1px solid var(--ink); background: transparent; color: var(--ink);
  border-radius: 999px; padding: 3px 10px; font-size: 11px; cursor: pointer;
}
.pos-close:disabled { opacity: 0.5; cursor: wait; }
.checked-menu { position: relative; }
.checked-menu summary {
  list-style: none; cursor: pointer; display: flex; gap: 6px; align-items: center;
  border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 3px 10px; font-size: 11px; white-space: nowrap;
}
.checked-menu summary::-webkit-details-marker { display: none; }
.checked-menu summary::after {
  content: ""; width: 0; height: 0; margin-left: 2px;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid var(--muted);
}
.checked-menu[open] summary::after { transform: rotate(180deg); }
#checked { font-weight: 650; font-variant-numeric: tabular-nums; }
.checked-list {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 190px;
  max-height: 320px; overflow: auto; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 6px; box-shadow: 0 10px 28px rgba(28, 25, 22, 0.12);
}
.checked-row { display: flex; gap: 8px; align-items: center; padding: 4px 6px; }
.checked-row button {
  border: 0; background: transparent; padding: 0; cursor: pointer; font-weight: 650;
}
.setup-cols { display: grid; grid-template-columns: 0.9fr 0.8fr 1.3fr; gap: 12px; }
.opp-split { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#opportunity-zone h4 { margin: 0 0 6px; font-size: 12px; font-weight: 650; }
.opp-row {
  display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center;
  border: 1px solid var(--line); border-radius: 10px; padding: 5px 8px; background: #fff;
  font-size: 12px;
}
.opp-row input { margin: 0; }
.opp-row b { min-width: 52px; }
.opp-row span { color: var(--muted); font-variant-numeric: tabular-nums; }
.opp-row.stale { background: #f6f3ed; }
.col-note { margin: 0 0 8px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.col-list { max-height: 320px; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.setup, .scan-row {
  display: flex; gap: 8px; align-items: baseline; justify-content: space-between;
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 5px 8px;
  cursor: pointer; background: #fff; text-align: left;
}
.scan-row b { min-width: 48px; }
.scan-row span, .setup span { color: var(--muted); font-variant-numeric: tabular-nums; }
.fold .setup-cols { display: block; }
.subfold > summary { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); list-style: none; cursor: pointer; }
.subfold > summary::-webkit-details-marker { display: none; }
.subfold > summary::after { content: '›'; color: var(--muted); font-size: 14px; line-height: 1; transition: transform 0.15s; }
.subfold[open] > summary::after { transform: rotate(90deg); }
.subfold h3 { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink); }
.sub-count { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.subfold[open] { padding-bottom: 8px; }
.fold .opp-split { grid-template-columns: 1fr; }
.fold .col-list { max-height: 200px; gap: 0; }
.fold .scan-row, .fold .setup, .fold .opp-row { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; padding: 5px 2px; font-size: 12px; }
.fold .opp-row > span:nth-of-type(5) { display: none; }
.fold .scan-row { display: grid; grid-template-columns: minmax(52px, 1fr) minmax(0, 1fr) minmax(0, 1fr) 52px; }
.fold .scan-row > span:nth-of-type(n+1) { text-align: right; }
.scan-flags { display: inline-flex; gap: 4px; align-items: center; justify-content: flex-end; }
.tag { letter-spacing: 0.04em; text-transform: uppercase; font-size: 10px; }
.panel-card {
  height: 100%; display: flex; flex-direction: column; min-height: 0;
  padding: 18px 18px 14px; color: #f4efe8; color-scheme: dark;
  background:
    radial-gradient(90% 42% at 100% 0%, rgba(226, 180, 58, 0.09), transparent 46%),
    linear-gradient(180deg, #2a261f 0%, #171512 38%, #100e0c 100%);
  border-color: rgba(244, 239, 232, 0.1);
  box-shadow: 0 22px 48px rgba(22, 18, 14, 0.28);
}
.panel-card h3,
.panel-card .tf-note,
.panel-card .readout,
.panel-card .legend,
.panel-card .empty,
.panel-card .check { color: #b7aea3; }
.panel-card h3 { color: #d9d1c6; letter-spacing: 0.14em; }
.panel-card .rowline { border-bottom-color: rgba(244, 239, 232, 0.08); }
.panel-card .swatch.ink { background: #f4efe8; }
.panel-card .up { color: #8eb6ff; }
.panel-card .down { color: #f0a06a; }
.panel-head { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.pair-row { display: flex; gap: 8px; }
#find-coin, #coin {
  border: 1px solid rgba(244, 239, 232, 0.12); background: #2c2823; color: #f4efe8;
  border-radius: 12px; padding: 11px 14px; font-size: 15px;
}
#find-coin { width: 112px; }
#find-coin::placeholder { color: #8f877c; }
#coin { flex: 1; min-width: 0; font-weight: 650; letter-spacing: 0.04em; }
#coin option { background: #1c1916; color: #f4efe8; }
.check { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.check input { width: 16px; height: 16px; accent-color: #e2b43a; }
.quote { font-variant-numeric: tabular-nums; font-size: 34px; line-height: 1; font-weight: 600; letter-spacing: -0.04em; }
.chart-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.tfs, .zoom { display: flex; flex-wrap: wrap; gap: 6px; }
.tfs button, .zoom button {
  border: 1px solid rgba(244, 239, 232, 0.14); background: transparent; color: #d9d1c6;
  border-radius: 999px; padding: 7px 13px; font-size: 12px; letter-spacing: 0.04em; cursor: pointer;
}
.tfs button.on { border-color: #f4efe8; background: #f4efe8; color: #161412; }
.zoom button { width: 34px; height: 34px; padding: 0; font-size: 16px; }
.tf-note { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.readout {
  color: #cfc6ba; min-height: 20px; margin: 2px 0 0; font-variant-numeric: tabular-nums;
  font-size: 12px; letter-spacing: 0.02em;
}
#chart-wrap {
  flex: 1 1 auto; min-height: 360px; position: relative; touch-action: none;
  margin-top: 6px; border-radius: 16px; overflow: hidden;
  background: #0c0b0a;
  border: 1px solid rgba(244, 239, 232, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
#chart { width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: none; }
#chart.panning { cursor: grabbing; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 12px; margin: 10px 2px 4px; }
.legend span { display: inline-flex; gap: 5px; align-items: center; }
.lists {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; min-height: 0;
  margin-top: 6px; padding: 10px 12px 8px; border-radius: 14px;
  background: #0c0b0a;
  border: 1px solid rgba(244, 239, 232, 0.06);
}
.list {
  max-height: 108px; overflow: auto;
  background: #0c0b0a;
  scrollbar-color: #6b645c #0c0b0a;
}
.list::-webkit-scrollbar { width: 10px; height: 10px; }
.list::-webkit-scrollbar-track { background: #0c0b0a; }
.list::-webkit-scrollbar-thumb {
  background: #6b645c; border-radius: 8px; border: 2px solid #0c0b0a;
}
.rowline {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 4px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums;
}
.empty { color: var(--muted); padding: 8px 0; }
.treasury {
  position: relative; overflow: hidden; flex-shrink: 0; border-radius: 18px; padding: 16px 16px 14px;
  color: #f4f2ed;
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(255,255,255,0.28), transparent 46%),
    linear-gradient(155deg, #9aa1aa 0%, #6a7078 22%, #4a5058 58%, #2e3339 100%);
  border: 1px solid #b7bcc3;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.55),
    inset 0 -16px 28px rgba(18, 20, 24, 0.22),
    0 14px 28px rgba(28, 30, 34, 0.16);
}
.treasury::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(-16deg, rgba(255,255,255,0.045) 0 1px, transparent 1px 4px);
}
.tsy-head, .tsy-title, .tsy-sum, .tsy-grid, .tsy-wait { position: relative; z-index: 1; }
.tsy-head { display: flex; gap: 12px; align-items: center; list-style: none; cursor: pointer; }
.tsy-head::-webkit-details-marker { display: none; }
.tsy-head::after { content: '›'; color: #e7e4de; font-size: 18px; line-height: 1; transition: transform 0.15s; }
.treasury[open] > .tsy-head { margin-bottom: 12px; }
.treasury[open] > .tsy-head::after { transform: rotate(90deg); }
.tsy-total { margin-top: 2px; font-family: var(--serif); font-size: 26px; letter-spacing: -0.02em; color: #fbfaf7; font-variant-numeric: tabular-nums; }
.tsy-change { margin-left: auto; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tsy-change.up { color: #d7ffe6; }
.tsy-change.down { color: #ffd2c4; }
.tsy-title { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 10px; }
.tsy-kicker {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: #e7e4de;
}
.treasury h2 {
  margin: 0; font-family: var(--serif); font-size: 18px; font-weight: 500;
  letter-spacing: -0.03em; color: #fbfaf7;
}
.tsy-asof { color: #ddd9d2; font-size: 11px; text-align: right; font-variant-numeric: tabular-nums; }
.tsy-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.tsy-sum div {
  background: rgba(18, 20, 24, 0.28); border: 1px solid rgba(255,255,255,0.16);
  border-radius: 12px; padding: 8px 10px;
}
.tsy-sum span { display: block; color: #d9d5ce; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.tsy-sum b { display: block; margin-top: 2px; font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; color: #fbfaf7; }
.tsy-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tsy-asset {
  background: rgba(16, 18, 22, 0.34); border: 1px solid rgba(255,255,255,0.16);
  border-radius: 14px; padding: 12px;
}
.tsy-asset-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.tsy-sym { font-size: 18px; font-weight: 700; letter-spacing: 0.06em; }
.tsy-pct { font-variant-numeric: tabular-nums; font-weight: 700; }
.tsy-note { margin: 2px 0 8px; color: #ddd8d0; font-size: 11px; }
.tsy-line {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 3px 0; font-variant-numeric: tabular-nums; font-size: 12px;
}
.tsy-line span { color: #d5d0c8; }
.tsy-line b { font-weight: 650; color: #fbfaf7; }
.tsy-meter { height: 4px; margin-top: 8px; border-radius: 999px; background: rgba(255,255,255,0.16); overflow: hidden; }
.tsy-meter i { display: block; height: 100%; border-radius: inherit; width: 0; }
.tsy-asset.up .tsy-pct, .tsy-asset.up .tsy-pnl, .tsy-sum b.up, .tsy-line b.up { color: #d9ffe6; }
.tsy-asset.down .tsy-pct, .tsy-asset.down .tsy-pnl, .tsy-sum b.down, .tsy-line b.down { color: #ffd2c4; }
.tsy-asset.up .tsy-meter i { background: #d9ffe6; }
.tsy-asset.down .tsy-meter i { background: #ffd2c4; }
.tsy-wait { margin: 0; color: #e7e4de; }
@media (min-width: 981px) {
  #chart-wrap { min-height: 480px; }
  #board .hero { grid-template-columns: 1fr; }
  #board .feature {
    border-left: 0; padding-left: 0;
    border-top: 1px solid var(--line); padding-top: 12px;
  }
  #board .equity { font-size: 52px; }
}
@media (max-width: 980px) {
  #app { height: auto; min-height: 100%; }
  #desk { display: flex; flex-direction: column; }
  #panel { order: -1; min-height: 680px; }
  #board { order: 0; }
  .hero, .lattice, .lists, .setup-cols, .opp-split, .tsy-grid, .tsy-sum { grid-template-columns: 1fr; }
  .fold .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .checked-menu summary { max-width: none; }
  .feature { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 12px; }
  .equity { font-size: 48px; }
  .pos { grid-template-columns: 1fr 1fr; }
  .strip-actions { margin-left: auto; width: 100%; justify-content: flex-end; }
}

/* Front desk. Yield and the other pages stay on the light theme. */
body.desk-fable {
  background: #12110f;
  color: #f3efe8;
  color-scheme: dark;
  --bg: #12110f;
  --card: #1c1b19;
  --ink: #f4efe8;
  --muted: #9a9388;
  --line: rgba(244, 239, 232, 0.12);
  --up: #3dd68c;
  --down: #f07178;
  --shadow: none;
}
body.desk-fable #app { height: auto; min-height: 100%; background: #12110f; }
body.desk-fable #desk { display: flex; flex-direction: column; gap: 16px; }
body.desk-fable #stage {
  order: -1;
  height: calc(100vh - 56px);
  min-height: 720px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
body.desk-fable #board { overflow: visible; }
body.desk-fable #panel { order: 0; min-height: 0; flex: 1; display: flex; }
body.desk-fable .panel-card {
  flex: 1;
  width: 100%;
  height: auto;
  background: #161513;
  border-color: rgba(244, 239, 232, 0.08);
  box-shadow: none;
}
body.desk-fable #stats-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 18px;
  padding: 2px 4px 0;
  align-items: end;
}
body.desk-fable #stats-bar .k { color: #8f877c; font-size: 10px; letter-spacing: 0.14em; }
body.desk-fable #stats-bar b {
  display: block;
  margin-top: 2px;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: #f4efe8;
  font-variant-numeric: tabular-nums;
}
body.desk-fable .pos-read {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  margin-top: 4px;
}
body.desk-fable .pos-pill {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
body.desk-fable .pos-pill.flat { background: #3a3834; color: #f4efe8; }
body.desk-fable .pos-pill.long { background: #1f8f55; color: #fff; }
body.desk-fable .pos-pill.short { background: #c44742; color: #fff; }
body.desk-fable .pos-detail {
  color: #c9c0b4;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 13px;
}
body.desk-fable .quote {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: 22px;
}
body.desk-fable .quote-up { color: #3dd68c; font-size: 14px; }
body.desk-fable .quote-down { color: #f07178; font-size: 14px; }
body.desk-fable #chart-wrap { flex: 1 1 auto; min-height: 280px; }
body.desk-fable #scanning {
  position: absolute;
  top: 12px;
  right: 136px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #f4efe8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  pointer-events: none;
}
body.desk-fable #scanning i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff3b30;
  box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7);
  animation: scan-pulse 1.4s ease-out infinite;
}
@keyframes scan-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.65); }
  70% { box-shadow: 0 0 0 8px rgba(255, 59, 48, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); }
}
body.desk-fable #entry-rules {
  position: absolute;
  z-index: 3;
  top: 12px;
  left: 12px;
  width: min(250px, 46%);
  max-height: 48%;
  overflow: auto;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(22, 21, 19, 0.88);
  border: 1px solid rgba(244, 239, 232, 0.16);
  pointer-events: auto;
}
body.desk-fable .rules-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
body.desk-fable .rules-head b { font-size: 11px; letter-spacing: 0.12em; }
body.desk-fable .rules-head span { color: #9a9388; font-size: 10px; }
body.desk-fable .rule-group { margin-top: 6px; }
body.desk-fable .rule-group b { display: block; color: #d9d1c6; font-size: 10px; letter-spacing: 0.08em; }
body.desk-fable .rule { display: flex; gap: 6px; align-items: flex-start; color: #b7aea3; font-size: 11px; line-height: 1.3; padding: 1px 0; }
body.desk-fable .rule i { width: 12px; color: #3dd68c; font-style: normal; }
body.desk-fable .rule.ok { color: #f4efe8; }
body.desk-fable .rule.wait { color: #9a9388; }
body.desk-fable .strategy-pick { display: flex; gap: 8px; align-items: center; color: #b7aea3; font-size: 12px; }
body.desk-fable .pair-row { position: relative; }
body.desk-fable .coin-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 320px;
  overflow: auto;
  background: #1c1b19;
  border: 1px solid rgba(244, 239, 232, 0.14);
  border-radius: 12px;
  padding: 8px;
}
body.desk-fable .coin-note { margin: 0 0 8px; color: #c9b896; font-size: 11px; line-height: 1.35; }
body.desk-fable .coin-head { color: #9a9388; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; margin: 0 0 4px; }
body.desk-fable .coin-row { display: flex; gap: 8px; align-items: center; padding: 3px 2px; }
body.desk-fable .coin-row button {
  flex: 1;
  text-align: left;
  border: 0;
  background: transparent;
  color: #f4efe8;
  padding: 4px 2px;
  cursor: pointer;
  font-weight: 650;
}
body.desk-fable .coin-row.on button { color: #3dd68c; }
body.desk-fable .trades-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
body.desk-fable .trades-head h3 { margin: 0; }
body.desk-fable #trade-filter {
  border: 1px solid rgba(244, 239, 232, 0.14);
  background: #2c2823;
  color: #f4efe8;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
}
body.desk-fable .strategy-pick select {
  border: 1px solid rgba(244, 239, 232, 0.14);
  background: #2c2823;
  color: #f4efe8;
  border-radius: 999px;
  padding: 4px 8px;
}
body.desk-fable #stoch-reserve {
  flex: 0 0 148px;
  height: 148px;
  margin-top: 6px;
  border-radius: 12px;
  overflow: hidden;
  background: #0c0b0a;
  border: 1px solid rgba(244, 239, 232, 0.06);
}
body.desk-fable #stoch { width: 100%; height: 100%; display: block; }
body.desk-fable .swatch.long { width: 16px; height: 8px; border-radius: 999px; background: #1f8f55; }
body.desk-fable .swatch.short { width: 16px; height: 8px; border-radius: 999px; background: #c44742; }
body.desk-fable .stage-bottom {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 10px;
  height: 220px;
  min-height: 220px;
}
body.desk-fable .stage-panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #12110e;
  border: 1px solid rgba(244, 239, 232, 0.08);
  border-radius: 12px;
  padding: 8px 10px 6px;
}
body.desk-fable .stage-panel h3 { margin: 0 0 4px; color: #d9d1c6; letter-spacing: 0.14em; }
body.desk-fable #equity-wrap { position: relative; flex: 1; min-height: 0; }
body.desk-fable #equity-curve { width: 100%; height: 100%; display: block; }
body.desk-fable #equity-empty {
  position: absolute;
  left: 0;
  right: 0;
  top: 36px;
  margin: 0;
}
body.desk-fable .exec-scroll { overflow: auto; min-height: 0; flex: 1; }
body.desk-fable #exec-trades {
  width: 100%;
  border-collapse: collapse;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
body.desk-fable #exec-trades th {
  position: sticky;
  top: 0;
  text-align: left;
  color: #8f877c;
  font-size: 10px;
  letter-spacing: 0.08em;
  font-weight: 650;
  padding: 4px 6px;
  border-bottom: 1px solid rgba(244, 239, 232, 0.1);
  background: #12110e;
}
body.desk-fable #exec-trades td {
  padding: 5px 6px;
  border-bottom: 1px solid rgba(244, 239, 232, 0.06);
  color: #f4efe8;
  white-space: nowrap;
}
body.desk-fable .side-long,
body.desk-fable .pnl-up { color: #3dd68c; }
body.desk-fable .side-short,
body.desk-fable .pnl-down { color: #f07178; }
body.desk-fable .chip,
body.desk-fable .opp-row,
body.desk-fable .setup,
body.desk-fable .scan-row { background: #241f1a; }
body.desk-fable .opp-row.stale { background: #2a241c; }
body.desk-fable .feature-title.yellow { color: #e2b43a; }
body.desk-fable #pair-lists .lists { background: transparent; border: 0; padding: 0; }
@media (max-width: 980px) {
  body.desk-fable #stage { height: auto; min-height: 0; }
  body.desk-fable #chart-wrap { height: 52vh; min-height: 360px; flex: none; }
  body.desk-fable .stage-bottom { grid-template-columns: 1fr; height: auto; }
  body.desk-fable .stage-panel { min-height: 200px; }
  body.desk-fable #equity-wrap { height: 160px; }
  body.desk-fable #stoch-reserve { flex-basis: 120px; height: 120px; }
  body.desk-fable #stats-bar { grid-template-columns: 1fr 1fr; }
  body.desk-fable #stats-bar b { font-size: 22px; }
  body.desk-fable .stat-pos { grid-column: 1 / -1; }
  body.desk-fable #scanning { right: 96px; }
}
