/* =============================================================================
   Trader / Professional audience mode
   ========================================================================== */

/* ---- Topbar segment toggle --------------------------------------------- */
html[data-ui='v2'][data-v2] .audience-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--v2-line);
  border-radius: var(--v2-r-pill);
  background: var(--v2-sunk);
  order: 0;
}
html[data-ui='v2'][data-v2] .audience-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--v2-ink-3);
  font: 600 11px/1 var(--v2-sans);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
html[data-ui='v2'][data-v2] .audience-btn:hover {
  color: var(--v2-ink);
}
html[data-ui='v2'][data-v2] .audience-btn.active {
  background: var(--v2-surface);
  color: var(--v2-ink);
  box-shadow: var(--v2-e1);
}
html[data-ui='v2'][data-scheme='dark'][data-v2] .audience-btn.active {
  background: var(--v2-elevated, var(--v2-surface));
  color: var(--v2-ink);
}

html[data-ui='v2'][data-v2] .topbar-guide-btn {
  order: 0;
  display: inline-flex;
  align-items: center;
  gap: var(--v2-s1);
  height: 34px;
  padding: 0 12px;
  border-radius: var(--v2-r-pill);
  border: 1px solid var(--v2-accent-line, var(--v2-line));
  background: var(--v2-accent-soft, transparent);
  color: var(--v2-accent, var(--v2-ink));
  font: 600 11px/1 var(--v2-sans);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}
html[data-ui='v2'][data-v2] .topbar-guide-btn:hover {
  border-color: var(--v2-accent, var(--v2-line-2));
  color: var(--v2-ink);
}
html[data-ui='v2'][data-v2] .topbar-guide-btn .btn-icon {
  font-size: 13px;
  opacity: 0.9;
}

/* Place audience controls first in the status bar */
html[data-ui='v2'][data-v2] .status-bar > .audience-switch { order: 0; margin-right: 4px; }
html[data-ui='v2'][data-v2] .status-bar > .topbar-guide-btn { order: 0; margin-right: 10px; }

/* ---- Trader mode: hide dense professional chrome on HOME --------------- */
body.audience-trader #overview-layout-toolbar,
body.audience-trader #overview-morning-brief,
body.audience-trader #overview-regime-fusion,
body.audience-trader #overview-market-pillars,
body.audience-trader #overview-forecast-tri,
body.audience-trader #overview-spillover,
body.audience-trader .overview-verdict-band,
body.audience-trader .ov-hero-band,
body.audience-trader .ov-kpi-band,
body.audience-trader .overview-split,
body.audience-trader .home-opportunity-intro,
body.audience-trader .market-board[data-mb-home],
body.audience-trader .simple-regime-board[data-srb-universe="home"],
body.audience-trader #view-overview .overview-grid,
body.audience-trader #view-overview .kpi-strip,
body.audience-trader #view-overview .dual-matrix-row,
body.audience-trader #view-overview .overview-section-pro {
  display: none !important;
}

/* Professional keeps full HOME; hide trader-only explainer chrome */
body.audience-professional .hmo-path-strip,
body.audience-professional .hmo-q-step,
body.audience-professional .hmo-how-strip {
  /* path strip still useful; keep it lighter for pro */
}

/* ---- Trader path / three-question layout ------------------------------- */
html[data-ui='v2'][data-v2] .hmo-path-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--v2-s3);
  margin-bottom: var(--v2-s5);
}
@media (max-width: 900px) {
  html[data-ui='v2'][data-v2] .hmo-path-strip { grid-template-columns: 1fr; }
}

html[data-ui='v2'][data-v2] .hmo-path-card {
  background: var(--v2-surface);
  border: 1px solid var(--v2-line);
  border-radius: var(--v2-r-lg);
  padding: 14px 16px;
  box-shadow: var(--v2-e1);
  position: relative;
}
html[data-ui='v2'][data-v2] .hmo-path-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--v2-accent-soft, color-mix(in srgb, var(--v2-bull) 12%, transparent));
  color: var(--v2-accent, var(--v2-bull));
  font: 700 11px/1 var(--v2-sans);
  margin-bottom: 8px;
}
html[data-ui='v2'][data-v2] .hmo-path-title {
  margin: 0 0 4px;
  font: 650 var(--v2-t-md)/1.25 var(--v2-sans);
  color: var(--v2-ink);
  letter-spacing: -0.015em;
}
html[data-ui='v2'][data-v2] .hmo-path-text {
  margin: 0;
  font: 400 var(--v2-t-xs)/1.45 var(--v2-sans);
  color: var(--v2-ink-3);
}

html[data-ui='v2'][data-v2] .hmo-how-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--v2-s2) var(--v2-s3);
  align-items: center;
  margin: 0 0 var(--v2-s5);
  padding: 12px 14px;
  border-radius: var(--v2-r-lg);
  border: 1px dashed var(--v2-line-2, var(--v2-line));
  background: var(--v2-sunk);
  color: var(--v2-ink-2);
  font: 400 var(--v2-t-xs)/1.45 var(--v2-sans);
}
html[data-ui='v2'][data-v2] .hmo-how-strip strong {
  color: var(--v2-ink);
  font-weight: 650;
}
html[data-ui='v2'][data-v2] .hmo-how-pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--v2-surface);
  border: 1px solid var(--v2-line);
  font: 600 10px/1 var(--v2-sans);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--v2-ink-2);
}

html[data-ui='v2'][data-v2] .hmo-q {
  margin-bottom: var(--v2-s5);
}
/* Trader question header — the /styleguide "stacked section header" pattern.
   Grid, not flex: row placement is explicit, so the explainer is always on its
   own row regardless of how wide it happens to be.

   Flex could not express this. `width: 100%` is shrinkable, so the paragraph
   sat on the title's line squeezed into the leftover space; `flex-basis: 100%`
   fixed that until `max-width: 72ch` clamped the hypothetical main size back
   to 541px, which fits beside the title again. Either way it wrapped to two
   lines hanging off a 22px heading's baseline — the misalignment.

   The step marker is a fixed-width numeral rather than the words "Question 1".
   The label was ~75px of text, so it pushed the heading well off the column
   the rest of the page starts at; a 24px badge costs almost nothing and the
   title and its description share one left edge underneath it. */
html[data-ui='v2'][data-v2] .hmo-q-head {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: start;
  column-gap: var(--v2-s3);
  row-gap: var(--v2-s2);
  margin-bottom: var(--v2-s4);
}
html[data-ui='v2'][data-v2] .hmo-q-num {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: var(--v2-r-pill);
  background: var(--v2-sunk-2);
  box-shadow: var(--v2-hairline);
  font: 600 var(--v2-t-xs)/1 var(--v2-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  text-transform: none;
  color: var(--v2-ink-2);
  /* Nudge onto the heading's optical centre — the badge is a box and the
     heading is a text baseline, so `align-items: start` alone sits it high. */
  margin-top: 2px;
}
html[data-ui='v2'][data-v2] .hmo-q-title {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  font: 650 clamp(18px, 2vw, 22px)/1.25 var(--v2-sans);
  letter-spacing: var(--v2-tighter);
  color: var(--v2-ink);
}
/* Description sits under the title, sharing its left edge — not under the
   badge, which would leave it hanging in the gutter. */
html[data-ui='v2'][data-v2] .hmo-q-sub {
  grid-column: 2;
  grid-row: 2;
  margin: 0;
  max-width: 72ch;
  font: 400 var(--v2-t-sm)/1.55 var(--v2-sans);
  color: var(--v2-ink-3);
}

html[data-ui='v2'][data-v2] .hmo-universe-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--v2-s3);
}
@media (max-width: 900px) {
  html[data-ui='v2'][data-v2] .hmo-universe-grid { grid-template-columns: 1fr; }
}

html[data-ui='v2'][data-v2] .hmo-uni-card {
  background: var(--v2-surface);
  border: 1px solid var(--v2-line);
  border-radius: var(--v2-r-lg);
  padding: 14px 16px;
  box-shadow: var(--v2-e1);
  text-align: left;
  cursor: pointer;
  width: 100%;
  color: inherit;
  font: inherit;
  transition: border-color 120ms ease, transform 120ms ease;
}
html[data-ui='v2'][data-v2] .hmo-uni-card:hover {
  border-color: var(--v2-line-2);
  transform: translateY(-1px);
}
html[data-ui='v2'][data-v2] .hmo-uni-card.is-up { border-color: color-mix(in srgb, var(--v2-bull) 35%, transparent); }
html[data-ui='v2'][data-v2] .hmo-uni-card.is-down { border-color: color-mix(in srgb, var(--v2-bear) 35%, transparent); }
html[data-ui='v2'][data-v2] .hmo-uni-name {
  font: 650 var(--v2-t-md)/1.2 var(--v2-sans);
  color: var(--v2-ink);
  margin-bottom: 4px;
}
html[data-ui='v2'][data-v2] .hmo-uni-stance {
  font: 700 12px/1 var(--v2-sans);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
html[data-ui='v2'][data-v2] .hmo-uni-stance.hmo-up { color: var(--v2-bull); }
html[data-ui='v2'][data-v2] .hmo-uni-stance.hmo-down { color: var(--v2-bear); }
html[data-ui='v2'][data-v2] .hmo-uni-stance.hmo-flat { color: var(--v2-ink-3); }
html[data-ui='v2'][data-v2] .hmo-uni-detail {
  font: 400 var(--v2-t-xs)/1.4 var(--v2-sans);
  color: var(--v2-ink-3);
}

html[data-ui='v2'][data-v2] .hmo-asset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--v2-s3);
}
@media (max-width: 800px) {
  html[data-ui='v2'][data-v2] .hmo-asset-grid { grid-template-columns: 1fr; }
}

html[data-ui='v2'][data-v2] .hmo-chip {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font: 600 10px/1 var(--v2-sans);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid var(--v2-line);
  color: var(--v2-ink-2);
  background: var(--v2-sunk);
  white-space: nowrap;
  max-width: none;
  overflow: visible;
}
html[data-ui='v2'][data-v2] .hmo-chip.is-transition {
  border-color: rgba(245, 158, 11, 0.4);
  color: #b45309;
  background: rgba(245, 158, 11, 0.1);
}
html[data-ui='v2'][data-v2] .hmo-chip.is-momentum-up {
  border-color: color-mix(in srgb, var(--v2-bull) 35%, transparent);
  color: #047857;
  background: color-mix(in srgb, var(--v2-bull) 10%, transparent);
}
html[data-ui='v2'][data-v2] .hmo-chip.is-momentum-down {
  border-color: color-mix(in srgb, var(--v2-bear) 35%, transparent);
  color: #b91c1c;
  background: color-mix(in srgb, var(--v2-bear) 10%, transparent);
}

html[data-ui='v2'][data-v2] .hmo-level-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--v2-s3);
}
@media (max-width: 900px) {
  html[data-ui='v2'][data-v2] .hmo-level-grid { grid-template-columns: 1fr; }
}

html[data-ui='v2'][data-v2] .hmo-level-card {
  background: var(--v2-surface);
  border: 1px solid var(--v2-line);
  border-radius: var(--v2-r-lg);
  padding: 14px 16px;
  box-shadow: var(--v2-e1);
}
html[data-ui='v2'][data-v2] .hmo-level-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--v2-s2);
  margin-bottom: 10px;
}
html[data-ui='v2'][data-v2] .hmo-level-sym {
  font: 700 var(--v2-t-md)/1 var(--v2-sans);
  color: var(--v2-ink);
}
html[data-ui='v2'][data-v2] .hmo-level-row {
  display: grid;
  grid-template-columns: 52px 1fr auto auto;
  gap: var(--v2-s2);
  align-items: center;
  padding: 7px 0;
  border-top: 1px solid var(--v2-line);
  font: 500 var(--v2-t-xs)/1.3 var(--v2-sans);
  color: var(--v2-ink-2);
}
html[data-ui='v2'][data-v2] .hmo-level-row:first-of-type { border-top: 0; }
html[data-ui='v2'][data-v2] .hmo-grade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  font: 700 11px/1 var(--v2-sans);
  background: var(--v2-sunk);
  color: var(--v2-ink);
}
html[data-ui='v2'][data-v2] .hmo-grade.g-Aplus,
html[data-ui='v2'][data-v2] .hmo-grade.g-A {
  background: color-mix(in srgb, var(--v2-bull) 14%, transparent);
  color: #047857;
}
html[data-ui='v2'][data-v2] .hmo-grade.g-Bplus,
html[data-ui='v2'][data-v2] .hmo-grade.g-B {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}
html[data-ui='v2'][data-v2] .hmo-side-demand { color: #047857; }
html[data-ui='v2'][data-v2] .hmo-side-supply { color: #b91c1c; }
html[data-ui='v2'][data-v2] .hmo-level-price {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  color: var(--v2-ink);
}
html[data-ui='v2'][data-v2] .hmo-level-dist {
  font-variant-numeric: tabular-nums;
  color: var(--v2-ink-3);
}
html[data-ui='v2'][data-v2] .hmo-level-open {
  appearance: none;
  margin-top: 10px;
  border: 1px solid var(--v2-line);
  background: var(--v2-sunk);
  color: var(--v2-ink-2);
  border-radius: 999px;
  height: 30px;
  padding: 0 12px;
  font: 600 11px/1 var(--v2-sans);
  cursor: pointer;
  width: 100%;
}
html[data-ui='v2'][data-v2] .hmo-level-open:hover {
  border-color: var(--v2-line-2);
  color: var(--v2-ink);
}

/* Compact professional path note under title when trader is off */
html[data-ui='v2'][data-v2] body.audience-professional .hmo-sub-pro-note {
  display: block;
}
html[data-ui='v2'][data-v2] .hmo-sub-pro-note { display: none; }

/* Tour card polish under v2 */
html[data-ui='v2'][data-v2] .tour-card {
  background: var(--v2-surface);
  border: 1px solid var(--v2-line);
  border-radius: var(--v2-r-lg);
  box-shadow: var(--v2-e3);
  color: var(--v2-ink);
}
html[data-ui='v2'][data-v2] .tour-card h3 { color: var(--v2-ink); }
html[data-ui='v2'][data-v2] .tour-card .tour-sub { color: var(--v2-ink-3); }
html[data-ui='v2'][data-v2] .tour-step-list li { color: var(--v2-ink-2); }
html[data-ui='v2'][data-v2] .tour-step-list strong { color: var(--v2-ink); }
html[data-ui='v2'][data-v2] .tour-btn-primary {
  background: var(--v2-accent);
  border-color: transparent;
  color: var(--v2-accent-ink);
}
