/* B Soft: shared control geometry and neutral interaction states.
   Deliberately does not recolor chart marks, signal badges, or financial values. */
:root {
  --soft-field-radius: 14px;
  --soft-action-radius: 12px;
  --soft-panel-radius: 14px;
  --soft-focus: #687782;
  --soft-hover: #f4f5f6;
  --soft-selected: #e9edef;
  --soft-selected-ink: #25313a;
  --soft-selected-border: #83909a;
}
:root[data-theme="dark"], :root.dark,
:root:not([data-theme="light"]) body.dark-mode,
:root:not([data-theme="light"]) body.dark {
  --soft-focus: #a8b3bc;
  --soft-hover: #171d21;
  --soft-selected: #252d33;
  --soft-selected-ink: #edf1f7;
  --soft-selected-border: #87949e;
}
/* These surfaces intentionally stay dark even when the host page is light. */
.command-overlay {
  --soft-focus: #a8b3bc;
  --soft-hover: #1c2830;
  --soft-selected: #2c3942;
  --soft-selected-ink: #edf1f7;
  --soft-selected-border: #87949e;
}
html:root body :is(select, textarea, input:not([type]), input[type="search"], input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="datetime-local"], input[type="tel"], input[type="url"], .search-box, .managed-search, .tb-search, .search-field, .search-input, .search-wrapper, .filter-select, .select) {
  border-radius: var(--soft-field-radius) !important;
}
/* Keep purpose-built circular icon controls and the masthead's pill menu. */
html:root body :is(button, input[type="button"], input[type="submit"], input[type="reset"], a.btn, a.button, .filter-chip, .filter-btn, .tab-btn, .range-btn, .timeframe-btn, .preview-action, .research-source a):not(:where(#nav-toggle, #theme-toggle, .theme-toggle, [role="switch"], .diagnostic-collapse-toggle, .close-btn, .cn-close, .command-close, .chart-modal-close, .modal-close, .atlas-reset, .asset-tile, .rp-asset-tile, .orbit-point, .family-controls button, .family-counts button, .strategy-preview, .ms-sleeve-tab, .ap-history-tab, [class*="dot"], [class*="bubble"], .cn-header *, #site-navigation *, .site-header *)) {
  border-radius: var(--soft-action-radius) !important;
}
html:root body :is(.filter-btn, .filter-chip, .command-filters button, .filter-row button, .filters button, .table-filters button) { border-radius: var(--soft-field-radius) !important; }
html:root body .cn-header .cn-shortcut { border-radius: var(--soft-action-radius) !important; }
/* Rounded boundaries belong to containers, not the axes or marks within them. */
/* Portfolio performance panels and chart containers retain their original square geometry. */
html:root body :is(.scatter-wrap, .atlas-wrap, .histogram, .discovery-card, .chart-container, .chart-wrap, .chart-shell, .chart-frame, .history-chart, .factor-chart-surface, .range-control, .range-controls, .ms-range-controls, .group-toggle, .reference-chart, .value-breadth-chart, .corr-mini-chart, .corr-network-panel, .ticker-corr-network, .corr-network-stage, .corr-network-rail, .corr-panel, .terminal-card, .terminal-panel, .metric-card, .history-card, .portfolio-card, .performance-panel, .allocation-panel, .rebalance-panel, .rp-dashboard-panel, .diagnostic-card, .leaderboard-card, .modal-panel, .chart-modal-panel, .mobile-map-panel, .table-shell, .table-wrap, .tb-table-wrap, .command-preview, .command-suggestions, .ws-library-card):not(:where(body:has(.allocation-mosaic, .rp-mosaic) :is(.performance-panel, .rebalance-panel, .chart-container, .chart-wrap, .chart-shell, .chart-frame, .history-chart, .factor-chart-surface, .reference-chart, .value-breadth-chart, .corr-mini-chart))) {
  border-radius: var(--soft-panel-radius) !important;
  background-clip: padding-box;
}
html:root body :is(.scatter-wrap, .atlas-wrap, .histogram, .chart-container, .chart-wrap, .chart-frame) > :is(svg, canvas) { border-radius: inherit; }
/* Pointer focus is quiet; keyboard users retain a clearly visible neutral outline. */
html:root body :is(input, select, textarea, button, [role="button"], [role="tab"], .discovery-card, .sector-row):focus {
  box-shadow: none !important;
}
html:root body :is(input, select, textarea, button, [role="button"], [role="tab"], .discovery-card, .sector-row):focus:not(:focus-visible) { outline: none !important; }
html:root body :is(input, select, textarea, button, [role="button"], [role="tab"], .discovery-card, .sector-row):focus-visible {
  outline: 2px solid var(--soft-focus) !important;
  outline-offset: 2px !important;
  box-shadow: none !important;
}
html:root body :is(input, select, textarea):focus { border-color: var(--soft-focus) !important; }
html:root body :is(.search-box, .managed-search, .tb-search, .search-wrapper):focus-within {
  border-color: var(--soft-focus) !important;
  outline: none !important;
  box-shadow: none !important;
}
html:root body :is(.search-box, .managed-search, .tb-search, .search-wrapper):has(input:focus-visible) {
  outline: 2px solid var(--soft-focus) !important;
  outline-offset: 2px !important;
}
html:root body :is(.search-box, .managed-search, .tb-search, .search-wrapper) input:focus-visible { outline: none !important; }
html:root body :is(.discovery-card, .sector-row):is(:hover, :focus, .active, .is-active, .selected, .is-selected, [aria-selected="true"]) {
  background: var(--soft-hover) !important;
  border-color: var(--soft-selected-border) !important;
  box-shadow: none !important;
}
/* Only compact filter/segmented controls share this fill. A semantic pressed or
   selected state alone must never turn an artwork button or list row into a box. */
html:root body :is(.filter-chip, .filter-btn, .range-btn, .range-button, .timeframe-btn,
  .filters button, .filter-row button, .table-filters button, .command-filters button,
  .group-toggle button, .range-control button, .range-controls button,
  .ms-range-controls button, .tb-range button, .tb-member-filter button,
  .corr-control-group button, .signal-change-toggle, .factor-analytics__tab):is(.active, .is-active, .selected, .is-selected, [aria-pressed="true"], [aria-selected="true"]) {
  background: var(--soft-selected) !important;
  background-image: none !important;
  border-color: var(--soft-selected-border) !important;
  color: var(--soft-selected-ink) !important;
  box-shadow: none !important;
}

/* Horizontal research tabs use one inset capsule, without a second underline.
   Keep their existing responsive grids and leave vertical editorial rows alone. */
html:root body :is(.tb-tabs, .perspective-tabs, .approach-steps) {
  gap: 10px;
  padding-block: 8px;
  border: 0;
}
html:root body :is(.tb-tabs, .perspective-tabs, .approach-steps) > button {
  min-height: 44px;
  min-width: 0;
  margin: 0;
  padding: 12px 18px;
  border: 0 !important;
  border-radius: 999px !important;
  background: transparent;
  box-shadow: none !important;
  text-decoration: none;
  transition: color 160ms ease, background-color 160ms ease;
}
html:root body :is(.tb-tabs, .perspective-tabs, .approach-steps) > button[aria-selected="true"] {
  background: var(--soft-selected);
  color: var(--soft-selected-ink);
}
html:root body .perspective-tabs > button { justify-content: center; }
@media (hover: hover) {
  html:root body :is(.tb-tabs, .perspective-tabs, .approach-steps) > button:hover:not([aria-selected="true"]) {
    background: var(--soft-hover);
    color: var(--soft-selected-ink);
  }
}
@media (max-width: 760px) {
  html:root body :is(.tb-tabs, .perspective-tabs, .approach-steps) > button { padding: 10px 14px; }
}
@media (max-width: 540px) {
  html:root body .perspective-tabs { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
  html:root body .perspective-tabs > button { grid-column: span 2; }
  html:root body .perspective-tabs > button:nth-last-child(-n+2) { grid-column: span 3; }
}

/* Allocation grids and tiles retain their original adjoining, square layout. */
html:root body .asset-tile-heading { flex-wrap: wrap; }

/* Capsule caps only: retain every existing width, height, position and value. */
html:root body :is(.side-meter, .metric-meter, .trend-stack-track, .trend-stack-fill,
  .bar-track, .bar-fill, .mini-meter, .rotation-track, .sector-track,
  .sector-bar-track, .sector-bar-fill, .rp-sector-track, .modal-bar-track,
  .modal-bar-fill, .signal-meter, .signal-meter-fill, .mr-cluster-meter, .research-meter, .factor-bar-fill) {
  border-radius: 999px !important;
}
html:root body :is(.side-meter, .metric-meter, .bar-track, .mini-meter,
  .rotation-track, .sector-track, .sector-bar-track, .rp-sector-track,
  .modal-bar-track, .signal-meter, .mr-cluster-meter, .research-meter) > :is(b, i, span, .bar-fill) {
  border-radius: 999px !important;
}
/* The bottom stays square so each histogram column still meets its baseline. */
html:root body .hist-bar { border-radius: 999px 999px 0 0 !important; }

/* Terminal hover B: a neutral inset edge, with no fill or movement. */
html:root body:is(.mr-redesign, .signals-redesign, .thematic-baskets)
  :is(.sector-row, .industry-pulse-row, .discovery-card) {
  position: relative;
  box-sizing: border-box;
  transition: border-color 140ms ease !important;
}
html:root body:is(.mr-redesign, .signals-redesign, .thematic-baskets)
  :is(.sector-row, .industry-pulse-row, .discovery-card):is(:hover, :focus-visible) {
  background: transparent !important;
  border-color: var(--line) !important;
  box-shadow: none !important;
  transform: none !important;
}
html:root body:is(.mr-redesign, .signals-redesign, .thematic-baskets)
  :is(.sector-row, .industry-pulse-row, .discovery-card)::after {
  content: "";
  display: block !important;
  position: absolute;
  inset: auto 12px -1px;
  height: 2px;
  border-radius: 2px;
  background: transparent !important;
  pointer-events: none;
}
html:root body:is(.mr-redesign, .signals-redesign, .thematic-baskets)
  :is(.sector-row, .industry-pulse-row, .discovery-card):is(:hover, :focus-visible)::after {
  background: var(--soft-focus) !important;
}

/* Inset capsules for local section navigation. Masthead navigation is untouched. */
html:root body :is(.mr-section-nav, .section-navigation) {
  background: var(--panel, var(--bg, transparent)) !important;
}
html:root body :is(.mr-section-nav .mr-inner, .section-navigation .band-inner, .section-navigation .hub-tabs) {
  gap: 10px !important;
  padding-block: 8px !important;
}
html:root body :is(.mr-section-nav, .section-navigation) a {
  border: 0 !important;
  border-radius: 999px !important;
  padding-inline: 12px !important;
  background: transparent !important;
  color: var(--muted, inherit) !important;
  min-width: 0;
}
html:root body :is(.mr-section-nav, .section-navigation) a:hover { background: var(--soft-hover) !important; }
html:root body :is(.mr-section-nav, .section-navigation) a:is([aria-current]:not([aria-current="false"]), .active, .is-active) {
  border-radius: 999px !important;
  background: var(--soft-selected) !important;
  color: var(--soft-selected-ink) !important;
}
html:root body :is(.mr-section-nav, .section-navigation) a:focus-visible {
  outline: 2px solid var(--soft-focus) !important;
  outline-offset: -3px !important;
}
@media (prefers-reduced-motion: reduce) {
  html:root body:is(.mr-redesign, .signals-redesign, .thematic-baskets)
    :is(.sector-row, .industry-pulse-row, .discovery-card) { transition: none !important; }
}
