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

:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #132B45;
  --bg-2: #0F243C;
  --surface: #183552;
  --surface-2: #1C3D5C;
  --line: #2A5578;
  --line-soft: #1E3F5C;
  --ink: #ffffff;
  --ink-dim: #ffffff;
  --muted: #c8c8c8;
  --quiet: #9a9a9a;
  --paper: #ffffff;
  --paper-ink: #000000;
  --sage: #ffffff;
  --sage-dim: #c8c8c8;
  --amber: #ffffff;
  --rose: #ffffff;
  --clay: #ffffff;
  --teal: #c8c8c8;
  --input-bg: #0F243C;
  --header-bg: #0F243C;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  --up: #00C853;
  --down: #FFD54F; /* brighter amber-yellow loss on navy (colorblind) */
  --candle-up: #00E676;
  --candle-down: #FF5252;
  --chart-bg: #07111F;
  --chart-pane: #0A1628;
  --chart-stroke: #1A334D;
  --sma50: #42A5F5;
  --sma200: #FDD835;
  --macd-line: #29B6F6;
  --macd-signal: #FF6D00;
  --edu-video: #FDD835;
  --rsi-line: #d0d0d0;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --bg-2: #ffffff;
  --surface: #f5f5f5;
  --surface-2: #ececec;
  --line: #c4c4c4;
  --line-soft: #d8d8d8;
  --ink: #000000;
  --ink-dim: #000000;
  --muted: #333333;
  --quiet: #555555;
  --paper: #000000;
  --paper-ink: #ffffff;
  --sage: #000000;
  --sage-dim: #333333;
  --amber: #000000;
  --rose: #000000;
  --clay: #000000;
  --teal: #555555;
  --input-bg: #ffffff;
  --header-bg: #ffffff;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
  --up: #00C853;
  --down: #FF1744;
  --candle-up: #00C853;
  --candle-down: #FF1744;
  --chart-bg: #ffffff;
  --chart-pane: #ffffff;
  --chart-stroke: #cccccc;
  --sma50: #42A5F5;
  --sma200: #FDD835;
  --macd-line: #29B6F6;
  --macd-signal: #FF6D00;
  --edu-video: #0A4F8C;
  --rsi-line: #333333;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
  color: var(--ink-dim);
  font-family: "Plex Sans", "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.45;
}
button, input, select { font: inherit; }
a { color: inherit; text-decoration: none; }

.mono { font-family: "Plex Mono", ui-monospace, monospace; }
.word { font-family: "Fraunces", Georgia, serif; }

.app {
  width: 1440px;
  min-width: 1440px;
  height: 900px;
  min-height: 900px;
  display: grid;
  grid-template-rows: 72px 1fr;
  background: var(--bg);
}

/* ——— header ——— */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 22px 0 20px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--header-bg);
}
/* header: wordmark first — pills must not cover brand */
.top .brand { flex: 1 1 auto; min-width: 0; }
.top .pills { flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; }
.top .top-actions { flex: 0 0 auto; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mascot {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  display: block;
  object-fit: contain;
  border-radius: 10px;
  background: transparent;
}
.mascot-light { display: none; }
html[data-theme="light"] .mascot-dark,
body[data-theme="light"] .mascot-dark { display: none; }
html[data-theme="light"] .mascot-light,
body[data-theme="light"] .mascot-light { display: block; }
html[data-theme="dark"] .mascot-light,
body[data-theme="dark"] .mascot-light { display: none; }
html[data-theme="dark"] .mascot-dark,
body[data-theme="dark"] .mascot-dark { display: block; }
.wordmark {
  height: 28px;
  width: auto;
  max-width: min(560px, 46vw);
  object-fit: contain;
  display: block;
  flex: 0 1 auto;
}
.wordmark-light { display: none; }
html[data-theme="light"] .wordmark-dark,
body[data-theme="light"] .wordmark-dark { display: none; }
html[data-theme="light"] .wordmark-light,
body[data-theme="light"] .wordmark-light { display: block; }
html[data-theme="dark"] .wordmark-light,
body[data-theme="dark"] .wordmark-light { display: none; }
html[data-theme="dark"] .wordmark-dark,
body[data-theme="dark"] .wordmark-dark { display: block; }
.gate-wordmark {
  display: block;
  height: auto;
  width: 100%;
  max-width: 100%;
  max-height: 40px;
  margin: 0 auto 12px;
  object-fit: contain;
  object-position: center;
}
.mark {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: nowrap;
}
.brand-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--muted);
  font-size: 11.5px;
}
.pills { display: flex; align-items: center; gap: 8px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-dim);
  font-size: 11px;
  letter-spacing: 0.02em;
}
.pill.paper {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--paper-ink);
  font-weight: 600;
}
.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; opacity: 0.7;
}
.top-actions { display: flex; align-items: center; gap: 14px; }
.asof { color: var(--quiet); font-size: 11.5px; text-align: right; }
.send {
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  opacity: 0.72;
  cursor: not-allowed;
  font-weight: 500;
}
.send:disabled { cursor: not-allowed; }

/* ——— shell ——— */
.shell {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 0;
}
.rail {
  padding: 16px 12px 14px;
  border-right: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: var(--bg-2);
}
.nav-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--quiet);
  padding: 0 8px;
}
/* Match the tight 8766 rail Patrick called perfect: fixed 4px gaps, no stretch. */
.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav a {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 8px 10px;
  border-radius: 8px;
  border: none;
  box-shadow: none;
  color: var(--ink-dim);
  white-space: nowrap;
}
.nav a .k {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav a:hover { background: var(--surface); color: var(--ink); }
.nav a.active {
  background: var(--surface-2);
  color: var(--ink);
  box-shadow: none;
}
.nav a + a { border-top: none; }
.nav .gloss-link {
  border-bottom: none;
  text-decoration: none;
}
.nav .k { font-size: 12.5px; font-weight: 500; }
.nav .n { display: none; }
.reserved {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.slot {
  padding: 10px 10px 9px;
  border-radius: 9px;
  border: 1px dashed var(--line);
  background: var(--bg);
  color: var(--quiet);
}
.slot .t { font-size: 12px; color: var(--muted); font-weight: 500; }
.slot .s {
  margin-top: 3px;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stage {
  min-width: 0;
  min-height: 0;
  padding: 14px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* desk grid */
.desk {
  display: none;
  grid-template-columns: 1.42fr 0.9fr;
  grid-template-rows: 1fr auto;
  gap: 12px;
  min-height: 0;
  height: 100%;
}
body[data-view="desk"] .desk { display: grid; }
body[data-view="desk"] .focus { display: none; }

.focus {
  display: none;
  min-height: 0;
  height: 100%;
}
body:not([data-view="desk"]) .focus { display: flex; flex-direction: column; }
body[data-view="market"] .focus-market,
body[data-view="ah-move"] .focus-ah-move,
body[data-view="options-chain"] .focus-options-chain,
body[data-view="historical-options-chain"] .focus-historical-options-chain,
body[data-view="positions"] .focus-positions,
body[data-view="opportunity"] .focus-opportunity,
body[data-view="news"] .focus-news,
body[data-view="chart"] .focus-chart,
body[data-view="sleeve3"] .focus-sleeve3,
body[data-view="family"] .focus-family,
body[data-view="account-pnl"] .focus-account-pnl,
body[data-view="core-positions"] .focus-core-positions,
body[data-view="risk-overview"] .focus-risk-overview,
body[data-view="general-news"] .focus-general-news,
body[data-view="education"] .focus-education { display: flex; }
body:not([data-view="market"]) .focus-market,
body:not([data-view="ah-move"]) .focus-ah-move,
body:not([data-view="options-chain"]) .focus-options-chain,
body:not([data-view="historical-options-chain"]) .focus-historical-options-chain,
body:not([data-view="positions"]) .focus-positions,
body:not([data-view="opportunity"]) .focus-opportunity,
body:not([data-view="news"]) .focus-news,
body:not([data-view="chart"]) .focus-chart,
body:not([data-view="sleeve3"]) .focus-sleeve3,
body:not([data-view="family"]) .focus-family,
body:not([data-view="account-pnl"]) .focus-account-pnl,
body:not([data-view="core-positions"]) .focus-core-positions,
body:not([data-view="risk-overview"]) .focus-risk-overview,
body:not([data-view="general-news"]) .focus-general-news,
body:not([data-view="education"]) .focus-education { display: none; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  box-shadow: var(--shadow);
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.panel-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--line-soft);
}
.panel-h h2 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.panel-h .note { color: var(--quiet); font-size: 11.5px; }
.panel-b { padding: 10px 14px 14px; min-height: 0; overflow: auto; }
.caption {
  color: var(--quiet);
  font-size: 11px;
  letter-spacing: 0.01em;
}

/* tables */
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--quiet);
  font-weight: 500;
  padding: 4px 8px 7px 0;
  border-bottom: 1px solid var(--line-soft);
}
td {
  padding: 7px 10px 7px 0;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
  color: var(--ink-dim);
}
tr:last-child td { border-bottom: 0; }
tr.sel td { color: var(--ink); }
.sym {
  font-family: "Plex Mono", monospace;
  font-weight: 500;
  color: var(--ink);
  font-size: 12.5px;
  text-transform: uppercase;
}
.tag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-dim);
  font-family: "Plex Mono", monospace;
  font-size: 10.5px;
  white-space: nowrap;
}
.tag.manual,
.tag.autofade,
.tag.show,
.tag.donot,
.tag.earn,
.tag.exh,
.tag.watch,
.tag.ai,
.tag.space,
.tag.crypto,
.tag.index,
.tag.example {
  color: var(--ink-dim);
  border-color: var(--line);
}
.none { color: var(--quiet); font-family: "Plex Mono", monospace; font-size: 11px; }
.insuf { color: var(--amber); font-family: "Plex Mono", monospace; font-size: 11.5px; }

/* ticket */
.ticket {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink);
  border-radius: 10px;
  padding: 12px 14px 12px 13px;
}
.ticket h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}
.kv {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 3px 10px;
  font-size: 12px;
}
.kv dt { color: var(--quiet); }
.kv dd { margin: 0; color: var(--ink-dim); }
.hold {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.namebox {
  display: grid;
  grid-template-columns: 92px 110px 1fr auto;
  gap: 8px;
  align-items: end;
  margin-top: 10px;
}
.namebox label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--quiet);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.namebox input, .namebox select {
  height: 32px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--ink);
  padding: 0 9px;
}
.ajoin {
  height: 32px;
  padding: 0 12px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 500;
}

.side-stack { display: flex; flex-direction: column; gap: 12px; min-height: 0; min-width: 0; }
.side-stack .panel { flex: 1; }

/* news */
.news-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
}
.news-item:last-child { border-bottom: 0; }
.news-item .hd { color: var(--ink-dim); }
.news-item a.hd-link {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}
.news-item a.hd-link:hover { text-decoration: underline; }
.news-item .ex {
  color: var(--quiet);
  font-size: 11px;
  grid-column: 2;
}

/* sleeve 3 — BTC/ETH/SOL/XRP (2×2) */
.s3 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 720px) {
  .s3 { grid-template-columns: 1fr; }
}
.asset {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 12px 13px;
}
.asset-h {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
  gap: 8px;
}
.asset-h .name { font-family: "Fraunces", Georgia, serif; font-size: 18px; }
.asset-h .s3-weight {
  flex: 0 0 auto;
  font-size: 11px;
  opacity: 0.92;
}
.s3-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0 0 8px;
  font-size: 12px;
}
.s3-links .s3-link {
  color: var(--sage);
  text-decoration: none;
  font-weight: 500;
}
.s3-links .s3-link:hover { text-decoration: underline; }
.levels { display: flex; flex-direction: column; gap: 6px; }
.lvl {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 12px;
  color: var(--ink);
}
.lvl .id { font-family: "Plex Mono", monospace; font-size: 11px; color: var(--ink); }
.lvl .say { color: var(--ink); }
.buy-only {
  margin-top: 8px;
  font-size: 12px;
  color: var(--sage);
}
.s3-kv { margin: 0 0 8px; }
.s3-metrics {
  margin: 0 0 4px;
  color: var(--ink-dim);
  font-size: 11.5px;
  line-height: 1.4;
}
.custody { margin: 0 0 8px; }
.levels { margin-top: 10px; }
.lvl .on {
  color: var(--sage);
  font-family: "Plex Mono", monospace;
  font-size: 11px;
}
.s3-foot { margin-top: 8px; color: var(--quiet); font-size: 11.5px; }

/* chart */
.chart-tools {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.chart-style-tools,
.chart-draw-tools {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.chart-draw-tools {
  padding-left: 10px;
  margin-left: 2px;
  border-left: 1px solid var(--line);
}
.seg {
  height: 26px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}
.seg.on { background: var(--surface-2); color: var(--ink); }
.chart-draw-tools .seg {
  min-height: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  font-size: 12px;
}
.chart-wrap {
  height: 620px;
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.chart-wrap.grabbing { cursor: grabbing; }
.chart-wrap.draw-mode { cursor: crosshair; }
.chart-wrap.draw-mode.grabbing { cursor: grabbing; }
/* Drawing strokes are SVG mid-opacity near-white / near-black (see examples.py). */
body[data-view="desk"] .chart-wrap { height: 0; }
#chart-svg { width: 100%; height: 100%; display: block; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--quiet); font-size: 11px; margin-top: 6px; }
.sw { display: inline-block; width: 16px; height: 2px; vertical-align: middle; margin-right: 5px; }
.sw.spread { background: #29B6F6; height: 3px; }
.quote-strip {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 4px 0 2px;
  font-family: "Plex Mono", ui-monospace, monospace;
}
.quote-strip .q-last {
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.quote-strip .q-chg,
.quote-strip .q-pct { font-size: 14px; font-weight: 500; }
.quote-strip .q-chg.up, .quote-strip .q-pct.up { color: var(--up); }
.quote-strip .q-chg.down, .quote-strip .q-pct.down { color: var(--down); }
.range-chips {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin: 0 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
}
.range-chips .seg {
  border: 0;
  border-radius: 0;
  height: 26px;
  cursor: pointer;
}
.range-chips .seg.on {
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
}
.freq-select {
  height: 28px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--ink);
  padding: 0 8px;
}
.caption.chart-hint { margin: 6px 0 4px; color: var(--muted); }
body[data-view="chart"] .focus-chart .panel-h {
  flex-wrap: wrap;
  align-items: flex-end;
}
body[data-view="chart"] .focus-chart .panel-b {
  display: flex;
  flex-direction: column;
  overflow: auto;
}
body[data-view="chart"] .chart-wrap {
  flex: 1 1 620px;
  min-height: 480px;
  height: auto;
}

/* positions focus extras */
.flagbox {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.rule-legend {
  margin-top: 10px;
  color: var(--quiet);
  font-size: 11.5px;
}

.desk-opp { min-height: 0; }
.desk-s3 { grid-column: 1 / -1; }

body[data-view="desk"] .panel-b { padding-top: 8px; padding-bottom: 10px; }
body[data-view="desk"] td { padding-top: 4px; padding-bottom: 4px; }
body[data-view="desk"] .news-item { padding: 5px 0; }
body[data-view="desk"] .ticket { padding: 8px 11px; }
body[data-view="desk"] .ticket h3 { margin-bottom: 6px; }
body[data-view="desk"] .kv { font-size: 11.5px; gap: 2px 10px; }
body[data-view="desk"] .hold { margin-top: 6px; font-size: 11.5px; }
body[data-view="desk"] .namebox { margin-top: 8px; }
body[data-view="desk"] .namebox input,
body[data-view="desk"] .namebox select,
body[data-view="desk"] .ajoin { height: 28px; }
body[data-view="desk"] .desk-s3 .asset { padding: 8px 11px; }
body[data-view="desk"] .desk-s3 .panel-b { padding-top: 8px; padding-bottom: 8px; }
body[data-view="desk"] .s3-foot { margin-top: 4px; }
body[data-view="desk"] .s3-metrics { font-size: 10.5px; margin-bottom: 2px; }
body[data-view="desk"] .desk-s3 .asset-h { margin-bottom: 4px; }
body[data-view="desk"] .desk-s3 .asset-h .name { font-size: 16px; }
body[data-view="desk"] .desk-s3 .s3-links { margin-bottom: 4px; font-size: 11px; gap: 6px 10px; }
body[data-view="desk"] .desk-s3 .buy-only { margin-top: 3px; font-size: 11px; }
body[data-view="desk"] .desk-s3 .levels { margin-top: 5px; gap: 3px 8px; }
body[data-view="desk"] .desk-s3 .lvl { font-size: 10.5px; }
body[data-view="desk"] .desk-s3 .s3-foot { font-size: 10.5px; }
body[data-view="desk"] .desk-opp .parked-strip { margin-bottom: 6px; }
body[data-view="desk"] .desk-opp .scan-line,
body[data-view="desk"] .desk-opp .floor-note,
body[data-view="desk"] .desk-opp .session-status { margin-bottom: 4px; font-size: 11px; }
body[data-view="desk"] .desk-opp .criteria { margin-bottom: 6px; }


/* first-look live Opportunity — same chrome, no new visual system */
.scan-line {
  margin: 0 0 10px;
  color: var(--ink-dim);
  font-size: 12px;
}
.floor-note {
  margin: 0 0 10px;
  color: var(--quiet);
  font-size: 11.5px;
}
.parked-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}
body[data-view="opportunity"] .panel-b {
  overflow: auto;
}
.ticket-wrap { margin-top: 14px; }
body[data-view="desk"] .desk-opp .panel-b {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body[data-view="desk"] .desk-opp .best-value-line {
  margin-bottom: 6px;
  font-size: 12px;
  padding: 6px 10px;
  flex: 0 0 auto;
}
body[data-view="desk"] .desk-opp .parked-strip,
body[data-view="desk"] .desk-opp .scan-line,
body[data-view="desk"] .desk-opp .floor-note,
body[data-view="desk"] .desk-opp .session-status,
body[data-view="desk"] .desk-opp .criteria { flex: 0 0 auto; }
body[data-view="desk"] .desk-opp table { flex: 0 0 auto; }
body[data-view="desk"] .desk-opp .ticket-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  margin-top: 8px;
}
body[data-view="desk"] .desk-opp .namebox {
  flex: 0 0 auto;
  margin-top: 8px;
}
.namebox { margin-top: 10px; }
.ticket-wrap + .namebox { margin-top: 12px; }
.miss {
  color: var(--amber);
  font-family: "Plex Mono", monospace;
  font-size: 12px;
}


/* owner 2026-08-28: current-stats table + chart ticker + sentence scores */
.stats-wrap {
  overflow-x: auto;
  margin: 0 0 14px;
}
.stats-table {
  min-width: 1380px;
}
.stats-table th {
  text-transform: none;
  letter-spacing: 0.01em;
  font-size: 10.5px;
  color: var(--ink-dim);
  white-space: nowrap;
  vertical-align: bottom;
  text-align: center;
  padding: 4px 10px 7px;
}
.stats-table th .th-stack {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  width: 100%;
  min-height: 2.6em;
  height: 100%;
  line-height: 1.25;
}
.stats-table th .th-top,
.stats-table th .th-bot {
  display: block;
  white-space: nowrap;
  text-align: center;
}
.stats-table th .th-top:empty {
  min-height: 1.25em;
}
.stats-table th.wrap {
  white-space: normal;
}
.stats-table th.wrap .th-top {
  white-space: normal;
  text-align: center;
}
.stats-table td {
  min-width: 70px;
  color: var(--ink);
  text-align: center;
  padding: 7px 10px;
}
.stats-table td.mono {
  white-space: nowrap;
}
.stats-table th.num-usd,
.stats-table td.num-usd {
  min-width: 8rem;
}
.stats-table th.num-pct,
.stats-table td.num-pct {
  min-width: 6.5rem;
}
.stats-table .up { color: var(--up); }
.stats-table .down { color: var(--down); }
.stats-table .lot-sub {
  margin-top: 2px;
  font-size: 11px;
  color: var(--quiet);
  font-weight: 400;
  white-space: normal;
  max-width: 220px;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}
.stats-table td:empty::after {
  content: "—";
  color: var(--quiet);
}
.stats-table tbody tr:last-child td {
  border-bottom: 1px solid var(--line-soft);
}
.stats-table tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 3;
  background: var(--bg);
  font-weight: 600;
  border-top: 1px solid var(--line);
  border-bottom: 0;
  text-align: center;
}
[data-theme="light"] .stats-table tfoot td {
  background: var(--bg);
}
.stats-table tfoot .sym {
  font-weight: 600;
}
.chart-head {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.tickerbox {
  display: grid;
  grid-template-columns: 110px 132px 140px;
  gap: 8px;
  align-items: end;
}
.tickerbox label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tickerbox input, .tickerbox select {
  height: 28px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--ink);
  padding: 0 8px;
}
.chart-ticker {
  display: flex;
  gap: 8px;
  align-items: end;
  margin: 0 0 10px;
}
.chart-ticker label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--ink-dim);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.chart-ticker input {
  height: 32px;
  width: 160px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--ink);
  padding: 0 9px;
}
.chart-ticker button {
  height: 32px;
  padding: 0 12px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 500;
}
.score {
  color: var(--amber);
  font-size: 12px;
}
.panel-h h2 .mono { color: var(--ink); }

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: visible; /* do not clip Light/Dark labels */
  background: var(--surface);
}
.theme-switch .lab {
  padding: 0 10px 0 14px;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--quiet);
  border-radius: 999px 0 0 999px;
}
.theme-switch .seg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  border: 0;
  border-radius: 0;
  min-width: 5.25rem;
  padding: 0 22px;
  box-sizing: border-box;
  overflow: visible;
  color: var(--ink);
  white-space: nowrap;
}
.theme-switch .seg:last-child {
  padding-right: 24px;
  border-radius: 0 999px 999px 0;
}
.theme-switch .seg.on {
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
}
html[data-theme="dark"] .theme-switch .seg[data-theme="light"]:not(.on),
body[data-theme="dark"] .theme-switch .seg[data-theme="light"]:not(.on),
[data-theme="dark"] .theme-switch .seg[data-theme="light"]:not(.on) { color: #fff; }
html[data-theme="light"] .theme-switch .seg[data-theme="dark"]:not(.on),
body[data-theme="light"] .theme-switch .seg[data-theme="dark"]:not(.on),
[data-theme="light"] .theme-switch .seg[data-theme="dark"]:not(.on) { color: #000; }
.sw.sma50 { background: #42A5F5; }
.sw.sma200 { background: #FDD835; }
.sw.macd { background: #29B6F6; }
.sw.signal { background: #FF6D00; }
.sw.bb { background: #E0E0E0; }


.sw.up { background: var(--up); }
.sw.down { background: var(--down); }


/* Family statement — first-class window, sheet page, black/white */
body[data-view="family"] .stage { min-height: 0; }
body[data-view="family"] .focus-family { min-height: 0; }
body[data-view="family"] .panel-b.stmt {
  overflow: auto;
  padding-top: 8px;
}
body[data-view="account-pnl"] .stage { min-height: 0; }
body[data-view="account-pnl"] .focus-account-pnl { min-height: 0; }
body[data-view="account-pnl"] .panel-b.stmt {
  overflow: auto;
  padding-top: 8px;
}
.stmt-mast {
  margin: 0 0 8px;
}
.stmt-mast .firm {
  font-family: "Fraunces", Georgia, serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.stmt-mast .doc {
  margin-top: 2px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.who-switch {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin: 0 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
}
.who-switch .lab {
  padding: 0 10px 0 12px;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--quiet);
}
.who-switch .seg {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 11px;
  text-decoration: none;
  border: 0;
  border-radius: 0;
  color: var(--muted);
}
.who-switch .seg.on {
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
}
/* Mock / illustrative Who tabs (Dianna, Charlie, …) — tan vs live accounts */
.who-switch .seg.seg-mock {
  background: #D2B48C;
  color: #3E2F1C;
}
.who-switch .seg.seg-mock.on {
  background: #C4A484;
  color: #2A1F14;
  font-weight: 700;
}
html[data-theme="light"] .who-switch .seg.seg-mock,
body[data-theme="light"] .who-switch .seg.seg-mock,
[data-theme="light"] .who-switch .seg.seg-mock {
  background: #E6D2B5;
  color: #3E2F1C;
}
html[data-theme="light"] .who-switch .seg.seg-mock.on,
body[data-theme="light"] .who-switch .seg.seg-mock.on,
[data-theme="light"] .who-switch .seg.seg-mock.on {
  background: #D2B48C;
  color: #2A1F14;
}
.selected-who {
  margin-top: 2px;
  color: var(--ink);
  font-size: 12px;
}
.stmt-top {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr 1fr;
  gap: 10px 14px;
  margin: 0 0 8px;
  align-items: start;
}
.stmt h3 {
  margin: 0 0 6px;
  font-size: 10.5px;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--quiet);
  font-weight: 600;
}
.stmt-meta {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stmt-meta > div {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 4px 8px;
}
.stmt-meta dt { color: var(--quiet); font-size: 11px; }
.stmt-meta dd { margin: 0; color: var(--ink); font-size: 12px; }
.stmt-summary {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px 8px;
}
.stmt-summary-dl { margin: 0; }
.stmt-kv {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  padding: 2px 0;
  border-bottom: 1px solid var(--line-soft);
}
.stmt-kv:last-child { border-bottom: 0; }
.stmt-kv dt { color: var(--quiet); font-size: 11px; }
.stmt-kv dd { margin: 0; }
.stmt-num {
  font-family: "Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
  color: var(--ink);
}
.stmt-neg { color: var(--ink); }
[data-theme="dark"] .stmt-neg { color: var(--down); }
.stmt-latest { display: flex; flex-direction: column; gap: 8px; }
.stmt-me {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
}
.stmt-me.me, .stmt-me.month-end {
  box-shadow: inset 3px 0 0 var(--ink);
}
.stmt-me.not-me {
  border-style: dashed;
}
.stmt-me.empty p { margin: 0; color: var(--muted); font-size: 12px; }
.stmt-me-note {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 11px;
}
.stmt-me-dl {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 10px;
}
.stmt-me-dl > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.stmt-me-dl dt { color: var(--quiet); font-size: 11px; }
.stmt-me-dl dd { margin: 0; }
.stmt-block { margin-top: 12px; }
.stmt-sort {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 12px;
}
.stmt-sort label { color: var(--quiet); }
.stmt-sort select {
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--ink);
  padding: 0 8px;
}
/* Lock column widths — table-layout:auto reflows on gloss hover (tip display / underline metrics). */
.stmt-table {
  table-layout: fixed;
  width: 100%;
}
.stmt-table th.sortable { cursor: pointer; user-select: none; }
/* Hover: color only — never border-width/padding/font-weight/text-decoration metrics (match Core tile ~4691). */
.stmt-table th.sortable:hover { color: var(--ink); }
.stmt-table th {
  white-space: nowrap;
  vertical-align: bottom;
  text-align: center;
  padding: 6px 12px;
  min-width: 3.5rem;
  box-sizing: border-box;
}
.stmt-table td:first-child {
  overflow-wrap: break-word;
  word-break: break-word;
}
/* Glossary tips stay out of table measure (absolute + visibility, not display toggle). */
.stmt-table th .gloss-tip {
  display: block;
  visibility: hidden;
  pointer-events: none;
}
.stmt-table th .gloss:hover .gloss-tip,
.stmt-table th .gloss:focus-within .gloss-tip {
  display: block;
  visibility: visible;
  pointer-events: auto;
}
/* Stable glossary underline: paint-only decoration (no border box jump). */
.stmt-table th .gloss-link {
  border-bottom: 0 none;
  text-decoration: underline dotted var(--quiet);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.stmt-table th .gloss-link:hover {
  color: var(--ink);
  text-decoration-color: var(--ink);
  font-weight: inherit;
  border-bottom-width: 0;
  padding: 0;
}
.stmt-table th .th-stack {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  width: 100%;
  min-height: 2.5em;
  line-height: 1.25;
}
.stmt-table th .th-top,
.stmt-table th .th-bot {
  display: block;
  white-space: nowrap;
}
.stmt-table th.wrap { white-space: normal; }
.stmt-table td {
  font-size: 12px;
  padding: 5px 12px 5px 0;
  vertical-align: top;
}
.stmt-table .stmt-num {
  text-align: center;
}
.stmt-table tr.total td { font-weight: 600; color: var(--ink); }
.stmt-table tr.me-first td { color: var(--ink); font-weight: 500; }
.stmt-table tr.not-me td { font-style: italic; }
.slice-note { margin: 4px 0 2px; }

/* General News Stories — live Yahoo tape, not 0.23 EXAMPLE */
body[data-view="general-news"] .stage { min-height: 0; }
body[data-view="general-news"] .focus-general-news { min-height: 0; }
body[data-view="general-news"] .panel-b.tape {
  overflow: auto;
}
.story-search {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0 0 12px;
}
.story-search input[name="q"] {
  flex: 1;
  height: 34px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--ink);
  padding: 0 12px;
}
.story-search button {
  height: 34px;
  padding: 0 14px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 500;
  cursor: pointer;
}
.story-list { display: flex; flex-direction: column; }
.story {
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.story:last-child { border-bottom: 0; }
.story .hd {
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
}
.story a.hd:hover { text-decoration: underline; }
.story .meta {
  margin-top: 4px;
  color: var(--quiet);
  font-size: 11.5px;
}
.panel-b.tape .empty {
  margin: 18px 0;
  color: var(--ink);
  font-size: 14px;
}

.val-short { display: none; }
.print-run { display: none; }

/* Nuclear print reset. Chrome/Edge print preview still showed a black
   rectangle around family-statement letter pages after the last pass.
   Remaining sources: color-scheme:dark (UA dark canvas + page chrome),
   html/body navy --bg printed via print-color-adjust:exact, .panel
   overflow:hidden + radius raster, inset --ink bar on month cards,
   wrapper/outline/filter, UA focus outline. Kill all of them. Keep
   gray #F2F2F2 boxes, letterhead rule, table header #ccc, 3 pages. */
@media print {
  @page {
    size: letter portrait;
    margin: 0.65in 0.7in;
  }

  :root,
  html,
  body,
  [data-theme],
  [data-theme="dark"],
  [data-theme="light"] {
    color-scheme: only light !important;
    forced-color-adjust: none !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    --bg: #ffffff !important;
    --bg-2: #ffffff !important;
    --surface: #ffffff !important;
    --surface-2: #F2F2F2 !important;
    --header-bg: #ffffff !important;
    --ink: #111111 !important;
    --ink-dim: #111111 !important;
    --muted: #333333 !important;
    --quiet: #555555 !important;
    --line: transparent !important;
    --line-soft: transparent !important;
    --shadow: none !important;
  }

  html, body {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 none !important;
    outline: 0 none !important;
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
    filter: none !important;
    -webkit-filter: none !important;
    overflow: visible !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    font-size: 10.5pt;
    line-height: 1.4;
    color: #111 !important;
    font-family: "Plex Sans", "Segoe UI", Helvetica, Arial, sans-serif !important;
  }

  *, *::before, *::after {
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
    text-shadow: none !important;
    filter: none !important;
    -webkit-filter: none !important;
    outline: none !important;
    outline-width: 0 !important;
    outline-offset: 0 !important;
    outline-color: transparent !important;
  }
  *:focus, *:focus-visible, *:active {
    outline: none !important;
    box-shadow: none !important;
  }

  html, body, .app, .shell, .stage, .focus, .focus-family, .panel, .panel-h, .panel-b,
  .panel-b.stmt, .stmt, .stmt-print-p1, .stmt-print-p2, .stmt-print-p3, .stmt-sheet,
  .stmt-head, .stmt-top, .stmt-block, .stmt-mast, .stmt-meta, .stmt-latest,
  .stmt-summary-dl, .stmt-me-dl, main, section, header, aside, nav, div {
    border: 0 none !important;
    border-width: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
    outline: 0 none !important;
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
    filter: none !important;
    border-radius: 0 !important;
  }

  html, body, .app, .shell, .stage {
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    background: #fff !important;
    background-color: #ffffff !important;
    color: #111 !important;
    font-family: "Plex Sans", "Segoe UI", Helvetica, Arial, sans-serif !important;
  }

  .shell {
    display: block !important;
    grid-template-columns: none !important;
  }
  .top, header, .rail, nav, .nav, .nav-label, .theme-switch,
  .who-switch, .pills, .send, .print-hide, .panel-h .note,
  .gloss-tip, .gloss-more, .criteria,
  .slice-note, .selected-who, .mascot { display: none !important; }

  .focus:not(.focus-family) { display: none !important; }
  .stage, .focus, .focus-family, .panel, .panel-b, .panel-b.stmt,
  .stmt-print-p1, .stmt-print-p2, .stmt-print-p3, .stmt-sheet {
    display: block !important;
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 none !important;
    border-radius: 0 !important;
    background: #fff !important;
    background-color: #ffffff !important;
    outline: none !important;
    box-shadow: none !important;
    filter: none !important;
  }
  .panel-h {
    display: block;
    padding: 0;
    margin: 0 0 6px;
    border: 0 !important;
    background: transparent;
  }
  .panel-h h2 {
    margin: 0;
    font-family: "Fraunces", Georgia, "Times New Roman", serif !important;
    font-size: 22pt;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #111;
  }
  .stmt-mast {
    margin: 0 0 16px;
    padding: 0 0 10px;
    border: 0 none !important;
    border-bottom: 2.5pt solid #111 !important;
    outline: none !important;
    box-shadow: none !important;
  }
  .stmt-mast .firm {
    font-family: "Plex Sans", "Segoe UI", Helvetica, Arial, sans-serif !important;
    font-size: 11pt;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #111;
  }
  .stmt-mast .doc {
    margin-top: 3px;
    font-size: 8.5pt;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #888;
  }
  .stmt-top {
    display: grid !important;
    grid-template-columns: 1.05fr 0.95fr !important;
    gap: 16px 24px !important;
    margin: 0 0 18px;
    align-items: start;
    border: 0 none !important;
  }
  .stmt-latest {
    grid-column: 1 / -1;
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 12px 20px;
    margin-top: 2px;
    border: 0 none !important;
  }
  .stmt-summary, .stmt-me, .stmt-me.me, .stmt-me.month-end, .stmt-me.not-me, .stmt-me.empty {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
    background: #F2F2F2 !important;
    background-color: #F2F2F2 !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 7px !important;
    padding: 10px 14px !important;
    outline: none !important;
    box-shadow: none !important;
    filter: none !important;
  }
  .stmt h3 {
    letter-spacing: 0.02em;
    font-size: 8.5pt;
    font-weight: 600;
    color: #111;
    margin: 0 0 8px;
    text-transform: none !important;
  }
  .stmt-meta > div {
    grid-template-columns: 148px 1fr;
    gap: 2px 10px;
  }
  .stmt-meta dt { font-size: 9pt; color: #666; }
  .stmt-meta dd { font-size: 10.5pt; color: #111; }
  .stmt-kv {
    border: 0 none !important;
    border-bottom: 1px solid #e4e4e4 !important;
    padding: 3px 0;
  }
  .stmt-kv:last-child { border-bottom: 0 !important; }
  .stmt-kv dt { color: #666; font-size: 9pt; }
  .stmt-kv dd, .stmt-num { color: #111; }
  .stmt-me-note { color: #666 !important; font-size: 8.5pt; }
  .stmt-me-dl dt { color: #666; }
  .val-short { display: inline !important; }
  .val-long { display: none !important; }

  .print-run { display: none; }
  .stmt-print-p2,
  .stmt-print-p3 {
    break-before: page;
    page-break-before: always;
    border: 0 none !important;
    outline: none !important;
    box-shadow: none !important;
  }
  .stmt-print-p1 {
    break-after: page;
    page-break-after: always;
    border: 0 none !important;
    outline: none !important;
    box-shadow: none !important;
  }
  .stmt-print-p2 .print-run,
  .stmt-print-p3 .print-run {
    display: block;
    margin: 0 0 12px;
    padding: 0 0 8px;
    border: 0 none !important;
    border-bottom: 1.5pt solid #111 !important;
    font-family: "Fraunces", Georgia, "Times New Roman", serif !important;
    font-size: 14pt;
    font-weight: 600;
    color: #111;
    text-transform: none !important;
  }
  .stmt, .stmt-print-p1, .stmt-print-p2, .stmt-print-p3,
  .stmt-top, .stmt-block, .stmt-table, .stmt-sheet {
    width: 100% !important;
    max-width: none !important;
  }
  .stmt-block {
    margin-top: 16px;
    break-inside: auto;
    border: 0 none !important;
  }
  .stmt-block h3,
  .stmt-block .caption {
    break-after: avoid;
    page-break-after: avoid;
  }
  .stmt-block .caption {
    font-size: 8.5pt;
    color: #444;
    margin: 0 0 8px;
    max-width: 100%;
  }
  .stmt-table {
    width: 100% !important;
    border-collapse: collapse;
    table-layout: auto;
    border: 0 none !important;
    outline: none !important;
    box-shadow: none !important;
  }
  .stmt-table th {
    white-space: nowrap;
    letter-spacing: 0.03em;
    font-size: 8pt;
    text-align: center;
    vertical-align: bottom;
    border: 0 none !important;
    border-bottom: 1px solid #ccc !important;
    padding: 5px 10px;
    color: #111;
  }
  .stmt-table th .th-stack {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
    min-height: 2.4em;
    line-height: 1.25;
  }
  .stmt-table th .th-top,
  .stmt-table th .th-bot {
    display: block;
    white-space: nowrap;
  }
  .stmt-table th.wrap { white-space: normal; }
  .stmt-table td {
    font-size: 9pt;
    padding: 5px 10px 5px 0;
    vertical-align: top;
    border: 0 none !important;
    border-bottom: 1px solid #ddd !important;
  }
  .stmt-table .stmt-num { white-space: nowrap; text-align: center; }
  .stmt-table thead { display: table-header-group; }
  .stmt-table tr { break-inside: avoid; page-break-inside: avoid; }

  .stmt-monthly {
    break-before: page;
    page-break-before: always;
  }
  .stmt-print-p3.stmt-monthly {
    break-before: page;
    page-break-before: always;
  }
  .rail, .nav, aside { display: none !important; width: 0 !important; }
  html, body, .app, .shell, .stage, .focus-family, .panel-b.stmt {
    width: 100% !important;
    min-width: 0 !important;
  }
  .stmt-sort { display: none !important; }
  .stmt-monthly .stmt-table td,
  .stmt-monthly .stmt-table th { white-space: nowrap; }

  a { text-decoration: none !important; color: inherit !important; }
}

/* Opportunity Selection Criteria — themed disclosure, closed by default */
.session-status {
  margin: 0 0 8px;
  color: var(--ink-dim);
  font-size: 12px;
}

/* Ellis 0.2 / Naomi Best Value — high contrast, not candle, not paper gold, not clay */
.best-value-line {
  /* Owner 2026-09-10: sit just under Opportunities, above Selection Criteria. */
  position: relative;
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #29B6F6;
  color: #132B45;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.01em;
  text-align: left;
}
/* Fixed Opportunities chrome: Best Value then Selection Criteria (not free-drag). */
body[data-view="opportunity"] .opp-top-anchor {
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  z-index: 8;
  padding: 0 14px 6px;
  background: var(--panel, var(--surface));
  border-bottom: 1px solid var(--line);
}
body[data-view="opportunity"] .opp-top-anchor .best-value-win {
  position: relative;
  padding: 0;
  margin: 0;
}
body[data-view="opportunity"] .opp-top-anchor .best-value-line {
  margin: 0 0 8px;
}
body[data-view="opportunity"] .opp-top-anchor > .criteria {
  margin: 0 0 4px;
}
body[data-view="opportunity"] .focus-opportunity {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
body[data-view="opportunity"] .focus-opportunity > .panel-b {
  flex: 1 1 auto;
  min-height: 0;
}

/* Opportunities fully anchored — Owner 2026-09-10 */
body[data-view="opportunity"] .bw-drag-chrome,
body[data-view="opportunity"] .win-resize-handle,
body[data-view="opportunity"] .board-window-max,
.desk-opp .bw-drag-chrome,
.desk-opp .win-resize-handle,
.desk-opp .board-window-max {
  display: none !important;
}
body[data-view="opportunity"] .is-free-win,
body[data-view="opportunity"] .opp-scan-wrap,
body[data-view="opportunity"] .ticket-wrap,
body[data-view="opportunity"] .best-value-win,
.desk-opp .is-free-win,
.desk-opp .opp-scan-wrap,
.desk-opp .ticket-wrap,
.desk-opp .best-value-win {
  position: static !important;
  left: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: auto !important;
  height: auto !important;
  max-width: none !important;
  z-index: auto !important;
  flex: 0 0 auto !important;
}
body[data-view="opportunity"] .focus-opportunity.is-free-layout,
body[data-view="opportunity"] .focus-opportunity .panel-b.is-free-layout,
.desk-opp.is-free-layout,
.desk-opp .panel-b.is-free-layout {
  position: relative !important;
  min-height: 0 !important;
}
body[data-view="opportunity"] .ticket-wrap,
.desk-opp .ticket-wrap {
  margin-top: 10px;
}

.best-value-line.none {
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line);
  font-weight: 600;
}
.best-value-line a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 700;
  margin-left: 6px;
}
[data-theme="light"] .best-value-line {
  background: #0A4F8C;
  color: #ffffff;
}
[data-theme="light"] .best-value-line.none {
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line);
}
.tag.best-value {
  margin-left: 8px;
  background: #29B6F6;
  border-color: #29B6F6;
  color: #132B45;
  font-weight: 600;
}
[data-theme="light"] .tag.best-value {
  background: #0A4F8C;
  border-color: #0A4F8C;
  color: #ffffff;
}
.criteria {
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}
.criteria summary {
  cursor: pointer;
  list-style: none;
  padding: 8px 12px;
  font-weight: 600;
  font-size: 12.5px;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.criteria summary::-webkit-details-marker { display: none; }
.criteria summary::before {
  content: "▸";
  display: inline-block;
  width: 1.1em;
  color: var(--quiet);
  font-size: 11px;
}
.criteria[open] summary::before { content: "▾"; }
.criteria-body {
  padding: 0 12px 10px 28px;
  border-top: 1px solid var(--line-soft);
}
.criteria-body ul {
  margin: 8px 0 0;
  padding: 0 0 0 16px;
}
.criteria-body li {
  margin: 0 0 6px;
  color: var(--ink-dim);
  font-size: 12.5px;
}
.spread-chart-link {
  margin: 8px 0 0;
}
.spread-chart-link a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
}
.spread-chart-link a:hover { color: #29B6F6; }

.news-for-link-wrap {
  margin: 8px 0 0;
  font-size: 0.92rem;
}
.news-for-link-wrap a,
.best-value-line .bv-news {
  color: #29B6F6;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.news-for-link-wrap a:hover,
.best-value-line .bv-news:hover { text-decoration: underline; }
.best-value-line .bv-news { margin-left: 4px; }
.opp-scan .spread-chart-link {
  display: inline;
  margin: 0 0 0 6px;
}
.opp-scan .spread-chart-link a {
  font-weight: 600;
  white-space: nowrap;
}

/* Dual Book — Positions blotter, same navy/paper chrome */
.dual-book {
  margin: 4px 0 14px;
}
.dual-book h3 {
  margin: 0 0 8px;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.dual-cols {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
@media (max-width: 980px) {
  .dual-cols { grid-template-columns: 1fr; }
}
.dual-col {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 12px 13px;
}
.dual-col h4 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.dual-col p {
  margin: 0 0 8px;
  color: var(--ink-dim);
  font-size: 12.5px;
}
.dual-col .kv {
  margin: 0;
  grid-template-columns: 118px 1fr;
}
.dual-note {
  margin: 8px 0 0;
  color: var(--quiet);
  font-size: 11px;
}
.dual-book-line {
  margin: 8px 0 0;
  color: var(--ink-dim);
  font-size: 12px;
}
.dual-book-line a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
}
.dual-book-line a:hover { color: #29B6F6; }
body[data-view="desk"] .dual-book {
  margin: 8px 0 6px;
}
body[data-view="desk"] .dual-cols {
  grid-template-columns: 1fr;
}
body[data-view="desk"] .dual-book h3 { font-size: 14px; margin-bottom: 6px; }
body[data-view="desk"] .dual-col { padding: 8px 10px; }
body[data-view="desk"] .dual-col p { font-size: 11.5px; margin-bottom: 4px; }
body[data-view="desk"] .dual-note { font-size: 10.5px; }

/* Family heading glossary — themed hover, not native title= */
.gloss {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
}
/* Dotted glossary cue via text-decoration (paint) — not border-bottom (box metrics / table reflow). */
.gloss-link {
  color: inherit;
  text-decoration: underline dotted var(--quiet);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  border-bottom: 0 none;
}
.gloss-link:hover {
  color: var(--ink);
  text-decoration-color: var(--ink);
}
.gloss-tip {
  display: none;
  position: absolute;
  z-index: 40;
  left: 50%;
  top: calc(100% + 6px);
  transform: translateX(-50%);
  width: max-content;
  max-width: 280px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
  line-height: 1.4;
  box-shadow: var(--shadow);
  white-space: normal;
}
.gloss:hover .gloss-tip,
.gloss:focus-within .gloss-tip { display: block; }
.gloss-more {
  display: inline-block;
  margin-left: 4px;
  color: #29B6F6;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}
.stmt-kv .gloss,
.stmt-me-dl .gloss { display: inline-flex; align-items: flex-start; }

/* Board chrome terms — hover tip + Education jump (novice) */
.term.gloss { display: inline; max-width: none; }
.nav .term.gloss { display: inline; }
.nav .gloss-tip { left: 0; transform: none; max-width: 240px; }
.ticket[id] { scroll-margin-top: 72px; }
.best-value-line .bv-jump { margin-left: 10px; white-space: nowrap; }
.rr-ratio { font-family: "Plex Mono", ui-monospace, monospace; font-weight: 600; }
.mo-ah-pill[title], .session-term[title] { cursor: help; }

/* Education */
body[data-view="education"] .stage { min-height: 0; }
body[data-view="education"] .focus-education { min-height: 0; }
body[data-view="education"] .panel-b.edu {
  overflow: auto;
  padding-bottom: 28px;
}
.edu-start {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  margin: 0 0 8px;
}
.edu-start-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  scroll-margin-top: 12px;
}
.edu-start-h {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}
.edu-start-n {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #F5D76E;
  border: 1px solid #F5D76E;
}
.edu-start-card h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.edu-start-card p {
  margin: 0 0 6px;
  color: var(--ink-dim);
  font-size: 12.5px;
}
.edu-start-next {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.edu-start-next a {
  color: var(--ink-dim);
  border-bottom: 1px dotted var(--quiet);
}
.edu-start-next a:hover { color: var(--ink); }
.edu-lead {

  margin: 0 0 14px;
  color: var(--ink-dim);
  font-size: 13.5px;
  max-width: 72ch;
}

.edu-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 0 0 16px;
  padding: 4px 0 12px;
  border-bottom: 1px solid var(--line);
}
.edu-jump a {
  font-family: "Fraunces", Georgia, serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.edu-jump a:hover { color: var(--edu-video); border-bottom-color: var(--edu-video); }

.edu-jump a.on {
  color: var(--edu-video);
  border-bottom: 2px solid var(--edu-video);
}
#videos, #basic-terms, #core-positions, #option-strategies, #edu-indicators, #edu-chart-types, #edu-candle-patterns, #edu-trend-tools, #edu-crypto, #edu-crypto-fundamentals, #start-here, #payoff-diagrams-gallery {
  scroll-margin-top: 12px;
}

.edu-h {
  margin: 18px 0 8px;
  font-family: "Fraunces", Georgia, serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}
.edu-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: 0 0 14px;
  font-size: 12px;
}
.edu-toc a {
  color: var(--ink-dim);
  border-bottom: 1px dotted var(--quiet);
}
.edu-toc a:hover { color: var(--ink); }
.edu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
}
.edu-term {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  scroll-margin-top: 12px;
}
.edu-term h3,
.edu-strat h3 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.edu-term a {
  color: var(--ink-dim);
  border-bottom: 1px dotted var(--quiet);
}
.edu-term a:hover { color: var(--ink); }
.edu-term p, .edu-strat p {
  margin: 0 0 6px;
  color: var(--ink-dim);
  font-size: 12.5px;
}
.edu-strats { display: flex; flex-direction: column; gap: 14px; }
.edu-strat {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  scroll-margin-top: 12px;
}
.edu-strat-h {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}
.path-tag {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: none;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  white-space: nowrap;
}
.path-tag.sleeve-core { color: var(--paper); border-color: var(--paper); }
.path-tag.sleeve-options { color: #29B6F6; border-color: #29B6F6; }
.path-tag.sleeve-crypto { color: #FDD835; border-color: #FDD835; }
.edu-strat .when { color: var(--muted); }
.edu-strat .when span { color: var(--ink); font-weight: 500; }
.edu-watch {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.edu-watch a {
  color: var(--edu-video);
  font-weight: 600;
  border-bottom: 2px solid var(--edu-video);
}
.edu-watch a:hover { color: var(--ink); border-bottom-color: var(--ink); }
.edu-back {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--muted);
}
.edu-back a {
  color: var(--ink-dim);
  border-bottom: 1px dotted var(--quiet);
}
.edu-back a:hover { color: var(--ink); }
.edu-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 10px;
}
.edu-diagram {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  scroll-margin-top: 12px;
}
.edu-diagram h3 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.edu-diagram .payoff-svg { max-width: 100%; }
#payoff-diagrams-gallery { scroll-margin-top: 12px; }
.payoff { margin: 8px 0 0; }
.payoff-svg {
  width: 100%;
  max-width: 520px;
  height: auto;
  display: block;
  background: var(--chart-pane);
  border: 1px solid var(--chart-stroke);
  border-radius: 8px;
  color: var(--quiet);
}
.payoff-svg .pay-axis { stroke: var(--chart-stroke); stroke-width: 1; }
.payoff-svg text { fill: var(--quiet); font-size: 10px; font-family: "Plex Mono", monospace; }
.payoff-svg .pay-zero { font-size: 9px; }
.payoff figcaption {
  margin: 4px 0 0;
  color: var(--quiet);
  font-size: 11px;
}

@media print {
  .gloss-tip, .gloss-more { display: none !important; }
  .gloss-link {
    color: inherit !important;
    text-decoration: none !important;
    border-bottom: 0 none !important;
  }
  .criteria, .spread-chart-link { display: none !important; }
}

.edu-videos { margin: 8px 0 28px; display: flex; flex-direction: column; gap: 18px; }
.edu-videos-group h4 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
}
.edu-videos-list {
  margin: 6px 0 0;
  padding-left: 1.2em;
}
.edu-videos-list li { margin: 4px 0; }
.edu-videos-list a,
.edu-watch a {
  color: var(--edu-video);
  font-weight: 600;
  border-bottom: 2px solid var(--edu-video);
}
.edu-videos-list a:hover,
.edu-watch a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

body.family-gate {
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  box-sizing: border-box;
  background: #132B45;
  color: #fff;
}
.gate {
  box-sizing: border-box;
  width: min(420px, 100%);
  max-width: 100%;
  padding: 28px 24px;
  border: 1px solid #2A5578;
  border-radius: 16px;
  background: #183552;
  text-align: left;
  overflow: hidden;
}
.gate .mascot {
  display: block;
  margin: 0 auto 10px;
}
.gate .gate-wordmark,
.gate img.wordmark {
  /* Beat global .wordmark max-width:min(560px,46vw) on the login card */
  max-width: 100% !important;
  width: 100%;
  height: auto;
  max-height: 40px;
}
.gate h1 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 22px;
  margin: 12px 0 8px;
}
.gate p { color: #c8c8c8; margin: 0 0 14px; font-size: 14px; }
.gate-err { color: #FF6D00 !important; }
.gate-ok { color: #FDD835 !important; }
.gate a { color: #FDD835; }
.gate-note { font-size: 12px !important; color: #9a9a9a !important; }
.gate form { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }
.gate label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.gate input {
  background: #0F243C;
  color: #fff;
  border: 1px solid #2A5578;
  border-radius: 8px;
  padding: 10px 12px;
}
.gate button {
  background: #FDD835;
  color: #132B45;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}


a.pill {
  text-decoration: none;
  color: inherit;
}
/* Header Logout — clear session cookie via /logout */
a.pill.pill-logout {
  cursor: pointer;
}


/* Opportunity scan: sort + filter. Do not touch family-statement print.
   No overflow-x here — it creates a sticky containing block and breaks
   thead stickiness vs .panel-b (overflow:auto). Horizontal scroll stays on panel-b. */
.opp-scan-wrap {
  max-width: 100%;
}
table.opp-scan {
  width: 100%;
}
table.opp-scan th.sortable {
  cursor: pointer;
  user-select: none;
  text-transform: none;
  letter-spacing: 0.02em;
  white-space: nowrap;
  font-size: 11px;
  color: var(--quiet);
}
table.opp-scan th.sortable:hover {
  color: var(--ink);
}
table.opp-scan th.sortable.sorted-asc::after,
table.opp-scan th.sortable.sorted-desc::after {
  font-size: 9px;
  margin-left: 4px;
  color: var(--ink);
}
table.opp-scan th.sortable.sorted-asc::after { content: "▲"; }
table.opp-scan th.sortable.sorted-desc::after { content: "▼"; }
/* Sticky column headings while Opportunities .panel-b scrolls.
   Solid --bg so rows do not show through (dark #132B45 / light white). */
table.opp-scan thead tr.opp-head th {
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 3;
  padding: 4px 8px 6px 0;
  box-shadow: 0 1px 0 var(--line-soft);
}
table.opp-scan thead tr.opp-filter th {
  position: sticky;
  top: 22px;
  background: var(--bg);
  z-index: 3;
  padding: 0 6px 8px 0;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  border-bottom: 1px solid var(--line-soft);
}
/* Corner cell if a left-sticky ticker column is added later. */
table.opp-scan thead th.opp-sticky,
table.opp-scan thead th:first-child.mo-sticky {
  z-index: 4;
  background: var(--bg);
}
table.opp-scan thead tr.opp-filter select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  height: 24px;
  font-size: 11px;
  font-family: "Plex Sans", system-ui, sans-serif;
  background: var(--input-bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 6px;
  cursor: pointer;
}
table.opp-scan thead tr.opp-filter select:focus {
  outline: 1px solid var(--line);
  outline-offset: 0;
}
table.opp-scan thead tr.opp-filter select option {
  background: var(--input-bg);
  color: var(--ink);
}
table.opp-scan td {
  padding: 6px 8px 6px 0;
  white-space: nowrap;
}
body[data-view="opportunity"] .focus-opportunity table.opp-scan-iso td,
body[data-view="opportunity"] .focus-opportunity table.opp-scan-iso th {
  font-size: 12px;
}

/* Ellis 0.3 TA timing summary — display only, not a sixth window */
.ta-timing {
  display: block;
  margin: 4px 0 0;
  max-width: 38rem;
  white-space: normal;
  font-size: 11px;
  line-height: 1.35;
  font-weight: 400;
  color: var(--ink-dim);
}
.ticket .ta-timing {
  margin: 8px 0 0;
  max-width: 42rem;
}

/* Market Overview + After Hours Move dedicated window */
body[data-view="market"] .focus-market { display: flex; }
body:not([data-view="market"]) .focus-market { display: none; }
body[data-view="ah-move"] .focus-ah-move { display: flex; }
body:not([data-view="ah-move"]) .focus-ah-move { display: none; }


body[data-view="options-chain"] .focus-options-chain { display: flex; }
body:not([data-view="options-chain"]) .focus-options-chain { display: none; }

body[data-view="historical-options-chain"] .focus-historical-options-chain { display: flex; }
body:not([data-view="historical-options-chain"]) .focus-historical-options-chain { display: none; }

body[data-view="options-chain"] .mo-table.stats-table {
  font-size: 12px;
}
body[data-view="options-chain"] .mo-table th,
body[data-view="options-chain"] .mo-table td {
  padding: 4px 6px;
  white-space: nowrap;
}
body[data-view="options-chain"] .oc-wrap {
  max-height: min(70vh, 720px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}
/* Sticky two-row thead (E*TRADE-style Calls | Strike | Puts) */
body[data-view="options-chain"] .oc-table thead th {
  position: sticky;
  background: var(--panel);
  box-shadow: 0 1px 0 var(--line);
  z-index: 3;
}
body[data-view="options-chain"] .oc-table thead tr.oc-group th {
  top: 0;
  z-index: 5;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding-top: 6px;
  padding-bottom: 6px;
}
body[data-view="options-chain"] .oc-table thead tr.oc-sub th {
  top: 28px;
  z-index: 4;
  font-weight: 600;
  font-size: 11px;
}
body[data-view="options-chain"] .oc-table thead th.oc-strike-h,
body[data-view="options-chain"] .oc-table thead th.oc-act-h {
  top: 0;
  z-index: 6;
  vertical-align: middle;
}
/* Colorblind-safe group tint: teal calls / azure puts + text labels */
body[data-view="options-chain"] .oc-table th.oc-calls-h,
body[data-view="options-chain"] .oc-table th.oc-calls,
body[data-view="options-chain"] .oc-table td.oc-call {
  background: color-mix(in srgb, #2f6f68 16%, var(--panel));
}
body[data-view="options-chain"] .oc-table th.oc-puts-h,
body[data-view="options-chain"] .oc-table th.oc-puts,
body[data-view="options-chain"] .oc-table td.oc-put {
  background: color-mix(in srgb, #3d6a9e 16%, var(--panel));
}
body[data-view="options-chain"] .oc-table th.oc-strike-h,
body[data-view="options-chain"] .oc-table td.strike {
  text-align: center;
  background: color-mix(in srgb, var(--panel) 82%, var(--accent, #3d7ea6) 18%);
  font-weight: 700;
}
body[data-view="options-chain"] .oc-table tr.oc-atm td.strike {
  font-weight: 800;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent, #3d7ea6) 50%, transparent);
}
body[data-view="options-chain"] .oc-table a.oc-qcell {
  display: block;
  color: inherit;
  text-decoration: none;
  min-height: 1.2em;
}
body[data-view="options-chain"] .oc-table a.oc-qcell:hover {
  color: var(--accent, #6eb6ff);
  text-decoration: underline;
}
body[data-view="options-chain"] .oc-ticker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: end;
  margin: 8px 0 10px;
}
body[data-view="options-chain"] .oc-exps {
  margin: 6px 0 12px;
  flex-wrap: wrap;
}
body[data-view="options-chain"] .oc-table tr.oc-row-sel td {
  outline: 1px solid color-mix(in srgb, var(--accent, #3d7ea6) 55%, transparent);
}
body[data-view="options-chain"] .oc-link {
  color: var(--accent, #6eb6ff);
  text-decoration: none;
  font-size: 11px;
}
body[data-view="options-chain"] .oc-link:hover { text-decoration: underline; }
body[data-view="options-chain"] .oc-builder {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 92%, #000 8%);
}
body[data-view="options-chain"] .oc-empty {
  padding: 18px 8px;
}
body[data-view="options-chain"] .oc-banner {
  margin: 10px 0 12px;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.45;
}
body[data-view="options-chain"] .oc-banner-warn {
  background: color-mix(in srgb, #c45c26 22%, var(--panel));
  border-color: color-mix(in srgb, #c45c26 55%, var(--line));
  color: var(--ink);
}
body[data-view="options-chain"] .oc-banner-info {
  background: color-mix(in srgb, var(--accent, #3d7ea6) 18%, var(--panel));
  border-color: color-mix(in srgb, var(--accent, #3d7ea6) 45%, var(--line));
}
body[data-view="options-chain"] .oc-banner strong {
  font-weight: 700;
}
body[data-view="options-chain"] .oc-ticker button.seg {
  cursor: pointer;
  border: 1px solid var(--line);
  min-height: 36px;
  padding: 0 16px;
}
body[data-view="options-chain"] td.mid {
  color: var(--ink);
  font-weight: 600;
}

/* Batch 5 — Nora one-screen vertical builder */
body[data-view="options-chain"] .oc-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 88%, var(--accent, #3d7ea6) 12%);
  font-size: 13px;
  line-height: 1.35;
}
body[data-view="options-chain"] .oc-strip-name {
  font-weight: 700;
  letter-spacing: 0.02em;
}
body[data-view="options-chain"] .oc-strip-dot {
  opacity: 0.55;
  user-select: none;
}
body[data-view="options-chain"] .oc-kind {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 4px 0 8px;
}
body[data-view="options-chain"] .oc-kind .seg {
  text-decoration: none;
}
body[data-view="options-chain"] .oc-vb-table thead tr.oc-group th {
  top: 0;
}
body[data-view="options-chain"] .oc-vb-table td.oc-leg-on {
  outline: 1px solid color-mix(in srgb, var(--accent, #3d7ea6) 70%, transparent);
  font-weight: 700;
}
body[data-view="options-chain"] .oc-vb-table td.oc-leg-locked .oc-qcell-mute {
  opacity: 0.55;
  cursor: default;
}
body[data-view="options-chain"] .oc-vb-card {
  position: sticky;
  top: 0;
  z-index: 9;
  margin: 8px 0 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 92%, #000 8%);
  box-shadow: 0 6px 18px color-mix(in srgb, #000 28%, transparent);
}
body[data-view="options-chain"] .oc-vb-label {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 6px;
}
body[data-view="options-chain"] .oc-vb-metrics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-bottom: 4px;
}
body[data-view="options-chain"] .oc-meet-yes { color: #3fae7a; font-weight: 600; }
body[data-view="options-chain"] .oc-meet-no { color: #d0894a; font-weight: 600; }
body[data-view="options-chain"] .oc-meet-na { opacity: 0.8; }
body[data-view="options-chain"] .oc-vb-thin,
body[data-view="options-chain"] .oc-vb-risk,
body[data-view="options-chain"] .oc-vb-fill {
  margin-top: 2px;
}
body[data-view="options-chain"] .oc-change {
  margin: 4px 0 8px;
  font-size: 12px;
}
body[data-view="options-chain"] .oc-tape {
  margin: 12px 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 94%, #000 6%);
}
body[data-view="options-chain"] .oc-tape > summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}
body[data-view="options-chain"] .oc-tape > summary::-webkit-details-marker { display: none; }
body[data-view="options-chain"] .oc-tape-sum {
  color: inherit;
  text-decoration: none;
}
body[data-view="options-chain"] .oc-tape-sum:hover { text-decoration: underline; }
body[data-view="options-chain"] .oc-tape-empty {
  margin: 8px 0 2px;
}
body[data-view="options-chain"] .oc-confirm {
  margin: 14px 0 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
body[data-view="options-chain"] .oc-confirm .ticket {
  margin-top: 8px;
}


/* Historical Options Chain — reuse live oc sticky Calls|Strike|Puts chrome */
body[data-view="historical-options-chain"] .mo-table.stats-table {
  font-size: 12px;
}
body[data-view="historical-options-chain"] .mo-table th,
body[data-view="historical-options-chain"] .mo-table td {
  padding: 4px 6px;
  white-space: nowrap;
}
body[data-view="historical-options-chain"] .oc-wrap {
  max-height: min(70vh, 720px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}
body[data-view="historical-options-chain"] .oc-table thead th {
  position: sticky;
  background: var(--panel);
  box-shadow: 0 1px 0 var(--line);
  z-index: 3;
}
body[data-view="historical-options-chain"] .oc-table thead tr.oc-group th {
  top: 0;
  z-index: 5;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding-top: 6px;
  padding-bottom: 6px;
}
body[data-view="historical-options-chain"] .oc-table thead tr.oc-sub th {
  top: 28px;
  z-index: 4;
  font-weight: 600;
  font-size: 11px;
}
body[data-view="historical-options-chain"] .oc-table thead th.oc-strike-h,
body[data-view="historical-options-chain"] .oc-table thead th.oc-act-h {
  top: 0;
  z-index: 6;
  vertical-align: middle;
}
body[data-view="historical-options-chain"] .oc-table th.oc-calls-h,
body[data-view="historical-options-chain"] .oc-table th.oc-calls,
body[data-view="historical-options-chain"] .oc-table td.oc-call {
  background: color-mix(in srgb, #2f6f68 16%, var(--panel));
}
body[data-view="historical-options-chain"] .oc-table th.oc-puts-h,
body[data-view="historical-options-chain"] .oc-table th.oc-puts,
body[data-view="historical-options-chain"] .oc-table td.oc-put {
  background: color-mix(in srgb, #3d6a9e 16%, var(--panel));
}
body[data-view="historical-options-chain"] .oc-table th.oc-strike-h,
body[data-view="historical-options-chain"] .oc-table td.strike {
  text-align: center;
  background: color-mix(in srgb, var(--panel) 82%, var(--accent, #3d7ea6) 18%);
  font-weight: 700;
}
body[data-view="historical-options-chain"] .oc-table tr.oc-atm td.strike {
  font-weight: 800;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent, #3d7ea6) 50%, transparent);
}
body[data-view="historical-options-chain"] .oc-ticker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: end;
  margin: 8px 0 10px;
}
body[data-view="historical-options-chain"] .oc-empty { padding: 12px; }
body[data-view="historical-options-chain"] .oc-banner {
  margin: 8px 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
}
body[data-view="historical-options-chain"] .oc-banner-warn {
  background: color-mix(in srgb, #a67c2a 18%, var(--panel));
}
body[data-view="historical-options-chain"] .oc-banner-info {
  background: color-mix(in srgb, #3d6a9e 14%, var(--panel));
}
body[data-view="historical-options-chain"] .oc-banner strong {
  font-weight: 700;
}
body[data-view="historical-options-chain"] .oc-ticker button.seg {
  align-self: end;
}
body[data-view="historical-options-chain"] td.mid {
  font-weight: 600;
}


/* Compact / resizable MO + After Hours Move shell — scoped so other views keep fixed 1440 board. */
body[data-view="market"] .app,
body[data-view="ah-move"] .app {
  width: 100%;
  min-width: 640px;
  max-width: 100%;
  height: auto;
  min-height: 0;
}
body[data-view="market"] .shell,
body[data-view="ah-move"] .shell {
  min-width: 0;
}


body[data-view="market"] .stage,
body[data-view="ah-move"] .stage {
  padding: 10px 12px 12px;
}

.mo-wrap { margin-top: 4px; }
.mo-table {
  /* Batch 1: widen Markets columns; horizontal scroll/slider stays on the wrap. */
  min-width: 1320px;
  width: 100%;
  font-size: 12px;
}
body[data-view="market"] .mo-table.stats-table,
body[data-view="ah-move"] .mo-table.stats-table {
  min-width: 1320px;
}
body[data-view="market"] .mo-table th,
body[data-view="ah-move"] .mo-table th {
  padding: 3px 8px 5px;
  font-size: 10px;
  text-align: center; /* headings stay centered */
}
body[data-view="market"] .mo-table td,
body[data-view="ah-move"] .mo-table td {
  padding: 4px 8px;
  min-width: 68px;
  font-size: 12px;
}
body[data-view="market"] .mo-table th.num-usd,
body[data-view="market"] .mo-table td.num-usd,
body[data-view="ah-move"] .mo-table th.num-usd,
body[data-view="ah-move"] .mo-table td.num-usd {
  min-width: 7.25rem;
}
body[data-view="market"] .mo-table th.num-pct,
body[data-view="market"] .mo-table td.num-pct,
body[data-view="ah-move"] .mo-table th.num-pct,
body[data-view="ah-move"] .mo-table td.num-pct {
  min-width: 5.75rem;
}
/* Numeric data: right-align + tabular nums so DJIA vs DIA read cleanly. Headings stay centered. */
body[data-view="market"] .mo-table td.mono,
body[data-view="market"] .mo-table td.num-usd,
body[data-view="market"] .mo-table td.num-pct,
body[data-view="ah-move"] .mo-table td.mono,
body[data-view="ah-move"] .mo-table td.num-usd,
body[data-view="ah-move"] .mo-table td.num-pct {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
body[data-view="market"] .mo-table td.mo-ticker,
body[data-view="ah-move"] .mo-table td.mo-ticker,
body[data-view="market"] .mo-table td.mo-session,
body[data-view="ah-move"] .mo-table td.mo-session {
  text-align: left;
  font-variant-numeric: normal;
}
body[data-view="market"] .mo-table th .th-stack,
body[data-view="ah-move"] .mo-table th .th-stack {
  min-height: 2.2em;
  line-height: 1.2;
}

/* Market Overview + After Hours Move: click column heads to sort (client-side). */
table.mo-table th.sortable {
  cursor: pointer;
  user-select: none;
}
table.mo-table th.sortable:hover {
  color: var(--ink);
}
table.mo-table th.sortable.sorted-asc::after,
table.mo-table th.sortable.sorted-desc::after {
  font-size: 9px;
  margin-left: 3px;
  color: var(--ink);
  vertical-align: middle;
}
table.mo-table th.sortable.sorted-asc::after { content: "▲"; }
table.mo-table th.sortable.sorted-desc::after { content: "▼"; }
[data-theme="light"] table.mo-table th.sortable.sorted-asc::after,
[data-theme="light"] table.mo-table th.sortable.sorted-desc::after {
  color: var(--ink);
}


/* Sticky Ticker column when the dense table scrolls horizontally. */
body[data-view="market"] .mo-table th.mo-sticky,
body[data-view="market"] .mo-table td.mo-ticker,
body[data-view="market"] .mo-table th:first-child,
body[data-view="market"] .mo-table td:first-child,
body[data-view="ah-move"] .mo-table th.mo-sticky,
body[data-view="ah-move"] .mo-table td.mo-ticker,
body[data-view="ah-move"] .mo-table th:first-child,
body[data-view="ah-move"] .mo-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface);
  box-shadow: 1px 0 0 var(--line-soft);
}
body[data-view="market"] .mo-table thead th:first-child,
body[data-view="ah-move"] .mo-table thead th:first-child {
  z-index: 3;
  background: var(--surface);
}

.mo-chart-link {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px dotted var(--line);
  cursor: pointer;
}
.mo-chart-link:hover {
  color: var(--up);
  border-bottom-color: var(--up);
}
[data-theme="light"] .mo-chart-link:hover {
  color: #0a5a9c;
  border-bottom-color: #0a5a9c;
}

/* Light mode: MO Daily Change $/% in blue (red/green colorblind) */
[data-theme="light"] .mo-table td.num-usd.up,
[data-theme="light"] .mo-table td.num-usd.down,
[data-theme="light"] .mo-table td.num-pct.up,
[data-theme="light"] .mo-table td.num-pct.down {
  color: #1565C0;
}

.mo-h {
  margin: 12px 0 3px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.mo-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: flex-end;
  margin: 8px 0 12px;
}
.mo-add {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.mo-lab {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mo-lab input {
  height: 32px;
  min-width: 110px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  font-family: "Plex Mono", monospace;
  font-size: 13px;
  text-transform: uppercase;
}
.mo-btn {
  height: 32px;
  padding: 0 14px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #12324f;
  color: #e8f0f8;
  font-size: 12px;
  cursor: pointer;
}
[data-theme="light"] .mo-btn {
  background: #132B45;
  color: #f4f7fb;
}
.mo-btn-remove {
  background: transparent;
  color: var(--ink-dim);
  border-color: var(--line-soft);
  height: 28px;
  font-size: 11px;
}
.mo-removes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.mo-flash {
  margin: 0 0 10px;
  font-size: 13px;
}
.mo-flash.mo-ok { color: var(--up); }
.mo-flash.mo-err { color: var(--amber); }


/* After Hours Move section under Market Overview */
.mo-ah-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin: 0 0 8px;
}
.mo-ah-head .caption {
  margin: 0;
}
.mo-ah-pill {
  border-color: #3a7ebd;
  color: #8ec7f0;
}
[data-theme="light"] .mo-ah-pill {
  border-color: #1565C0;
  color: #1565C0;
}
.mo-session {
  font-weight: 600;
  letter-spacing: 0.04em;
}
.mo-session-pre,
.mo-session-post,
.mo-session-overnight {
  color: #8ec7f0;
}
.mo-session-rth {
  color: var(--ink-dim);
}
.mo-session-on,
.mo-session-we {
  color: #8ec7f0;
}
[data-theme="light"] .mo-session-on,
[data-theme="light"] .mo-session-we {
  color: #1565C0;
}
.mo-ticker-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.mo-row-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 4px;
  max-width: 220px;
}
.mo-row-chip {
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  padding: 1px 5px;
  border-radius: 999px;
  border: 1px solid var(--line, #2a3340);
  color: var(--ink-dim, #9aa4b2);
  white-space: nowrap;
}
.mo-row-chip-src { border-color: #3a7ebd; color: #8ec7f0; }
.mo-row-chip-sess { border-color: #5a6a7a; }
.mo-row-chip-asof { opacity: 0.9; }
.mo-row-chip-stale,
.mo-stale-pill {
  border-color: #c9a227;
  color: #e6c35c;
}
[data-theme="light"] .mo-row-chip-src { border-color: #1565C0; color: #1565C0; }
[data-theme="light"] .mo-row-chip-stale,
[data-theme="light"] .mo-stale-pill {
  border-color: #b8860b;
  color: #8a6508;
}
tr.mo-row-stale td.num-usd,
tr.mo-row-stale td.num-pct {
  opacity: 0.55;
}

[data-theme="light"] .mo-session-pre,
[data-theme="light"] .mo-session-post,
[data-theme="light"] .mo-session-overnight {
  color: #1565C0;
}

/* After Hours Move dedicated window chrome */
body[data-view="ah-move"] .focus-ah-move .panel-h {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
}
body[data-view="ah-move"] .focus-ah-move .panel-h .mo-ah-pill {
  margin-left: auto;
}
body[data-view="ah-move"] .nav a[data-view="ah-move"] .sub {
  display: none !important;
}

.nav a .sub {
  display: none !important;
}

/* nav crumbs off — titles only (no tape / PRE·POST / Recommended Spread) */
/* nav rail: no separator rules between title-only tabs */
.nav hr, .rail hr { display: none; }

.nav a .sub { display: none !important; }


/* BROKER MONTHLY PNL PATRICK ONLY */
.broker-pnl {
  margin-top: 18px;
  padding-top: 8px;
  border-top: 1px solid var(--line, #2a3340);
}
.broker-pnl-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 12px;
}
.broker-pnl-card {
  margin-top: 8px;
}
.broker-pnl-card-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.broker-pnl-card-h h4 {
  margin: 0;
  font-size: 1.05rem;
}
.broker-pnl-headline {
  margin: 10px 0 6px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line, #2a3340);
  background: color-mix(in srgb, var(--surface, #121820) 88%, #1b6ef5 12%);
}
.broker-pnl-headline-label {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.85;
}
.broker-pnl-headline-value {
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.15;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.broker-pnl-headline-sub {
  margin-top: 4px;
  font-size: 0.82rem;
  opacity: 0.8;
}
.broker-pnl-secondary {
  opacity: 0.9;
  font-size: 0.9rem;
}
.broker-pnl-actions {
  display: flex;
  gap: 8px;
}

/* Account P&L stacked chart — colorblind legend cue (PNG has hatch+labels too) */
.broker-pnl-stack-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin: 4px 0 8px;
  font-size: 12px;
  color: var(--muted);
}
.broker-pnl-stack-legend .swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  vertical-align: -1px;
  border-radius: 2px;
}
.broker-pnl-stack-legend .swatch.booked { background: #29B6F6; }
.broker-pnl-stack-legend .swatch.unrealized {
  background: #FF6D00;
  background-image: repeating-linear-gradient(
    -45deg, transparent, transparent 2px, rgba(0,0,0,0.25) 2px, rgba(0,0,0,0.25) 4px
  );
}
.broker-pnl-stack-legend .swatch.total {
  background: #FFD54F;
  border-radius: 0;
  height: 3px;
  width: 16px;
  vertical-align: 3px;
}
body[data-theme="light"] .broker-pnl-stack-legend .swatch.booked { background: #0288D1; }
body[data-theme="light"] .broker-pnl-stack-legend .swatch.total { background: #0B1F33; }

.broker-pnl-chart-wrap {
  margin: 10px 0 12px;
  overflow-x: auto;
}
.broker-pnl-chart {
  display: block;
  width: min(100%, 980px);
  height: auto;
  border-radius: 8px;
  /* Match panel surface — chart PNG also uses --surface navy/light (no black box) */
  background: transparent;
}
body[data-theme="dark"] .broker-pnl-chart,
html[data-theme="dark"] .broker-pnl-chart {
  background: transparent;
}
.broker-pnl-table {
  margin-top: 4px;
}
@media print {
  .broker-pnl-tabs { display: none !important; }
  .broker-pnl-card { break-inside: avoid; }
  .broker-pnl-card[hidden] { display: block !important; }
}


/* Patrick-only open positions (mark-to-market) */
.broker-positions {
  margin-top: 1.25rem;
}
.broker-pos-card[hidden] {
  display: none !important;
}
.broker-pos-table {
  font-size: 0.92rem;
}
@media print {
  .broker-pos-card { break-inside: avoid; }
  .broker-pos-card[hidden] { display: block !important; }
}


/* —— denser Chart (same tab, up to 8 panes · resize · max/min) —— */
.chart-multi .chart-multi-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}
.chart-multi-tools {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.chart-add-pane { text-decoration: none; display: inline-flex; align-items: center; }
.chart-add-pane.muted { opacity: 0.45; pointer-events: none; }
.chart-link-xh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  user-select: none;
}
.chart-link-xh input { accent-color: var(--up); }
.chart-pane-rail {
  display: none;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0 0 8px;
}
.chart-multi-grid {
  display: grid;
  gap: 12px;
  align-items: stretch;
}
.chart-multi-grid[data-count="2"] {
  grid-template-columns: 1fr 1fr;
}
.chart-multi-grid[data-count="3"],
.chart-multi-grid[data-count="4"] {
  grid-template-columns: 1fr 1fr;
}
.chart-multi-grid[data-count="5"],
.chart-multi-grid[data-count="6"] {
  grid-template-columns: 1fr 1fr 1fr;
}
.chart-multi-grid[data-count="7"],
.chart-multi-grid[data-count="8"] {
  grid-template-columns: 1fr 1fr 1fr 1fr;
}
.chart-pane {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px 8px;
  min-width: 280px;
  min-height: 220px;
  max-width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  gap: 6px;
  resize: both;
  overflow: hidden;
  position: relative;
}
.chart-pane.is-focus {
  border: 2px solid #29B6F6;
  box-shadow: 0 0 0 1px rgba(41, 182, 246, 0.35);
}
.chart-pane.is-minimized,
.chart-pane[hidden] {
  display: none !important;
}
.chart-pane-h {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.chart-pane-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
}
.chart-pane-form label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  color: var(--muted);
}
.chart-pane-form input[name="symbol_edit"] {
  height: 28px;
  min-width: 88px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--ink);
  padding: 0 8px;
  font-family: "Plex Mono", ui-monospace, monospace;
  text-transform: uppercase;
}
.chart-pane-acts {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.chart-pane-act,
.chart-pane-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  text-decoration: none;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}
.chart-pane-act:hover,
.chart-pane-remove:hover {
  color: var(--ink);
  border-color: var(--ink);
}
.chart-pane-remove {
  font-size: 20px;
}
.chart-pane .chart-pane-wrap {
  flex: 1 1 auto;
  min-height: 160px;
  height: 420px;
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.chart-pane .chart-pane-wrap svg {
  width: 100%;
  height: 100%;
  display: block;
}
.chart-pane-status {
  margin: 0;
  font-size: 11px;
  color: var(--quiet);
}
body[data-view="chart"] .chart-multi .panel-b {
  display: flex;
  flex-direction: column;
  overflow: auto;
  position: relative;
}
/* Maximize — fill Chart stage */
.chart-multi.is-maximized .chart-multi-grid {
  display: block;
  min-height: min(72vh, 820px);
}
.chart-multi.is-maximized .chart-multi-grid .chart-pane {
  display: none !important;
  resize: none;
}
.chart-multi.is-maximized .chart-multi-grid .chart-pane.is-maximized {
  display: flex !important;
  position: relative;
  width: 100% !important;
  height: min(72vh, 820px) !important;
  max-width: none;
  max-height: none;
  min-width: 0;
  min-height: 280px;
  z-index: 2;
  resize: none;
}
.chart-multi.is-maximized .chart-multi-grid .chart-pane.is-maximized .chart-pane-wrap {
  min-height: 0;
  height: auto;
  flex: 1 1 auto;
}
.chart-multi.is-maximized .chart-pane-rail { display: none !important; }

/* Bottom dock for minimized panes */
.chart-min-dock {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 10px 0 4px;
  padding: 8px 10px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.chart-min-dock[hidden] { display: none !important; }
.chart-min-dock-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 4px;
}
.chart-min-dock-chip {
  min-height: 44px;
  padding: 0 14px;
  text-decoration: none;
}

/* Dense counts: slightly shorter default wraps */
.chart-multi-grid[data-count="5"] .chart-pane-wrap,
.chart-multi-grid[data-count="6"] .chart-pane-wrap,
.chart-multi-grid[data-count="7"] .chart-pane-wrap,
.chart-multi-grid[data-count="8"] .chart-pane-wrap {
  min-height: 240px;
  height: 300px;
}

/* Medium: prefer 2–3 cols before crushing */
@media (max-width: 1400px) {
  .chart-multi-grid[data-count="5"],
  .chart-multi-grid[data-count="6"],
  .chart-multi-grid[data-count="7"],
  .chart-multi-grid[data-count="8"] {
    grid-template-columns: 1fr 1fr 1fr;
  }
}
@media (max-width: 1280px) {
  .chart-multi-grid[data-count="3"],
  .chart-multi-grid[data-count="4"],
  .chart-multi-grid[data-count="5"],
  .chart-multi-grid[data-count="6"],
  .chart-multi-grid[data-count="7"],
  .chart-multi-grid[data-count="8"] {
    grid-template-columns: 1fr 1fr;
  }
  .chart-pane .chart-pane-wrap {
    min-height: 280px;
    height: 360px;
  }
}
@media (max-width: 980px) {
  .chart-pane-rail { display: flex; }
  .chart-pane { resize: none; }
  .chart-multi-grid[data-count="2"],
  .chart-multi-grid[data-count="3"],
  .chart-multi-grid[data-count="4"],
  .chart-multi-grid[data-count="5"],
  .chart-multi-grid[data-count="6"],
  .chart-multi-grid[data-count="7"],
  .chart-multi-grid[data-count="8"] {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }
  .chart-multi-grid .chart-pane { display: none; }
  .chart-multi-grid .chart-pane.is-focus,
  .chart-multi-grid[data-active-pane="0"] .chart-pane[data-pane="0"],
  .chart-multi-grid[data-active-pane="1"] .chart-pane[data-pane="1"],
  .chart-multi-grid[data-active-pane="2"] .chart-pane[data-pane="2"],
  .chart-multi-grid[data-active-pane="3"] .chart-pane[data-pane="3"],
  .chart-multi-grid[data-active-pane="4"] .chart-pane[data-pane="4"],
  .chart-multi-grid[data-active-pane="5"] .chart-pane[data-pane="5"],
  .chart-multi-grid[data-active-pane="6"] .chart-pane[data-pane="6"],
  .chart-multi-grid[data-active-pane="7"] .chart-pane[data-pane="7"] {
    display: flex;
  }
  .chart-multi-grid .chart-pane.is-minimized {
    display: none !important;
  }
  .chart-pane .chart-pane-wrap {
    min-height: 480px;
    height: min(62vh, 620px);
  }
  .chart-multi.is-maximized .chart-multi-grid .chart-pane.is-maximized {
    height: min(70vh, 720px) !important;
  }
}
/* Crypto denser reuse — same 2×2 windows, clearer on wide */
@media (min-width: 1100px) {
  body[data-view="sleeve3"] .s3 {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
}


/* —— Market Overview multi companions (s3w57-mo2) + board chrome (s3w57-win) —— */
/* Shared board-window: independently resizable cards (MO + future tabs) */
.board-window {
  box-sizing: border-box;
  resize: both;
  overflow: auto;
  min-width: 280px;
  min-height: 220px;
  border-radius: 10px;
  border: 1px solid rgba(127, 160, 200, 0.28);
  background: rgba(8, 18, 32, 0.35);
}
[data-theme="light"] .board-window {
  border-color: rgba(30, 60, 100, 0.22);
  background: rgba(255, 255, 255, 0.55);
}

.mo-split-host .mo-split-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 16px;
}
.mo-side-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.mo-side-chips .mo-side-chip {
  text-decoration: none;
  min-height: 36px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
}
.mo-side-chips .mo-side-chip[aria-pressed="true"],
.mo-side-chips .mo-side-chip.on {
  /* multi-select: stay visibly active when on */
}
.mo-split-body {
  padding-top: 8px;
}
.mo-split {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-height: min(70vh, 720px);
  width: 100%;
  --mo-left: 55%;
}
.mo-split .mo-window {
  flex: 0 0 var(--mo-left);
  min-width: 280px;
  max-width: calc(100% - 292px);
  overflow: auto;
  padding: 0 0 10px;
  align-self: flex-start;
  min-height: min(70vh, 720px);
  height: min(70vh, 720px);
  resize: both;
}
.mo-split .mo-window > .mo-window-chrome,
.mo-split .mo-window > .mo-pane-chrome {
  margin-bottom: 4px;
}
.mo-pane-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.mo-pane-chrome .board-window-max,
.mo-pane-chrome .mo-pane-max {
  position: static;
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid rgba(127, 160, 200, 0.35);
  background: transparent;
  color: inherit;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.85;
}
.mo-pane-chrome .board-window-max:hover,
.mo-pane-chrome .mo-pane-max:hover {
  opacity: 1;
  border-color: rgba(90, 180, 255, 0.75);
}
/* Avoid double max button from BOARD_WINDOW_BOOT on MO panes */
#mo-split .board-window > .board-window-max:not(.mo-pane-max) {
  display: none;
}
.mo-split .mo-companions {
  flex: 1 1 auto;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-left: 8px;
  overflow: auto;
  align-items: stretch;
}
.mo-split .mo-pane,
.mo-split .mo-companions .board-window {
  flex: 0 1 auto;
  width: 100%;
  min-width: 280px;
  min-height: 220px;
  max-width: 100%;
  height: min(42vh, 420px);
  resize: both;
  overflow: auto;
  display: flex;
  flex-direction: column;
  align-self: stretch;
}
.mo-split .mo-pane[data-kind="chart"],
.mo-split .mo-pane-chart {
  min-height: 480px;
  height: min(62vh, 560px);
}
.mo-pane-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(127, 160, 200, 0.22);
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  z-index: 2;
  background: inherit;
}
[data-theme="light"] .mo-pane-chrome {
  border-bottom-color: rgba(30, 60, 100, 0.16);
}
.mo-pane-title {
  font-weight: 650;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  cursor: default;
}
.mo-pane-title.is-editing,
.bw-win-title.is-editing {
  outline: 1px solid rgba(90, 180, 255, 0.75);
  border-radius: 4px;
  padding: 1px 4px;
  background: var(--surface-2, var(--surface));
}
.mo-title-edit,
.bw-title-edit {
  border: none;
  background: transparent;
  color: inherit;
  opacity: 0.55;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 2px 4px;
  line-height: 1;
  border-radius: 4px;
}
.mo-title-edit:hover,
.bw-title-edit:hover {
  opacity: 1;
  background: rgba(127, 160, 200, 0.18);
}
.mo-pane-chrome .mo-pane-title {
  flex: 0 1 auto;
  min-width: 0;
}
.mo-pane-chrome .mo-title-edit {
  flex: 0 0 auto;
  margin-right: auto; /* keep ✎ by title; actions stay right */
}
.mo-window-chrome {
  display: flex;
  align-items: center;
  gap: 4px;
}
.bw-win-title {
  cursor: default;
}
.bw-title-edit {
  margin-left: 4px;
  vertical-align: middle;
}
/* MO Section: no Outer Window chrome — Inner Windows only (s3w61-chartpanes) */
.focus-market.mo-split-host {
  overflow: visible;
  resize: none;
  height: auto;
  max-height: none;
  min-height: 0;
  width: 100%;
}
.focus-market.mo-split-host > .board-window-max {
  display: none !important;
}
input.mo-title-input,
input.bw-title-input {
  font: inherit;
  font-weight: 650;
  color: inherit;
  background: var(--surface-2, var(--surface));
  border: 1px solid rgba(90, 180, 255, 0.75);
  border-radius: 4px;
  padding: 2px 6px;
  min-width: 8ch;
  max-width: 100%;
}
.mo-pane-close {
  text-decoration: none;
  font-size: 1.25rem;
  line-height: 1;
  padding: 2px 8px;
  border-radius: 6px;
  opacity: 0.75;
}
.mo-pane-close:hover,
.mo-pane-close:focus {
  opacity: 1;
  background: rgba(127, 160, 200, 0.18);
}
.mo-pane-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
}
.mo-splitter {
  flex: 0 0 8px;
  margin: 0 2px;
  cursor: col-resize;
  touch-action: none;
  position: relative;
  background: transparent;
  border-radius: 4px;
  align-self: stretch;
}
.mo-splitter::before {
  content: "";
  position: absolute;
  top: 12%;
  bottom: 12%;
  left: 2px;
  right: 2px;
  border-radius: 3px;
  background: rgba(127, 160, 200, 0.35);
}
.mo-splitter:hover::before,
.mo-splitter:focus::before,
body.mo-splitting .mo-splitter::before {
  background: rgba(90, 180, 255, 0.75);
}
body.mo-splitting {
  cursor: col-resize;
  user-select: none;
}
.mo-split.mo-split-solo .mo-window {
  flex: 1 1 auto;
  max-width: none;
  width: 100%;
}
.mo-split.mo-split-solo .mo-splitter,
.mo-split.mo-split-solo .mo-companions {
  display: none;
}
.mo-side-pane {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 160px;
  flex: 1 1 auto;
  height: 100%;
}
.mo-side-h {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.mo-side-h h3 {
  margin: 0;
  font-size: 1.05rem;
}
.mo-side-ticker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
}
.mo-side-ticker label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.8rem;
}
.mo-side-ticker input[name="symbol"] {
  min-width: 96px;
  max-width: 140px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase;
}
.mo-mini-chart {
  width: 100%;
  flex: 1 1 auto;
  min-height: 420px;
  height: 100%;
}
.mo-pane-chart .mo-mini-chart,
.mo-pane[data-kind="chart"] .mo-mini-chart {
  min-height: 480px;
}
.mo-mini-chart svg {
  width: 100%;
  height: 100%;
  display: block;
  min-height: 420px;
}
.mo-side-news .panel-b,
.mo-side-general-news .story-list {
  max-height: none;
  flex: 1 1 auto;
  overflow: auto;
  min-height: 120px;
}

@media (max-width: 900px) {
  .mo-split {
    flex-direction: column;
    min-height: 0;
  }
  .mo-split .mo-window,
  .mo-split .mo-companions {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    width: 100%;
    padding: 0;
  }
  .mo-split .mo-companions {
    border-top: 1px solid rgba(127, 160, 200, 0.22);
    padding-top: 12px;
    margin-top: 8px;
    padding-left: 0;
  }
  .mo-splitter {
    display: none;
  }
  .mo-split .mo-pane,
  .mo-split .mo-companions .board-window,
  .mo-split .mo-window.board-window {
    width: 100% !important;
    max-width: 100%;
    resize: vertical;
    min-height: 220px;
  }
  .mo-mini-chart {
    min-height: 360px;
  }
  .mo-split .mo-pane[data-kind="chart"],
  .mo-split .mo-pane-chart {
    min-height: 400px;
  }
}


/* —— Board windows extras (s3w57-win): Opp span + maximize + section shells ——
   Keeps s3w56-mo2 .board-window base above; adds Opp TA row + chrome. */
.board-window {
  max-width: 100%;
  min-height: 200px; /* Patrick floor; MO panes may still use 220 via .mo-pane */
  position: relative;
}
.board-window > .board-window-max {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 5;
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface-2, var(--surface));
  color: var(--ink);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.board-window > .board-window-max:hover {
  border-color: rgba(90, 180, 255, 0.75);
}
.board-window.is-maximized {
  position: fixed !important;
  inset: 12px !important;
  width: auto !important;
  height: auto !important;
  max-width: none !important;
  max-height: none !important;
  min-width: 0 !important;
  min-height: 0 !important;
  z-index: 80 !important;
  resize: none !important;
  background: var(--bg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.opp-scan-wrap.board-window {
  padding: 4px 6px 8px;
  margin-bottom: 8px;
  background: transparent;
}
.ticket-wrap.board-window {
  margin-top: 14px;
  padding: 8px 10px 10px;
}
.best-value-win.board-window {
  min-height: 0;
  margin-bottom: 10px;
  padding: 8px 36px 8px 10px;
}
.chart-wrap.board-window {
  min-height: 280px;
  height: min(62vh, 620px);
  padding: 0;
}
.chart-wrap.board-window svg {
  width: 100%;
  height: 100%;
  display: block;
}
.panel-b.board-window {
  /* section shells: keep existing panel-b padding rhythm */
}
.opp-ta-span {
  padding: 0 8px 10px 0 !important;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
.opp-ta-span .ta-timing {
  max-width: none;
  width: 100%;
  white-space: normal;
  margin: 2px 0 0;
}
tr.opp-ta-row td:last-child:empty {
  border-bottom: 1px solid var(--line-soft);
}
@media (max-width: 720px) {
  .board-window {
    resize: none !important;
  }
  .board-window > .board-window-max { display: none; }
  .board-window.is-maximized {
    position: relative !important;
    inset: auto !important;
    box-shadow: none;
  }
  .best-value-win.board-window { padding-right: 10px; }
}



/* —— Nested outer+inner resize (s3w59-allwin) ——
   Outer focus section is a board-window-stage; inner panel-b / chart-pane /
   table cards stay independently resizable. Override .panel overflow:hidden
   and .focus height:100% so the outer shell can grow/shrink. */
.panel.board-window-stage,
.focus.board-window-stage {
  overflow: auto;
  resize: both;
  height: auto;
  max-height: none;
  min-height: min(70vh, 640px);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.panel.board-window-stage.board-window {
  min-width: min(100%, 360px);
  min-height: min(70vh, 640px);
}
/* Inner shells inside a stage stay smaller than the outer */
.panel.board-window-stage > .panel-b.board-window,
.panel.board-window-stage .panel-b.board-window {
  min-height: 220px;
  /* do not lock max-height so both outer and inner can grow */
  max-height: none;
}
body[data-view="chart"] .app,
body[data-view="news"] .app,
body[data-view="positions"] .app,
body[data-view="opportunity"] .app,
body[data-view="sleeve3"] .app,
body[data-view="general-news"] .app,
body[data-view="ah-move"] .app,
body[data-view="market"] .app,
body[data-view="options-chain"] .app,
body[data-view="education"] .app,
body[data-view="family"] .app,
body[data-view="account-pnl"] .app,
body[data-view="core-positions"] .app,
body[data-view="risk-overview"] .app,
body[data-view="desk"] .app {
  width: 100%;
  min-width: 640px;
  max-width: 100%;
  height: auto;
  min-height: 0;
}
body[data-view="chart"] .shell,
body[data-view="news"] .shell,
body[data-view="positions"] .shell,
body[data-view="opportunity"] .shell,
body[data-view="sleeve3"] .shell,
body[data-view="general-news"] .shell,
body[data-view="ah-move"] .shell,
body[data-view="market"] .shell,
body[data-view="options-chain"] .shell,
body[data-view="education"] .shell,
body[data-view="family"] .shell,
body[data-view="account-pnl"] .shell,
body[data-view="core-positions"] .shell,
body[data-view="risk-overview"] .shell,
body[data-view="desk"] .shell {
  min-width: 0;
}
body[data-view="chart"] .stage,
body[data-view="news"] .stage,
body[data-view="positions"] .stage,
body[data-view="opportunity"] .stage,
body[data-view="sleeve3"] .stage,
body[data-view="general-news"] .stage,
body[data-view="ah-move"] .stage,
body[data-view="market"] .stage,
body[data-view="options-chain"] .stage,
body[data-view="education"] .stage,
body[data-view="family"] .stage,
body[data-view="account-pnl"] .stage,
body[data-view="core-positions"] .stage,
body[data-view="risk-overview"] .stage,
body[data-view="desk"] .stage {
  overflow: auto;
  min-height: 0;
  align-content: start;
}
/* Chart Section: no Outer Window — Inner panes / 1-up chart-wrap only (s3w62) */
body[data-view="chart"] .focus-chart {
  overflow: visible;
  resize: none;
  height: auto;
  max-height: none;
  min-height: 0;
  width: 100%;
}
body[data-view="chart"] .focus-chart > .board-window-max {
  display: none !important;
}
body[data-view="chart"] .chart-multi .panel-b {
  min-height: min(60vh, 560px);
  overflow: auto;
  resize: none;
}
body[data-view="chart"] .focus-chart > .panel-b {
  overflow: auto;
}
/* Core Positions + Risk Overview + Selected News: no Outer Window — Inner shell only */
body[data-view="core-positions"] .focus-core-positions.cp-noouter,
body[data-view="risk-overview"] .focus-risk-overview.cp-noouter,
body[data-view="news"] .focus-news.cp-noouter,
.focus-core-positions.cp-noouter,
.focus-risk-overview.cp-noouter,
.focus-news.cp-noouter {
  overflow: visible;
  resize: none;
  height: auto;
  max-height: none;
  min-height: 0;
  width: 100%;
  border: 0;
  box-shadow: none;
  background: transparent;
}
body[data-view="core-positions"] .focus-core-positions.cp-noouter > .board-window-max,
body[data-view="risk-overview"] .focus-risk-overview.cp-noouter > .board-window-max,
body[data-view="news"] .focus-news.cp-noouter > .board-window-max,
.focus-core-positions.cp-noouter > .board-window-max,
.focus-risk-overview.cp-noouter > .board-window-max,
.focus-news.cp-noouter > .board-window-max {
  display: none !important;
}
body[data-view="core-positions"] .focus-core-positions.cp-noouter > .panel-h,
body[data-view="risk-overview"] .focus-risk-overview.cp-noouter > .panel-h,
body[data-view="news"] .focus-news.cp-noouter > .panel-h {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 14px 14px 0 0;
  box-shadow: none;
}
body[data-view="core-positions"] .focus-core-positions.cp-noouter > .panel-b.board-window,
body[data-view="risk-overview"] .focus-risk-overview.cp-noouter > .panel-b.board-window,
body[data-view="news"] .focus-news.cp-noouter > .panel-b.board-window {
  min-height: min(60vh, 560px);
  min-width: min(100%, 360px);
  overflow: auto;
  resize: both;
  max-height: none;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-top: 0;
  border-radius: 0 0 14px 14px;
  box-shadow: var(--shadow);
}
/* News panes inside denser Chart grid */
.chart-pane.chart-news-pane {
  overflow: auto;
}
.chart-pane.chart-news-pane .chart-news-body {
  flex: 1 1 auto;
  min-height: 120px;
  overflow: auto;
}
.chart-pane.chart-news-pane .story-list,
.chart-pane.chart-news-pane .news-item {
  font-size: 12px;
}
.chart-pane-kind {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-right: 6px;
}
.chart-add-menu {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
@media (max-width: 720px) {
  .panel.board-window-stage,
  .focus.board-window-stage {
    resize: none !important;
    height: auto;
    min-height: 0;
  }
}


/* —— Free Window drag placement + multi-edge resize (s3w64-edges) —— */
.win-drag-host,
.chart-multi-grid.is-free-layout,
#mo-split.is-free-layout,
#mo-companions.is-free-layout {
  position: relative;
  overflow: visible;
}
.chart-multi-grid.is-free-layout {
  display: block;
  min-height: min(70vh, 640px);
}
.chart-multi-grid.is-free-layout .chart-pane,
#mo-split.is-free-layout > .mo-window,
#mo-split.is-free-layout .mo-pane,
.is-free-win {
  position: absolute;
  max-width: none;
  z-index: 1;
}
#mo-split.is-free-layout {
  display: block;
  min-height: min(70vh, 720px);
}
#mo-split.is-free-layout > .mo-splitter {
  display: none !important;
}
#mo-split.is-free-layout > .mo-companions {
  display: contents;
}
#mo-split.is-free-layout > .mo-window,
#mo-split.is-free-layout .mo-pane {
  flex: none;
  align-self: auto;
  max-width: none;
}
.bw-chrome-draggable,
.mo-pane-chrome.bw-chrome-draggable,
.chart-pane-h.bw-chrome-draggable,
.panel-h.bw-chrome-draggable {
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.bw-chrome-draggable.is-grabbing,
body.bw-win-dragging,
body.bw-win-dragging .bw-chrome-draggable {
  cursor: grabbing !important;
}
.bw-drag-chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 10px;
  margin: 0 0 6px;
  border-radius: 8px 8px 0 0;
  border-bottom: 1px solid rgba(127, 160, 200, 0.22);
  background: rgba(8, 18, 32, 0.45);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  flex: 0 0 auto;
}
[data-theme="light"] .bw-drag-chrome {
  background: rgba(240, 245, 252, 0.9);
  border-bottom-color: rgba(30, 60, 100, 0.16);
}
.bw-drag-chrome-label {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.75;
}
.is-free-win.is-dragging {
  opacity: 0.96;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}
body.bw-win-dragging {
  user-select: none !important;
  -webkit-user-select: none !important;
}
/* Prefer visible overflow on Section content hosts so absolute Windows are not clipped */
body[data-view="chart"] .chart-multi .panel-b,
body[data-view="market"] .mo-split-body,
.focus.win-drag-host,
.panel.win-drag-host,
.board-window-stage.win-drag-host {
  overflow: visible;
}
@media (max-width: 980px) {
  .chart-multi-grid.is-free-layout {
    display: grid;
  }
  .chart-multi-grid.is-free-layout .chart-pane,
  #mo-split.is-free-layout > .mo-window,
  #mo-split.is-free-layout .mo-pane,
  .is-free-win {
    position: relative !important;
    left: auto !important;
    top: auto !important;
  }
  #mo-split.is-free-layout {
    display: flex;
  }
  #mo-split.is-free-layout > .mo-companions {
    display: flex;
  }
  #mo-split.is-free-layout > .mo-splitter {
    display: block !important;
  }
  .bw-drag-chrome { display: none; }
  .bw-chrome-draggable { cursor: default; touch-action: auto; }
}

/* Maximize must beat inline free-layout left/top/position */
.chart-multi.is-maximized .chart-multi-grid .chart-pane.is-maximized {
  position: relative !important;
  left: auto !important;
  top: auto !important;
}
.board-window.is-maximized.is-free-win,
.mo-pane.is-maximized.is-free-win,
.mo-window.is-maximized.is-free-win {
  position: fixed !important;
  left: 12px !important;
  top: 12px !important;
  right: 12px !important;
  bottom: 12px !important;
  width: auto !important;
  height: auto !important;
}


/* —— Multi-edge resize handles (s3w64-edges) —— */
.win-resize-handle {
  position: absolute;
  z-index: 6;
  background: transparent;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.win-resize-handle[data-edge="n"] {
  top: -2px; left: 10px; right: 10px; height: 8px; cursor: n-resize;
}
.win-resize-handle[data-edge="s"] {
  bottom: -2px; left: 10px; right: 10px; height: 8px; cursor: s-resize;
}
.win-resize-handle[data-edge="e"] {
  right: -2px; top: 10px; bottom: 10px; width: 8px; cursor: e-resize;
}
.win-resize-handle[data-edge="w"] {
  left: -2px; top: 10px; bottom: 10px; width: 8px; cursor: w-resize;
}
.win-resize-handle[data-edge="ne"] {
  top: -2px; right: -2px; width: 14px; height: 14px; cursor: ne-resize;
}
.win-resize-handle[data-edge="nw"] {
  top: -2px; left: -2px; width: 14px; height: 14px; cursor: nw-resize;
}
.win-resize-handle[data-edge="se"] {
  bottom: -2px; right: -2px; width: 14px; height: 14px; cursor: se-resize;
}
.win-resize-handle[data-edge="sw"] {
  bottom: -2px; left: -2px; width: 14px; height: 14px; cursor: sw-resize;
}
/* Prefer custom edge handles over CSS SE-only resize */
.chart-pane[data-win-edges="1"],
.board-window[data-win-edges="1"],
.mo-pane[data-win-edges="1"],
.mo-window[data-win-edges="1"],
#mo-window[data-win-edges="1"],
.is-free-win {
  resize: none !important;
}
body.bw-win-resizing {
  cursor: grabbing !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}
.is-free-win.is-resizing {
  opacity: 0.97;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}
.pane-range-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 2px 0 4px;
}
.pane-range-chips .seg {
  min-height: 28px;
  padding: 0 8px;
  font-size: 11px;
}
.mo-range-chips {
  margin: 6px 0 8px;
}
@media (max-width: 980px) {
  .win-resize-handle { display: none !important; }
}

/* —— Chart crispness (s3w66-crisp) — large monitors —— */
.chart-wrap svg,
.chart-pane-wrap svg,
.mo-mini-chart svg,
#chart-svg,
#mo-chart-svg {
  shape-rendering: geometricPrecision;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  image-rendering: -webkit-optimize-contrast;
}
.chart-wrap,
.chart-pane-wrap,
.mo-mini-chart {
  background: var(--chart-pane);
}
body[data-view="chart"] .focus-chart,
body[data-view="chart"] .chart-pane-h,
body[data-view="chart"] .legend,
body[data-view="chart"] .caption,
body[data-view="chart"] .mono {
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}
body[data-view="chart"] .legend {
  font-size: 12px;
  letter-spacing: 0.01em;
}

/* —— Studies pull-down (s3w67-studies) —— */
.chart-studies {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.chart-studies-btn {
  min-height: 26px;
}
.chart-multi-tools .chart-studies-btn {
  min-height: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  font-size: 12px;
}
.chart-studies-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  min-width: 200px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chart-studies-menu[hidden] {
  display: none !important;
}
.chart-studies-caption {
  font-size: 10px;
  color: var(--quiet);
  line-height: 1.35;
  margin-bottom: 2px;
}
.chart-study-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
  min-height: 28px;
}
.chart-study-item input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent, #42A5F5);
}
.legend [data-study].study-off {
  opacity: 0.32;
  text-decoration: line-through;
}
.mo-side-h-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.mo-chart-legend {
  margin-top: 4px;
  margin-bottom: 2px;
}
.chart-draw-tools + .chart-studies {
  padding-left: 10px;
  margin-left: 2px;
  border-left: 1px solid var(--line);
}


/* ---- Core Positions (Patrick) + Today strip + Risk Overview + nav hold-drag ---- */
/* Owner 2026-09-11: title-only Section tabs — no up/down/edit chrome; 4px gap untouched. */
.nav a {
  position: relative;
  gap: 6px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}
.nav a .nav-ord,
.nav a .nav-rename { display: none !important; }
.nav a.nav-hold-armed { cursor: grabbing; }
.nav a.nav-dragging {
  opacity: 0.55;
  outline: 1px dashed var(--line);
  cursor: grabbing;
  z-index: 2;
  touch-action: none;
}
.nav a.nav-renaming { outline: 1px solid var(--accent, #c47a3a); }
.nav a .k.nav-k-editing {
  outline: 1px solid var(--accent, #c47a3a);
  outline-offset: 1px;
  border-radius: 3px;
  background: var(--surface);
  max-width: 100%;
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
}
/* Keep rail width fixed (232px shell col) — never grow on hover/edit */
.shell { grid-template-columns: 232px 1fr; }
.nav a:hover .k,
.nav a.nav-renaming .k {
  overflow: hidden;
  text-overflow: ellipsis;
}

.cp-totals {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 18px;
  padding: 10px 12px;
  margin: 0 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}
.cp-tot-lab { display: block; font-size: 11px; color: var(--quiet); }
.cp-tot-val {
  font-family: "Plex Mono", ui-monospace, monospace;
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
}
.cp-tot-break {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 11.5px;
  color: var(--muted);
}
.cp-table-wrap { overflow-x: auto; margin-bottom: 14px; }
.cp-table { width: 100%; min-width: 1080px; border-collapse: separate; border-spacing: 0; }
/* Owner: two-row headings with $/% on second row; space between columns for legibility. */
.cp-table th {
  white-space: normal;
  vertical-align: bottom;
  text-align: center;
  padding: 8px 16px;
  min-width: 4.75rem;
  letter-spacing: 0.02em;
}
.cp-table th.wrap { white-space: normal; }
.cp-table th .th-stack {
  min-height: 2.75em;
  gap: 2px;
  padding: 0 2px;
}
.cp-table th .th-top,
.cp-table th .th-bot {
  white-space: nowrap;
}
.cp-table td {
  padding-left: 16px;
  padding-right: 16px;
}
.cp-nest { padding-left: 14px; color: var(--ink-dim); font-size: 12px; }
.cp-parent { font-weight: 600; }
.cp-row-opt td:first-child { border-left: 2px solid var(--line); }
.cp-risk {
  display: inline-block;
  min-width: 4.2em;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}
.cp-risk-high { box-shadow: inset 3px 0 0 #FDD835; }
.cp-risk-medium { box-shadow: inset 3px 0 0 #42A5F5; }
.cp-risk-low { box-shadow: inset 3px 0 0 #80CBC4; }
.cp-risk-unrated { box-shadow: inset 3px 0 0 #78909C; color: var(--quiet); }
.cp-warn { margin: 0 0 8px; padding-left: 18px; }

.cp-today {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.cp-today-closed { border-style: dashed; }
.cp-today-h {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  margin-bottom: 8px;
}
.cp-today-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.cp-chip {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  background: var(--surface-2);
  min-width: 140px;
}
.cp-chip-k { display: block; font-size: 10px; color: var(--quiet); margin-bottom: 2px; }
.cp-chip-v {
  font-family: "Plex Mono", ui-monospace, monospace;
  font-size: 12.5px;
  color: var(--ink);
}
.cp-chip-up { box-shadow: inset 0 -2px 0 var(--up); }
.cp-chip-down { box-shadow: inset 0 -2px 0 var(--down); }
.cp-chip-flat { box-shadow: inset 0 -2px 0 var(--line); }
.cp-chip-muted { opacity: 0.92; }
.cp-dir { font-size: 10px; color: var(--quiet); text-transform: uppercase; }
.cp-today-movers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.cp-movers-lab { font-size: 11px; color: var(--quiet); margin-right: 4px; }
.cp-mover {
  font-family: "Plex Mono", ui-monospace, monospace;
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
}
.cp-mover-up { box-shadow: inset 3px 0 0 var(--up); }
.cp-mover-drag { box-shadow: inset 3px 0 0 var(--down); }
.cp-today-news { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.cp-news {
  font-size: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 4px 8px;
  background: var(--bg);
  min-width: 160px;
}
.cp-news summary { cursor: pointer; font-weight: 600; }
.cp-news ul { margin: 6px 0 2px; padding-left: 16px; }
.cp-news-miss { margin: 0; }


/* ---- Core Positions daily dashboard (Nora UX 2026-09-09) ---- */
.cp-dash {
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}
.cp-dash-account { margin-bottom: 12px; }
.cp-dash-account-h {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 18px;
  align-items: flex-end;
  margin-bottom: 8px;
}
.cp-dash-k {
  display: block;
  font-size: 11px;
  color: var(--quiet);
  letter-spacing: 0.03em;
  margin-bottom: 2px;
}
.cp-dash-nw {
  font-family: "Plex Mono", ui-monospace, monospace;
  font-size: 26px;
  font-weight: 650;
  color: var(--ink);
}
.cp-dash-daybox {
  min-width: 160px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.cp-dash-day-v {
  font-family: "Plex Mono", ui-monospace, monospace;
  font-size: 16px;
  font-weight: 650;
  color: var(--ink);
}
.cp-dash-day-pct { font-size: 13px; font-weight: 500; color: var(--ink-dim); }
.cp-dash-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 6px;
}
.cp-dash-asof { margin: 0; }
.cp-dash-section { margin-top: 12px; }
.cp-dash-sec-h {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.cp-dash-grid {
  display: grid;
  gap: 8px;
}
.cp-dash-grid-pos {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.cp-dash-grid-watch {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.cp-dash-tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 3px;
  min-height: 86px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  background: color-mix(in srgb, #78909C 22%, var(--surface));
  box-sizing: border-box;
}
/* Hover: color-mix only — never filter/scale/border-width/padding (layout jump). */
a.cp-dash-tile:hover,
a.cp-dash-tile:focus,
a.cp-dash-tile:focus-visible,
div.cp-dash-tile:hover,
div.cp-dash-tile:focus,
div.cp-dash-tile:focus-visible {
  border-width: 1px;
  outline: none;
  filter: none;
  transform: none;
}
.cp-dash-up:hover,
a.cp-dash-up:hover,
div.cp-dash-up:hover {
  background: color-mix(in srgb, #00C853 68%, var(--surface));
}
.cp-dash-down:hover,
a.cp-dash-down:hover,
div.cp-dash-down:hover {
  background: color-mix(in srgb, #FF1744 88%, #ffffff);
}
.cp-dash-flat:hover,
a.cp-dash-flat:hover,
div.cp-dash-flat:hover {
  background: color-mix(in srgb, #78909C 34%, var(--surface));
}
a.cp-dash-tile:focus-visible {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 35%, transparent);
}
a.cp-dash-up:focus-visible {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #00C853 85%, transparent);
}
a.cp-dash-down:focus-visible {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #FF1744 100%, transparent);
}
.cp-dash-sym {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
}
.cp-dash-ovn {
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.85;
  color: #8ec7f0;
}
.cp-dash-down .cp-dash-ovn {
  color: #ffffff;
}
[data-theme="light"] .cp-dash-ovn {
  color: #1565C0;
}
.cp-dash-last {
  font-family: "Plex Mono", ui-monospace, monospace;
  font-size: 12.5px;
  color: var(--ink);
}
.cp-dash-chg {
  font-family: "Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  color: var(--ink);
}
.cp-dash-price {
  font-family: "Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--ink-dim);
  opacity: 0.95;
}
/* Owner Trading Look: green up (kept) / bright primary red down / gray flat. */
.cp-dash-up {
  background: color-mix(in srgb, #00C853 58%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #00C853 85%, transparent);
}
.cp-dash-down {
  /* Owner: solid primary red — not a pale mix into surface. White text for contrast. */
  background: #FF1744;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #FF1744 100%, transparent);
  color: #ffffff;
}
.cp-dash-down .cp-dash-sym,
.cp-dash-down .cp-dash-last,
.cp-dash-down .cp-dash-chg,
.cp-dash-down .cp-dash-price,
.cp-dash-down .cp-dash-ovn {
  color: #ffffff;
}
.cp-dash-flat {
  background: color-mix(in srgb, #78909C 22%, var(--surface));
}
.cp-dash-daybox.cp-dash-up {
  background: color-mix(in srgb, #00C853 42%, var(--surface));
}
.cp-dash-daybox.cp-dash-down {
  background: #FF1744;
  color: #ffffff;
}
.cp-dash-daybox.cp-dash-down .cp-dash-k {
  color: rgba(255, 255, 255, 0.88);
}
.cp-dash-daybox.cp-dash-down .cp-dash-day-v,
.cp-dash-daybox.cp-dash-down .cp-dash-day-pct {
  color: #ffffff;
}
.cp-dash-daybox.cp-dash-flat {
  background: var(--surface);
}
.cp-dash-empty { margin: 0; padding: 8px 0; }
@media (max-width: 900px) {
  .cp-dash-grid-pos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cp-dash-grid-watch { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .cp-dash-grid-pos,
  .cp-dash-grid-watch { grid-template-columns: 1fr 1fr; }
}

/* ---- Risk Overview (Patrick) — table + 3 pies ---- */
.ro-h {
  margin: 14px 0 8px;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  font-size: 16px;
}
.ro-totals {
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}
.ro-table-wrap { overflow-x: auto; margin-bottom: 10px; }
.ro-table { width: 100%; min-width: 880px; }
.ro-table th { white-space: nowrap; }
.ro-table td { background: transparent !important; }
.ro-notes { margin: 0 0 12px; padding-left: 18px; }
.ro-pies {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 8px 0 10px;
}
.ro-pie {
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.ro-pie-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
}
.ro-pie-svg { display: block; max-width: 100%; height: auto; }
.ro-pie-legend {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  width: 100%;
  font-size: 11px;
  color: var(--ink-dim);
}
.ro-pie-legend li {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0;
}
.ro-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  border: 1px solid var(--line);
  flex: 0 0 auto;
}
.ro-leg-pct {
  margin-left: auto;
  font-family: "Plex Mono", ui-monospace, monospace;
  color: var(--quiet);
}
.ro-leg-empty { color: var(--quiet); font-style: italic; }
@media (max-width: 980px) {
  .ro-pies { grid-template-columns: 1fr; }
}

/* Owner chrome aliases (2026-09-09) — table + pies */
.cp-risk-table-wrap { overflow-x: auto; margin-bottom: 10px; }
.cp-risk-table { width: 100%; min-width: 920px; }
.cp-risk-table th { white-space: nowrap; }
.cp-risk-table td { background: transparent !important; }
.cp-risk-pies {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 8px 0 10px;
}
.ro-slice-lab,
.ro-slice-pct {
  fill: var(--ink);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  pointer-events: none;
}
.ro-slice-lab { font-size: 9px; font-weight: 600; }
.ro-slice-pct {
  font-size: 8px;
  font-family: "Plex Mono", ui-monospace, monospace;
  fill: var(--ink-dim);
}
.ro-callout-line {
  stroke: var(--ink-dim);
  stroke-width: 1;
  fill: none;
  opacity: 0.75;
  pointer-events: none;
}
[data-theme="light"] .ro-slice-lab { fill: #102a43; }
[data-theme="light"] .ro-slice-pct { fill: #486581; }
[data-theme="light"] .ro-callout-line { stroke: #486581; }
@media (max-width: 980px) {
  .cp-risk-pies { grid-template-columns: 1fr; }
}

/* Never red-fill Core Positions gain cells — parentheses + stmt-neg only */
.cp-table td { background: transparent !important; }
table.cp-table th.sortable {
  cursor: pointer;
  user-select: none;
}
table.cp-table th.sortable:hover { color: var(--ink); }
table.cp-table th.sortable.sorted-asc::after,
table.cp-table th.sortable.sorted-desc::after {
  display: inline-block;
  margin-left: 4px;
  font-size: 9px;
  color: var(--quiet);
}
table.cp-table th.sortable.sorted-asc::after { content: "▲"; }
table.cp-table th.sortable.sorted-desc::after { content: "▼"; }

/* Core Positions sheet-style footer totals (2026-09-09 cleanup) */
.cp-table tfoot tr.cp-row-tot td {
  border-top: 2px solid var(--ink-dim);
  font-weight: 600;
  background: var(--surface-2) !important;
  padding-top: 8px;
  padding-bottom: 8px;
}
.cp-table tfoot tr.cp-row-tot td:first-child {
  letter-spacing: 0.04em;
}

/* Risk Overview mix table TOTAL footer (same chrome as Core Positions) */
.ro-table tfoot tr.cp-row-tot td,
.cp-risk-table tfoot tr.cp-row-tot td {
  border-top: 2px solid var(--ink-dim);
  font-weight: 600;
  background: var(--surface-2) !important;
  padding-top: 8px;
  padding-bottom: 8px;
}
.ro-table tfoot tr.cp-row-tot td:first-child,
.cp-risk-table tfoot tr.cp-row-tot td:first-child {
  letter-spacing: 0.04em;
}

/* Risk Overview pies — room for collision-nudged outside callouts */
.ro-pie-svg {
  overflow: visible;
}
.ro-pie {
  overflow: visible;
}

/* Private book entry / import (commercialization) */
.cp-toolbar, .cp-empty-actions, .cp-dialog-actions, .cp-import-modes, .cp-del-bar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px;
}
.cp-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 8px 14px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink);
  font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none;
}
.cp-btn-primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.cp-btn-quiet { background: transparent; color: var(--ink-dim); font-weight: 500; }
.cp-btn-disabled, .cp-btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; pointer-events: none; }
.cp-empty {
  margin: 18px auto; max-width: 420px; text-align: center;
  padding: 22px 18px; border: 1px dashed var(--line); border-radius: 12px;
  background: var(--surface);
}
.cp-empty-title { margin: 0 0 8px; font-family: "Fraunces", Georgia, serif; font-weight: 500; }
.cp-flash { padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); margin: 0 0 10px; }
.cp-flash.ok { box-shadow: inset 3px 0 0 var(--up); }
.cp-flash.bad { box-shadow: inset 3px 0 0 var(--down); }
.cp-dialog {
  border: 1px solid var(--line); border-radius: 12px; padding: 16px;
  background: var(--surface); color: var(--ink); max-width: 420px; width: calc(100% - 24px);
}
.cp-add-form { display: grid; gap: 8px; }
.cp-add-form label { display: grid; gap: 4px; font-size: 12px; color: var(--quiet); }
.cp-add-form input, .cp-add-form select {
  min-height: 40px; padding: 6px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
}
.cp-del-form { display: inline; }

/* Statement / Core import drop zones */
.cp-dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; margin: 0 0 12px; padding: 18px 14px; min-height: 72px;
  border: 2px dashed var(--line); border-radius: 12px;
  background: var(--surface); color: var(--ink); cursor: pointer;
  text-align: center; transition: border-color .12s ease, background .12s ease, box-shadow .12s ease;
}
.cp-dropzone:hover, .cp-dropzone:focus {
  border-color: var(--ink); outline: none;
}
.cp-dropzone.is-dragover {
  border-color: var(--up, #3dba7a);
  background: color-mix(in srgb, var(--up, #3dba7a) 12%, var(--surface));
  box-shadow: inset 0 0 0 1px var(--up, #3dba7a);
}
.cp-dropzone-title {
  font-size: 14px; font-weight: 600; color: var(--ink);
}
.stmt-upload { margin: 12px 0 18px; }
.stmt-upload-recent { margin: 10px 0 0; }
.stmt-upload-recent h4 { margin: 0 0 6px; font-size: 13px; font-weight: 600; }
.stmt-upload-list { margin: 0; padding-left: 18px; }
.stmt-upload-list li { margin: 0 0 4px; }
