/* My Portfolio embed (#home toggles via .home-secondary-embed) */

.home-secondary-embed.collector-pulse-skin[hidden] {
  display: none !important;
}

.collector-pulse-skin .collector-pulse-intro {
  color: var(--theme-text-panel-subtitle, #8892b0);
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 52rem;
  margin-bottom: 1.25rem;
}

.collector-pulse-skin .pulse-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 20px;
}

.collector-pulse-skin .pulse-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--carolina-blue, #4b9cd3);
  color: var(--carolina-blue, #4b9cd3);
  background: transparent;
  font-family: inherit;
}

.collector-pulse-skin .pulse-link-btn:hover {
  background: rgba(75, 156, 211, 0.12);
}

.collector-pulse-skin .pulse-mini-table-wrap {
  overflow-x: auto;
  margin-top: 12px;
  border-radius: 10px;
  border: 1px solid var(--theme-border-default, rgba(255, 255, 255, 0.08));
}

.collector-pulse-skin .pulse-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

/* Portfolio tracked/pinned metric grids — uniform column rhythm across every group card */
.collector-pulse-skin .pulse-mini-table--portfolio-stats {
  table-layout: fixed;
  width: 100%;
  min-width: 44rem;
}

/* Tracked: optional Grp column + Δ 1d + listing-sample metrics */
.collector-pulse-skin .pulse-mini-table--portfolio-tracked {
  min-width: 46rem;
}

.collector-pulse-skin .pulse-mini-table--portfolio-stats th:first-child,
.collector-pulse-skin .pulse-mini-table--portfolio-stats td:first-child {
  width: 13rem;
  max-width: min(13rem, 32vw);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.collector-pulse-skin .pulse-mini-table--portfolio-stats th.num,
.collector-pulse-skin .pulse-mini-table--portfolio-stats td.num {
  width: 4.75rem;
  min-width: 4.35rem;
  padding-left: 8px;
  padding-right: 8px;
  white-space: nowrap;
}

.collector-pulse-skin .pulse-mini-table--portfolio-stats tbody tr.pulse-portfolio-group-avg-row th.num,
.collector-pulse-skin .pulse-mini-table--portfolio-stats tbody tr.pulse-portfolio-group-avg-row td.num {
  white-space: nowrap;
}

.collector-pulse-skin .pulse-mini-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--theme-text-panel-subtitle, #8892b0);
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--theme-border-default, rgba(255, 255, 255, 0.06));
}

.collector-pulse-skin .pulse-mini-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--theme-border-muted, rgba(255, 255, 255, 0.04));
}

.collector-pulse-skin .pulse-mini-table tbody tr:last-child td {
  border-bottom: none;
}

.collector-pulse-skin .pulse-mini-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.collector-pulse-skin .pulse-mini-table .pos {
  color: #4cd964;
  font-weight: 600;
}

.collector-pulse-skin .pulse-mini-table .neg {
  color: #ff3b30;
  font-weight: 600;
}

.collector-pulse-skin .pulse-mini-table tbody tr[data-trend-key] {
  cursor: pointer;
}

.collector-pulse-skin .pulse-mini-table tbody tr[data-trend-key]:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.collector-pulse-skin .pulse-muted {
  color: var(--theme-text-panel-subtitle, #8892b0);
  font-size: 0.85rem;
  margin-top: 8px;
}

.collector-pulse-skin .pulse-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 12px 0;
}

.collector-pulse-skin .pulse-stat {
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--theme-border-default, rgba(255, 255, 255, 0.1));
  min-width: 120px;
  background: var(--theme-bg-surface, #1b1f2b);
}

.collector-pulse-skin .pulse-stat strong {
  display: block;
  font-size: 1.35rem;
  color: var(--theme-text-heading, #fff);
}

.collector-pulse-skin .pulse-stat span.label {
  font-size: 0.75rem;
  color: var(--theme-text-panel-subtitle, #8892b0);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.collector-pulse-skin button.pulse-stat--toggle {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  font-family: inherit;
  color: var(--theme-text-heading, #f5f5f5);
  flex: 1 1 auto;
  min-width: min(220px, 100%);
  text-align: left;
  align-items: center;
  display: inline-flex;
  flex-direction: row;
  gap: 10px;
  box-sizing: border-box;
  background: var(--theme-bg-surface, #1b1f2b);
  border: 1px solid var(--theme-border-default, rgba(255, 255, 255, 0.12));
}

/* Overrides native button / vague `inherit`; labels stay readable on dark surface */
.collector-pulse-skin button.pulse-stat--toggle .pulse-stat-toggle-inner .label {
  color: var(--theme-text-caption, #c5cdd8);
}

.collector-pulse-skin button.pulse-stat--toggle strong {
  color: var(--theme-text-on-dark, #fff);
}

.collector-pulse-skin button.pulse-stat--toggle .pulse-stat-toggle-affordance {
  color: var(--theme-text-caption, #c5cdd8);
  opacity: 0.92;
}

.collector-pulse-skin button.pulse-stat--toggle:focus-visible {
  outline: 2px solid var(--carolina-blue, #4b9cd3);
  outline-offset: 2px;
}

.collector-pulse-skin button.pulse-stat--toggle:hover {
  border-color: var(--theme-border-home-default-summary-hover, rgba(255, 255, 255, 0.22));
  background: var(--theme-bg-surface-elevated, #252a3a);
}

.collector-pulse-skin button.pulse-stat--toggle[aria-expanded="true"] {
  border-color: rgba(75, 156, 211, 0.65);
  background: rgba(75, 156, 211, 0.16);
  box-shadow: 0 0 0 1px rgba(75, 156, 211, 0.12);
}

.pulse-stat-toggle-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1 1 auto;
  min-width: 0;
}

.pulse-stat-toggle-affordance {
  flex-shrink: 0;
  font-size: 0.7rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

.collector-pulse-skin button.pulse-stat--toggle[aria-expanded="true"] .pulse-stat-toggle-affordance {
  transform: rotate(-180deg);
}

/* My Portfolio — mirror Home pin-group chrome (see home.css home-pin-group-card) */

.pulse-portfolio-block-title {
  margin: 1.35rem 0 0.5rem;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--theme-text-panel-subtitle, #8892b0);
}

.pulse-portfolio-block-title--pinned {
  margin-top: 1rem;
}

.pulse-portfolio-readonly-group {
  margin-bottom: 12px;
}

.pulse-portfolio-readonly-group:last-child {
  margin-bottom: 0;
}

.pulse-portfolio-group-summary .pulse-portfolio-group-count {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 700;
  opacity: 0.72;
  margin-left: 8px;
  letter-spacing: 0.06em;
}

.pulse-portfolio-group-summary .home-pin-group-card__chev {
  margin-left: auto;
}

.pulse-portfolio-group-table-body .pulse-mini-table-wrap {
  overflow-x: auto;
  margin: 4px 0 0;
  border-radius: 8px;
  border: 1px solid var(--theme-border-muted, rgba(255, 255, 255, 0.06));
}

.pulse-portfolio-group-table-body .pulse-mini-table--in-group {
  margin-bottom: 0;
}

.collector-pulse-skin .pulse-mini-table th.num {
  white-space: nowrap;
}

.collector-pulse-skin tbody tr.pulse-portfolio-group-avg-row th,
.collector-pulse-skin tbody tr.pulse-portfolio-group-avg-row td {
  background: rgba(75, 156, 211, 0.08);
  border-bottom: 1px solid var(--theme-border-default, rgba(255, 255, 255, 0.08));
}

.collector-pulse-skin tbody tr.pulse-portfolio-group-avg-row th.pulse-portfolio-avg-label {
  text-align: left;
  font-weight: 700;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--theme-text-caption, #a8b4c8);
}

.collector-pulse-skin tbody tr.pulse-portfolio-group-avg-row td.num {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.collector-pulse-skin tbody tr.pulse-portfolio-group-avg-row .pulse-portfolio-avg-meta {
  display: inline;
  margin-left: 4px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  color: var(--theme-text-caption, #8892b0);
}

.collector-pulse-skin tbody tr[data-pinned-product-id] {
  cursor: pointer;
}

.collector-pulse-skin tbody tr[data-pinned-product-id]:hover td {
  background: rgba(255, 255, 255, 0.03);
}

/* —— My Portfolio hero: side-by-side like Market overview (chart | collections) —— */
#home-portfolio-embed .pulse-portfolio-hero-split.home-split-layout {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 24px;
  width: 100%;
  margin-bottom: 24px;
  /* Same row height feel as Market Performance + Watchlist */
  height: clamp(650px, 75vh, calc(100vh - 100px));
  max-height: calc(100vh - 80px);
  min-height: 360px;
  overflow: hidden;
}

#home-portfolio-embed .pulse-portfolio-hero-chart-col.home-chart-column {
  flex: 3;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#home-portfolio-embed .pulse-portfolio-hero-chart-col .pulse-portfolio-hero-canvas-wrap.chart-container {
  flex: 1 1 0%;
  min-height: 0;
}

#home-portfolio-embed .pulse-portfolio-collections-rail.home-pinned-column {
  flex: 2;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Chart column header uses the same DOM order as Home “Market Performance” (see home.css `.home-chart-column .panel-header`). */

#home-portfolio-embed .pulse-portfolio-hero-panel-header--chart .pulse-portfolio-hero-heading {
  margin: 0;
}

/* Portfolio chart header layout: inherited from home.css `.home-chart-column .panel-header` (same as Market Performance). */

#home-portfolio-embed .pulse-portfolio-hero-chart-col.home-chart-column .panel-actions .legend-wrapper {
  flex-shrink: 0;
}

#home-portfolio-embed .pulse-portfolio-hero-chart-col.home-chart-column .panel-actions .home-pinned-trend-line-wrap {
  flex-shrink: 0;
}

#home-portfolio-embed .pulse-portfolio-mode-toggle,
#home-portfolio-embed .pulse-portfolio-pie-metric-toggle {
  display: inline-flex;
  flex-wrap: wrap;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid var(--theme-border-default, rgba(255, 255, 255, 0.12));
}

/* Performance sandbox host + collapsible <details> (default collapsed) */
#home-portfolio-embed .pulse-portfolio-performance-host:not([hidden]) {
  flex-shrink: 0;
  margin: 0 0 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Totals tab: chart tools in right rail; breakdown sections below the split row */
#home-portfolio-embed .pulse-portfolio-hero-split--totals .pulse-portfolio-rail-scroll {
  padding: 0 14px 14px;
  box-sizing: border-box;
}

/* Products tab: chart-line cards need inset from rail edges */
#home-portfolio-embed .pulse-portfolio-body--products .pulse-portfolio-rail-scroll {
  padding: 0 14px 14px;
  box-sizing: border-box;
}

#home-portfolio-embed .pulse-portfolio-rail-perf-tools {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}

#home-portfolio-embed .pulse-portfolio-rail-view--tools {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}

#home-portfolio-embed .pulse-portfolio-performance-host--rail:not([hidden]) {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 12px 2px 2px;
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0;
}

#home-portfolio-embed .pulse-performance-rail-layout {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  gap: 10px;
}

#home-portfolio-embed .pulse-performance-rail-top {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

#home-portfolio-embed .pulse-performance-rail-top__meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 0;
  margin: 0;
  padding: 0 2px;
}

#home-portfolio-embed .pulse-performance-rail-top__meta .pulse-performance-stats-asof {
  margin: 0;
  text-align: right;
  white-space: nowrap;
}

#home-portfolio-embed .pulse-performance-rail-middle {
  flex: 1 1 auto;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  padding: 6px 0 10px;
  overflow: hidden;
}

#home-portfolio-embed .pulse-performance-stats-loading,
#home-portfolio-embed .pulse-performance-stats-empty {
  margin: 0;
  font-size: 0.66rem;
  line-height: 1.35;
}

#home-portfolio-embed .pulse-performance-stats-asof {
  font-size: 0.6rem;
  line-height: 1.25;
  flex-shrink: 0;
}

#home-portfolio-embed .pulse-performance-stats-grid {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
}

#home-portfolio-embed .pulse-performance-stat-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 9px 10px;
  min-height: 0;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid var(--theme-border-default, rgba(255, 255, 255, 0.11));
  background: rgba(255, 255, 255, 0.04);
}

body.light-mode #home-portfolio-embed .pulse-performance-stat-card {
  background: rgba(0, 0, 0, 0.04);
}

#home-portfolio-embed .pulse-performance-stat-card__label {
  font-size: 0.58rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--theme-text-muted, #9ca3af);
}

#home-portfolio-embed .pulse-performance-stat-card__value {
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--theme-text-heading, #e8eef8);
}

body.light-mode #home-portfolio-embed .pulse-performance-stat-card__value {
  color: var(--theme-text-heading, #111827);
}

#home-portfolio-embed .pulse-performance-stat-card__delta {
  font-size: 0.67rem;
  font-weight: 600;
  line-height: 1.2;
}

#home-portfolio-embed .pulse-performance-stat-card__delta.pos {
  color: #4cd964;
}

#home-portfolio-embed .pulse-performance-stat-card__delta.neg {
  color: #ff3b30;
}

#home-portfolio-embed .pulse-performance-stat-card__delta-period {
  opacity: 0.8;
  font-weight: 500;
}

#home-portfolio-embed .pulse-performance-stat-card__hint {
  font-size: 0.6rem;
  line-height: 1.2;
  margin-top: 1px;
}

#home-portfolio-embed .pulse-performance-rail-bottom {
  margin-top: auto;
  flex-shrink: 0;
  min-width: 0;
  padding-top: 12px;
  border-top: 1px solid var(--theme-border-default, rgba(255, 255, 255, 0.1));
}

body.light-mode #home-portfolio-embed .pulse-performance-rail-bottom {
  border-top-color: rgba(0, 0, 0, 0.08);
}

#home-portfolio-embed .pulse-performance-rail-layout:has(.pulse-performance-sandbox-details[open]) {
  overflow-y: auto;
  padding-right: 2px;
}

#home-portfolio-embed .pulse-portfolio-body--mix .pulse-portfolio-hero-split.home-split-layout {
  margin-bottom: 16px;
}

#home-portfolio-embed .pulse-portfolio-mix-foot {
  width: 100%;
  margin: 0 0 20px;
}

#home-portfolio-embed .pulse-portfolio-mix-foot[hidden] {
  display: none !important;
}

#home-portfolio-embed .pulse-portfolio-mix-foot__section {
  padding: 14px 16px;
  border-radius: var(--theme-tab-surface-radius, 12px);
  border: 1px solid var(--theme-home-column-border, rgba(255, 255, 255, 0.1));
  background: var(--theme-bg-surface, rgba(12, 16, 28, 0.92));
  box-shadow: var(--theme-home-column-shadow, 0 4px 24px rgba(0, 0, 0, 0.18));
}

#home-portfolio-embed .pulse-portfolio-mix-foot__title {
  margin: 0 0 12px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--theme-text-muted, #9ca3af);
}

#home-portfolio-embed .pulse-portfolio-mix-foot__body {
  min-width: 0;
  overflow-x: auto;
}

#home-portfolio-embed .pulse-mini-table-wrap--portfolio-collections {
  margin-top: 0;
  border: none;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
  overflow: hidden;
}

#home-portfolio-embed .pulse-portfolio-body--mix #pulse-portfolio-products-foot {
  display: none !important;
}

#home-portfolio-embed .pulse-mini-table--portfolio-collections {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  font-size: 0.8125rem;
}

#home-portfolio-embed .pulse-mini-table--portfolio-collections thead th {
  padding: 9px 10px;
  font-size: 0.625rem;
  letter-spacing: 0.05em;
  color: var(--theme-text-muted, #9ca3af);
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.28);
}

#home-portfolio-embed .pulse-mini-table--portfolio-collections thead th.num {
  text-align: right;
}

#home-portfolio-embed .pulse-mini-table--portfolio-collections tbody td,
#home-portfolio-embed .pulse-mini-table--portfolio-collections tbody th {
  padding: 12px 10px;
  vertical-align: middle;
  line-height: 1.35;
}

#home-portfolio-embed .pulse-mini-table--portfolio-collections-value th:nth-child(1),
#home-portfolio-embed .pulse-mini-table--portfolio-collections-value td:nth-child(1) {
  width: 15%;
}

#home-portfolio-embed .pulse-mini-table--portfolio-collections-value th:nth-child(2),
#home-portfolio-embed .pulse-mini-table--portfolio-collections-value td:nth-child(2) {
  width: 21%;
}

#home-portfolio-embed .pulse-mini-table--portfolio-collections-value th:nth-child(3),
#home-portfolio-embed .pulse-mini-table--portfolio-collections-value td:nth-child(3) {
  width: 12%;
}

#home-portfolio-embed .pulse-mini-table--portfolio-collections-value th:nth-child(4),
#home-portfolio-embed .pulse-mini-table--portfolio-collections-value td:nth-child(4) {
  width: 11%;
}

#home-portfolio-embed .pulse-mini-table--portfolio-collections-value th:nth-child(5),
#home-portfolio-embed .pulse-mini-table--portfolio-collections-value td:nth-child(5) {
  width: 9%;
}

#home-portfolio-embed .pulse-mini-table--portfolio-collections-value th:nth-child(6),
#home-portfolio-embed .pulse-mini-table--portfolio-collections-value td:nth-child(6) {
  width: 8%;
}

#home-portfolio-embed .pulse-mini-table--portfolio-collections-value th:nth-child(7),
#home-portfolio-embed .pulse-mini-table--portfolio-collections-value td:nth-child(7) {
  width: 9%;
}

#home-portfolio-embed .pulse-mini-table--portfolio-collections-value th:nth-child(8),
#home-portfolio-embed .pulse-mini-table--portfolio-collections-value td:nth-child(8) {
  width: 15%;
}

#home-portfolio-embed .pulse-mini-table--portfolio-collections-supply th:nth-child(1),
#home-portfolio-embed .pulse-mini-table--portfolio-collections-supply td:nth-child(1) {
  width: 22%;
}

#home-portfolio-embed .pulse-mini-table--portfolio-collections-supply th:nth-child(2),
#home-portfolio-embed .pulse-mini-table--portfolio-collections-supply td:nth-child(2) {
  width: 28%;
}

#home-portfolio-embed .pulse-mini-table--portfolio-collections-supply th:nth-child(3),
#home-portfolio-embed .pulse-mini-table--portfolio-collections-supply td:nth-child(3) {
  width: 12%;
}

#home-portfolio-embed .pulse-mini-table--portfolio-collections-supply th:nth-child(4),
#home-portfolio-embed .pulse-mini-table--portfolio-collections-supply td:nth-child(4) {
  width: 12%;
}

#home-portfolio-embed .pulse-mini-table--portfolio-collections-supply th:nth-child(5),
#home-portfolio-embed .pulse-mini-table--portfolio-collections-supply td:nth-child(5) {
  width: 14%;
}

#home-portfolio-embed .pulse-mini-table--portfolio-collections-supply th:nth-child(6),
#home-portfolio-embed .pulse-mini-table--portfolio-collections-supply td:nth-child(6) {
  width: 12%;
}

#home-portfolio-embed .pulse-portfolio-collections-table__name {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--theme-text-heading, #e8eef8);
  text-transform: none;
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#home-portfolio-embed .pulse-portfolio-collections-table-row .pulse-portfolio-collections-table__name {
  color: var(--theme-text-primary, #d8dee9);
}

#home-portfolio-embed .pulse-portfolio-collections-table__name--total {
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--theme-text-muted, #9ca3af);
  font-weight: 700;
}

#home-portfolio-embed .pulse-portfolio-collections-table__market {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--theme-text-heading, #e8eef8);
  overflow-wrap: anywhere;
  line-height: 1.3;
}

#home-portfolio-embed .pulse-portfolio-collections-table__value {
  display: block;
  font-weight: 600;
  font-size: 0.84rem;
}

#home-portfolio-embed .pulse-portfolio-collections-table__value-cell {
  line-height: 1.25;
  vertical-align: top;
}

#home-portfolio-embed .pulse-portfolio-collections-table__hint {
  display: block;
  margin-top: 4px;
  font-size: 0.64rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--theme-text-panel-subtitle, #8892b0);
}

#home-portfolio-embed .pulse-mini-table--portfolio-collections thead th.pulse-portfolio-collections-table__vis,
#home-portfolio-embed .pulse-portfolio-collections-table__vis {
  text-align: center;
  padding-left: 6px;
  padding-right: 6px;
}

#home-portfolio-embed .pulse-mini-table--portfolio-collections .pulse-portfolio-coll-pill {
  padding: 3px 8px;
  font-size: 0.68rem;
}

#home-portfolio-embed .pulse-portfolio-collections-table-row:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

#home-portfolio-embed .pulse-portfolio-collections-total-row td,
#home-portfolio-embed .pulse-portfolio-collections-total-row th {
  vertical-align: middle;
}

#home-portfolio-embed .pulse-portfolio-collections-total-row {
  cursor: default;
}

#home-portfolio-embed .pulse-portfolio-collections-total-row th,
#home-portfolio-embed .pulse-portfolio-collections-total-row td {
  font-weight: 700;
  font-size: 0.84rem;
  color: var(--theme-text-heading, #e8eef8);
  background: rgba(75, 156, 211, 0.1);
  border-bottom: 2px solid rgba(75, 156, 211, 0.22);
}

#home-portfolio-embed .pulse-portfolio-collections-total-row:hover th,
#home-portfolio-embed .pulse-portfolio-collections-total-row:hover td {
  background: rgba(75, 156, 211, 0.1);
}

#home-portfolio-embed .pulse-mini-table--portfolio-collections td.num.pos,
#home-portfolio-embed .pulse-mini-table--portfolio-collections td.num.neg {
  font-weight: 600;
}

#home-portfolio-embed .pulse-portfolio-totals-foot {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
  margin: 0 0 24px;
}

#home-portfolio-embed .pulse-portfolio-products-foot {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
  margin: 0 0 24px;
}

#home-portfolio-embed .pulse-portfolio-totals-foot[hidden],
#home-portfolio-embed .pulse-portfolio-products-foot[hidden] {
  display: none !important;
}

#home-portfolio-embed .pulse-portfolio-totals-foot__section,
#home-portfolio-embed .pulse-portfolio-products-foot__section {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  border-radius: var(--theme-tab-surface-radius, 12px);
  border: 1px solid var(--theme-home-column-border, rgba(255, 255, 255, 0.1));
  background: var(--theme-bg-surface, rgba(12, 16, 28, 0.92));
  box-shadow: var(--theme-home-column-shadow, 0 4px 24px rgba(0, 0, 0, 0.18));
}

#home-portfolio-embed .pulse-portfolio-totals-foot__title,
#home-portfolio-embed .pulse-portfolio-products-foot__title {
  margin: 0 0 10px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--theme-text-heading, #e8eef8);
}

#home-portfolio-embed .pulse-portfolio-products-foot__title-row,
#home-portfolio-embed .pulse-portfolio-totals-foot__title-row {
  flex-shrink: 0;
  min-height: 32px;
  margin: 0 0 10px;
}

#home-portfolio-embed .pulse-portfolio-products-foot__title-row .pulse-portfolio-products-foot__title,
#home-portfolio-embed .pulse-portfolio-totals-foot__title-row .pulse-portfolio-totals-foot__title {
  margin: 0;
}

#home-portfolio-embed .pulse-portfolio-products-foot__body,
#home-portfolio-embed .pulse-portfolio-totals-foot__body.pulse-portfolio-foot-panel-body {
  min-width: 0;
  flex: 1 1 auto;
  min-height: min(32vh, 360px);
  max-height: min(42vh, 480px);
  overflow: auto;
}

#home-portfolio-embed .pulse-portfolio-foot-panel-body .pulse-portfolio-pinned-mount,
#home-portfolio-embed .pulse-portfolio-foot-panel-body .pulse-portfolio-products-mount {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

#home-portfolio-embed .pulse-portfolio-foot-panel-body .home-pin-group-card,
#home-portfolio-embed .pulse-portfolio-foot-panel-body .pulse-portfolio-readonly-group {
  margin-bottom: 0;
}

#home-portfolio-embed .pulse-portfolio-foot-panel-body .pulse-tracked-section-heading {
  margin: 6px 0 0;
  padding: 6px 0 4px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--theme-text-caption, #8b96ab);
  border-bottom: 1px solid var(--theme-border-muted, rgba(255, 255, 255, 0.08));
}

#home-portfolio-embed .pulse-portfolio-foot-panel-body .pulse-tracked-section-heading:first-child {
  margin-top: 0;
  padding-top: 0;
}

#home-portfolio-embed .pulse-portfolio-foot-panel-body .pulse-tracked-section-heading--secondary {
  margin-top: 8px;
  padding-top: 8px;
}

#home-portfolio-embed .pulse-portfolio-products-foot__meta {
  font-weight: 600;
  color: var(--theme-text-muted, #9ca3af);
}

#home-portfolio-embed .pulse-portfolio-section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

#home-portfolio-embed .pulse-portfolio-section-title-row .pulse-portfolio-totals-foot__title,
#home-portfolio-embed .pulse-portfolio-section-title-row .pulse-portfolio-products-foot__title,
#home-portfolio-embed .pulse-portfolio-section-title-row .pulse-portfolio-block-title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}

#home-portfolio-embed .pulse-tracked-group-add-header-btn {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
}

#home-portfolio-embed .pulse-portfolio-totals-foot__meta {
  font-weight: 600;
  color: var(--theme-text-muted, #9ca3af);
}

#home-portfolio-embed .pulse-portfolio-totals-foot__body {
  min-width: 0;
  max-height: min(42vh, 480px);
  overflow: auto;
}

#home-portfolio-embed .pulse-portfolio-totals-foot__body .pulse-portfolio-collections-blurb {
  padding: 0;
}

/* Totals tab: pinned/tracked mounts live in totals foot grid */
#home-portfolio-embed .pulse-portfolio-body--totals #pulse-portfolio-products-foot {
  display: none !important;
}

#home-portfolio-embed .pulse-stat-row.pulse-stat-row--portfolio-cards[hidden],
#home-portfolio-embed .pulse-portfolio-section-stack[hidden] {
  display: none !important;
}

/* Totals / Products foot: compact tables for narrow columns */
#home-portfolio-embed .pulse-portfolio-totals-foot__body .pulse-portfolio-readonly-group,
#home-portfolio-embed .pulse-portfolio-products-foot__body .pulse-portfolio-readonly-group {
  margin-bottom: 8px;
}

#home-portfolio-embed .pulse-portfolio-totals-foot__body .pulse-mini-table-wrap,
#home-portfolio-embed .pulse-portfolio-totals-foot__body .pulse-portfolio-group-table-body .pulse-mini-table-wrap,
#home-portfolio-embed .pulse-portfolio-products-foot__body .pulse-mini-table-wrap,
#home-portfolio-embed .pulse-portfolio-products-foot__body .pulse-portfolio-group-table-body .pulse-mini-table-wrap {
  margin-top: 6px;
}

#home-portfolio-embed .pulse-portfolio-totals-foot__body .pulse-mini-table,
#home-portfolio-embed .pulse-portfolio-products-foot__body .pulse-mini-table {
  font-size: 0.74rem;
}

#home-portfolio-embed .pulse-portfolio-totals-foot__body .pulse-mini-table--portfolio-stats,
#home-portfolio-embed .pulse-portfolio-products-foot__body .pulse-mini-table--portfolio-stats {
  min-width: 26rem;
  table-layout: fixed;
}

#home-portfolio-embed .pulse-portfolio-totals-foot__body .pulse-mini-table--portfolio-tracked,
#home-portfolio-embed .pulse-portfolio-products-foot__body .pulse-mini-table--portfolio-tracked {
  min-width: 28rem;
}

#home-portfolio-embed .pulse-portfolio-totals-foot__body .pulse-mini-table--portfolio-stats th:first-child,
#home-portfolio-embed .pulse-portfolio-totals-foot__body .pulse-mini-table--portfolio-stats td:first-child,
#home-portfolio-embed .pulse-portfolio-products-foot__body .pulse-mini-table--portfolio-stats th:first-child,
#home-portfolio-embed .pulse-portfolio-products-foot__body .pulse-mini-table--portfolio-stats td:first-child {
  width: 7.5rem;
  max-width: 7.5rem;
  font-size: 0.7rem;
  line-height: 1.2;
}

#home-portfolio-embed .pulse-portfolio-totals-foot__body .pulse-mini-table th,
#home-portfolio-embed .pulse-portfolio-products-foot__body .pulse-mini-table th {
  padding: 5px 5px;
  font-size: 0.58rem;
  letter-spacing: 0.02em;
  line-height: 1.15;
  white-space: normal;
  word-break: break-word;
  hyphens: auto;
}

#home-portfolio-embed .pulse-portfolio-totals-foot__body .pulse-mini-table td,
#home-portfolio-embed .pulse-portfolio-products-foot__body .pulse-mini-table td {
  padding: 5px 5px;
  font-size: 0.7rem;
  line-height: 1.2;
}

#home-portfolio-embed .pulse-portfolio-totals-foot__body .pulse-mini-table--portfolio-stats th.num,
#home-portfolio-embed .pulse-portfolio-totals-foot__body .pulse-mini-table--portfolio-stats td.num,
#home-portfolio-embed .pulse-portfolio-products-foot__body .pulse-mini-table--portfolio-stats th.num,
#home-portfolio-embed .pulse-portfolio-products-foot__body .pulse-mini-table--portfolio-stats td.num {
  width: 3.35rem;
  min-width: 3rem;
  padding-left: 4px;
  padding-right: 4px;
  white-space: nowrap;
  font-size: 0.68rem;
}

#home-portfolio-embed .pulse-portfolio-totals-foot__body .pulse-mini-table .pulse-chart-group-col,
#home-portfolio-embed .pulse-portfolio-products-foot__body .pulse-mini-table .pulse-chart-group-col {
  width: 3.25rem;
  min-width: 3rem;
  max-width: 3.5rem;
}

#home-portfolio-embed .pulse-portfolio-totals-foot__body .pulse-mini-table .pulse-chart-group-col select,
#home-portfolio-embed .pulse-portfolio-products-foot__body .pulse-mini-table .pulse-chart-group-col select {
  max-width: 100%;
  font-size: 0.65rem;
  padding: 2px 3px;
}

#home-portfolio-embed .pulse-portfolio-totals-foot__body .pulse-portfolio-group-avg-row th,
#home-portfolio-embed .pulse-portfolio-totals-foot__body .pulse-portfolio-group-avg-row td,
#home-portfolio-embed .pulse-portfolio-products-foot__body .pulse-portfolio-group-avg-row th,
#home-portfolio-embed .pulse-portfolio-products-foot__body .pulse-portfolio-group-avg-row td {
  font-size: 0.65rem;
}

.pulse-tracked-group-add-modal__hint {
  margin: 0 0 12px;
  font-size: 0.82rem;
  line-height: 1.4;
}

.pulse-tracked-group-add-modal__label {
  display: block;
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--theme-text-default, #e5e7eb);
}

.pulse-tracked-group-add-modal__actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

#home-portfolio-embed .pulse-portfolio-hero-split--totals.pulse-portfolio-hero-split {
  margin-bottom: 16px;
}

#home-portfolio-embed .pulse-performance-intro {
  margin: 0;
  font-size: 0.68rem;
  line-height: 1.35;
}

#home-portfolio-embed .pulse-performance-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 6px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
  border: 1px solid var(--theme-border-default, rgba(255, 255, 255, 0.08));
}

body.light-mode #home-portfolio-embed .pulse-performance-presets {
  background: rgba(0, 0, 0, 0.04);
}

#home-portfolio-embed .pulse-performance-preset-btn {
  margin: 0;
  padding: 5px 9px;
  font-size: 0.67rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  border-radius: 7px;
  border: 1px solid var(--theme-border-default, rgba(255, 255, 255, 0.16));
  background: rgba(255, 255, 255, 0.06);
  color: var(--theme-text-default, #d1d9e6);
  font-family: inherit;
  pointer-events: auto;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    color 0.12s ease;
}

body.light-mode #home-portfolio-embed .pulse-performance-preset-btn {
  background: rgba(255, 255, 255, 0.72);
  color: var(--theme-text-default, #374151);
}

#home-portfolio-embed .pulse-performance-preset-btn:hover:not(.is-active) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(75, 156, 211, 0.35);
  color: var(--theme-text-heading, #e8eef8);
}

body.light-mode #home-portfolio-embed .pulse-performance-preset-btn:hover:not(.is-active) {
  background: rgba(75, 156, 211, 0.08);
  color: var(--theme-text-heading, #111827);
}

#home-portfolio-embed .pulse-performance-preset-btn:focus-visible {
  outline: 2px solid rgba(75, 156, 211, 0.65);
  outline-offset: 2px;
}

#home-portfolio-embed .pulse-performance-preset-btn.is-active {
  border-color: rgba(75, 156, 211, 0.55);
  background: rgba(75, 156, 211, 0.22);
  color: var(--theme-text-heading, #e8eef8);
  box-shadow: 0 0 0 1px rgba(75, 156, 211, 0.15);
}

#home-portfolio-embed .pulse-performance-preset-btn--custom {
  border-style: dashed;
}

#home-portfolio-embed .pulse-performance-preset-btn--custom.is-active {
  border-style: dashed;
}

#home-portfolio-embed .pulse-performance-layer-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  min-height: 1.25rem;
}

#home-portfolio-embed .pulse-performance-layer-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--theme-text-default, #e5e7eb);
  background: rgba(75, 156, 211, 0.14);
  border: 1px solid rgba(75, 156, 211, 0.28);
}

#home-portfolio-embed .pulse-performance-layer-chip--empty {
  border-style: dashed;
  background: transparent;
  font-weight: 500;
}

#home-portfolio-embed .pulse-performance-dual-axis-hint,
#home-portfolio-embed .pulse-performance-customize-hint {
  margin: 0 0 6px;
  font-size: 0.64rem;
  line-height: 1.3;
}

#home-portfolio-embed .pulse-performance-opt__hint {
  font-size: 0.6rem;
  line-height: 1.25;
  color: var(--theme-text-muted, #9ca3af);
}

#home-portfolio-embed .pulse-portfolio-hero-panel-actions.pulse-portfolio-panel-actions--performance {
  justify-content: flex-end;
  gap: 8px;
}

#home-portfolio-embed .pulse-performance-sandbox-details {
  border-radius: 8px;
  border: 1px solid var(--theme-border-default, rgba(255, 255, 255, 0.11));
  background: rgba(255, 255, 255, 0.035);
  overflow: hidden;
}

body.light-mode #home-portfolio-embed .pulse-performance-sandbox-details {
  background: rgba(0, 0, 0, 0.035);
}

#home-portfolio-embed .pulse-performance-sandbox-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  list-style: none;
  cursor: pointer;
  user-select: none;
  padding: 5px 8px;
  min-height: 30px;
}

#home-portfolio-embed .pulse-performance-sandbox-summary::-webkit-details-marker {
  display: none;
}

#home-portfolio-embed .pulse-performance-sandbox-summary:focus-visible {
  outline: 2px solid var(--theme-accent-primary, #4b9cd3);
  outline-offset: 2px;
  border-radius: 4px;
}

#home-portfolio-embed .pulse-performance-sandbox-summary__text {
  font-size: 0.61rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--theme-text-muted, #9ca3af);
}

#home-portfolio-embed .pulse-performance-sandbox-summary__chev {
  display: inline-flex;
  flex-shrink: 0;
  font-size: 0.5rem;
  line-height: 1;
  opacity: 0.7;
  transition: transform 0.15s ease;
}

#home-portfolio-embed .pulse-performance-sandbox-details:not([open]) .pulse-performance-sandbox-summary__chev {
  transform: rotate(-90deg);
}

#home-portfolio-embed .pulse-performance-sandbox-body {
  padding: 0 6px 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

body.light-mode #home-portfolio-embed .pulse-performance-sandbox-body {
  border-top-color: rgba(0, 0, 0, 0.06);
}

#home-portfolio-embed .pulse-performance-bar__panels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: stretch;
}

#home-portfolio-embed .pulse-performance-fieldset {
  flex: 1 1 180px;
  min-width: min(100%, 180px);
  margin: 0;
  padding: 4px 6px 5px;
  border-radius: 6px;
  border: 1px solid var(--theme-border-default, rgba(255, 255, 255, 0.09));
  background: rgba(0, 0, 0, 0.14);
}

body.light-mode #home-portfolio-embed .pulse-performance-fieldset {
  background: rgba(255, 255, 255, 0.65);
}

#home-portfolio-embed .pulse-performance-fieldset__legend {
  padding: 0 3px;
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--theme-text-heading, #e8eef8);
}

body.light-mode #home-portfolio-embed .pulse-performance-fieldset__legend {
  color: var(--theme-text-heading, #111827);
}

#home-portfolio-embed .pulse-performance-fieldset__rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#home-portfolio-embed .pulse-performance-opt--row {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  cursor: pointer;
  margin: 0;
  font-size: inherit;
  color: inherit;
}

#home-portfolio-embed .pulse-performance-opt--row input {
  margin-top: 3px;
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  accent-color: var(--theme-accent-primary, #4b9cd3);
}

#home-portfolio-embed .pulse-performance-opt__body {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  flex: 1;
  min-width: 0;
}

#home-portfolio-embed .pulse-performance-opt__body--no-strip {
  padding-left: 0;
}

#home-portfolio-embed .pulse-performance-opt--modifier {
  margin-top: 1px;
  padding-top: 4px;
  border-radius: 0;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
}

body.light-mode #home-portfolio-embed .pulse-performance-opt--modifier {
  border-top-color: rgba(0, 0, 0, 0.07);
}

#home-portfolio-embed .pulse-performance-opt--modifier .pulse-performance-opt__body--no-strip {
  padding-left: calc(12px + 5px + 24px + 5px);
}

#home-portfolio-embed .pulse-performance-opt__main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#home-portfolio-embed .pulse-performance-opt__label {
  font-size: 0.69rem;
  font-weight: 600;
  line-height: 1.18;
  color: var(--theme-text-default, #e5e7eb);
}

body.light-mode #home-portfolio-embed .pulse-performance-opt__label {
  color: var(--theme-text-default, #1f2937);
}

/* Strip swatches beside series labels */
#home-portfolio-embed .pulse-performance-strip {
  flex-shrink: 0;
  width: 24px;
  height: 6px;
  margin-top: 3px;
  border-radius: 2px;
}

#home-portfolio-embed .pulse-performance-strip--solid {
  background: #4b9cd3;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}

#home-portfolio-embed .pulse-performance-strip--items {
  background: repeating-linear-gradient(90deg, #f472b6 0 3px, transparent 3px 6px);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

#home-portfolio-embed .pulse-performance-strip--pins {
  height: 0;
  margin-top: 5px;
  border-radius: 0;
  border-top: 2px dashed #a78bfa;
  background: transparent;
  box-shadow: none;
}

#home-portfolio-embed .pulse-performance-strip--mkts {
  height: 0;
  margin-top: 5px;
  border-radius: 0;
  border-top: 2px dotted #34d399;
  background: transparent;
  box-shadow: none;
}

#home-portfolio-embed .pulse-portfolio-pie-metric-toggle[hidden] {
  display: none !important;
}

#home-portfolio-embed .pulse-portfolio-pie-metric-toggle--overlay {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 4;
  background: rgba(12, 16, 28, 0.68);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(8px);
}

#home-portfolio-embed .pulse-mode-btn {
  margin: 0;
  padding: 4px 9px;
  font-size: 0.71rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--theme-text-panel-subtitle, #8892b0);
  font-family: inherit;
}

#home-portfolio-embed .pulse-mode-btn.is-active {
  background: rgba(75, 156, 211, 0.22);
  color: #e8eef8;
}

@media (max-width: 900px) {
  #home-portfolio-embed .pulse-performance-bar__panels {
    flex-direction: column;
  }

  #home-portfolio-embed .pulse-performance-fieldset {
    min-width: 0;
  }

  #home-portfolio-embed .pulse-portfolio-rail-header-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  #home-portfolio-embed .pulse-portfolio-rail-header-actions {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 10px;
  }

  #home-portfolio-embed .pulse-portfolio-rail-header-actions .pulse-portfolio-mode-toggle {
    width: 100%;
    justify-content: center;
  }
}

#home-portfolio-embed #pulsePortfolioMetricSelectorContainer .metric-selector-group,
#home-portfolio-embed #pulsePortfolioMetricSelectorContainer select {
  max-width: min(200px, 42vw);
}

#home-portfolio-embed .pulse-portfolio-hero-canvas-wrap {
  position: relative;
}

/* Home-style chart loading overlay for My Portfolio hero (non-skeleton spinners only). Skeleton uses same markup as `#homeChartLoading` and `charts.css`. */
#home-portfolio-embed .pulse-portfolio-hero-canvas-wrap .chart-loading-overlay:not(.chart-loading-overlay--skeleton) {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(30, 30, 30, 0.8);
  backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  z-index: 30;
  color: #ccc;
  font-family: inherit;
  font-size: 0.9rem;
}

#home-portfolio-embed .pulse-portfolio-hero-canvas-wrap .chart-loading-overlay:not(.chart-loading-overlay--skeleton) span {
  text-align: center;
  padding: 0 12px;
}

/* Portfolio skeleton overlay: match Home — blur + dim behind the same grid/SVG as `index.html` `#homeChartLoading` */
#home-portfolio-embed .pulse-portfolio-hero-canvas-wrap .chart-loading-overlay.chart-loading-overlay--skeleton {
  background: rgba(30, 30, 30, 0.8);
  backdrop-filter: blur(2px);
  z-index: 30;
}

#home-portfolio-embed .pulse-chart-status {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  padding: 8px 12px;
  font-size: 0.85rem;
  text-align: center;
  max-width: 92%;
  pointer-events: none;
}

#home-portfolio-embed .pulse-portfolio-collections-rail .panel-header,
#home-portfolio-embed .pulse-portfolio-rail-panel-header.panel-header {
  flex-wrap: wrap;
  gap: 8px;
}

#home-portfolio-embed .pulse-portfolio-rail-panel-header.panel-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-shrink: 0;
}

#home-portfolio-embed .pulse-portfolio-rail-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 12px;
  width: 100%;
}

#home-portfolio-embed .pulse-portfolio-rail-heading-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

#home-portfolio-embed .pulse-portfolio-rail-main-heading {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--theme-panel-title-color, #e2e8f0);
}

#home-portfolio-embed .pulse-portfolio-rail-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 10px;
  flex-shrink: 0;
}

#home-portfolio-embed .pulse-portfolio-rail-header-actions .pulse-portfolio-mode-toggle {
  flex-shrink: 0;
}

#home-portfolio-embed .pulse-portfolio-rail-scroll {
  flex: 1 1 0%;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#home-portfolio-embed .pulse-portfolio-rail-view {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
}

#home-portfolio-embed .pulse-portfolio-rail-view[hidden] {
  display: none !important;
}

#home-portfolio-embed .pulse-portfolio-rail-details {
  border-radius: 8px;
  border: 1px solid var(--theme-border-default, rgba(255, 255, 255, 0.12));
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 8px;
}

body.light-mode #home-portfolio-embed .pulse-portfolio-rail-details {
  background: rgba(0, 0, 0, 0.04);
}

#home-portfolio-embed .pulse-portfolio-rail-details__summary {
  cursor: pointer;
  padding: 10px 12px;
  font-weight: 600;
  list-style: none;
}

#home-portfolio-embed .pulse-portfolio-rail-details__summary::-webkit-details-marker {
  display: none;
}

#home-portfolio-embed .pulse-portfolio-rail-details__meta {
  font-weight: 500;
  opacity: 0.75;
  font-size: 0.85em;
}

#home-portfolio-embed .pulse-portfolio-rail-details__body {
  padding: 0 10px 12px;
}

#home-portfolio-embed .pulse-portfolio-products-foot__body.pulse-portfolio-tracked-stack {
  margin-top: 0;
}

#home-portfolio-embed .pulse-portfolio-chart-lines-mount {
  padding: 6px 0 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Products rail lines: match Home watchlist pinned-market-row layout */
#home-portfolio-embed .pulse-portfolio-prod-line-card.pinned-market-row {
  margin: 0;
  margin-bottom: 0;
  cursor: pointer;
}

#home-portfolio-embed .pulse-portfolio-prod-line-card .pinned-row-left {
  gap: 4px;
}

#home-portfolio-embed .pulse-portfolio-prod-line-card .pinned-market-metric.pulse-portfolio-prod-line-card__metric {
  font-family: inherit;
  font-size: 1.2rem;
  line-height: 1.15;
  font-weight: 700;
  color: var(--theme-text-primary, #f4f7fb);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

#home-portfolio-embed .pulse-portfolio-prod-line-card__meta {
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--theme-text-panel-subtitle, #8892b0);
  font-weight: 500;
}

#home-portfolio-embed .pulse-portfolio-prod-line-card__badges {
  margin-top: 2px;
}

#home-portfolio-embed .pulse-portfolio-prod-line-card__badges .data-quality-badges {
  margin-top: 0;
  font-size: 0.65rem;
  gap: 4px;
}

#home-portfolio-embed .pulse-portfolio-prod-line-card .home-default-item-switch {
  flex-shrink: 0;
  width: 48px;
  height: 28px;
}

#home-portfolio-embed .pulse-portfolio-prod-line-card .home-default-item-switch .slider {
  border-radius: 28px;
}

#home-portfolio-embed .pulse-portfolio-prod-line-card .home-default-item-switch .slider:before {
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
}

#home-portfolio-embed .pulse-portfolio-prod-line-card .home-default-item-switch input:checked + .slider:before {
  transform: translateX(20px);
}

#home-portfolio-embed .pulse-portfolio-prod-line-card .pinned-row-right {
  gap: 14px;
}

#home-portfolio-embed .pulse-portfolio-prod-line-card .pinned-change-badge {
  font-size: 1rem;
  padding: 6px 14px;
  border-radius: 6px;
  letter-spacing: -0.3px;
}

#home-portfolio-embed .pulse-portfolio-collections-blurb {
  padding: 0 18px 14px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

#home-portfolio-embed .pulse-portfolio-collections-intro {
  margin: 0 0 12px;
  font-size: 0.82rem;
  line-height: 1.45;
}

#home-portfolio-embed .pulse-portfolio-collections-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#home-portfolio-embed .pulse-portfolio-coll-row,
#home-portfolio-embed .pulse-portfolio-coll-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  margin: 0;
  text-align: left;
  cursor: pointer;
  border-radius: 10px;
  border: 1px solid var(--theme-border-default, rgba(255, 255, 255, 0.1));
  background: rgba(0, 0, 0, 0.18);
  color: inherit;
  font-family: inherit;
  transition: background 0.15s ease;
}

#home-portfolio-embed .pulse-portfolio-coll-row {
  gap: 4px;
  padding: 10px 12px;
}

#home-portfolio-embed .pulse-portfolio-coll-card {
  gap: 8px;
  padding: 12px 14px;
}

#home-portfolio-embed .pulse-portfolio-coll-row:hover,
#home-portfolio-embed .pulse-portfolio-coll-card:hover {
  background: rgba(75, 156, 211, 0.12);
}

#home-portfolio-embed .pulse-portfolio-coll-row__title,
#home-portfolio-embed .pulse-portfolio-coll-card__title {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.25;
}

#home-portfolio-embed .pulse-portfolio-coll-row__meta,
#home-portfolio-embed .pulse-portfolio-coll-card__meta,
#home-portfolio-embed .pulse-portfolio-coll-card__secondary {
  font-size: 0.74rem;
  color: var(--theme-text-panel-subtitle, #8892b0);
}

#home-portfolio-embed .pulse-portfolio-coll-row__meta,
#home-portfolio-embed .pulse-portfolio-coll-card__meta {
  text-transform: capitalize;
}

#home-portfolio-embed .pulse-portfolio-coll-card__top,
#home-portfolio-embed .pulse-portfolio-coll-card__value-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}

#home-portfolio-embed .pulse-portfolio-coll-card__value {
  font-size: 1.05rem;
  line-height: 1.1;
  color: var(--theme-text-primary, #f4f7fb);
}

#home-portfolio-embed .pulse-portfolio-coll-value-source {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

#home-portfolio-embed .pulse-portfolio-coll-value-source--tracked {
  color: #d8f7ff;
  background: rgba(75, 156, 211, 0.24);
}

#home-portfolio-embed .pulse-portfolio-coll-value-source--estimate {
  color: #fff3c4;
  background: rgba(251, 191, 36, 0.2);
}

#home-portfolio-embed .pulse-portfolio-coll-value-source--empty {
  color: var(--theme-text-panel-subtitle, #8892b0);
  background: rgba(255, 255, 255, 0.08);
}

#home-portfolio-embed .pulse-portfolio-coll-pill {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 600;
  vertical-align: middle;
  background: rgba(255, 255, 255, 0.08);
  color: var(--theme-text-caption, #a8b4c8);
}

#home-portfolio-embed .pulse-portfolio-coll-pill--priv {
  opacity: 0.85;
}

#home-portfolio-embed .pulse-portfolio-hero-sub {
  max-width: 42ch;
}

@media (max-width: 900px) {
  #home-portfolio-embed .pulse-portfolio-hero-split.home-split-layout {
    flex-direction: column;
    height: auto;
    max-height: none;
    min-height: 0;
    overflow: visible;
  }

  #home-portfolio-embed .pulse-portfolio-hero-chart-col .chart-container {
    min-height: 280px;
  }

  #home-portfolio-embed .pulse-portfolio-totals-foot {
    grid-template-columns: 1fr;
  }

  #home-portfolio-embed .pulse-portfolio-products-foot {
    grid-template-columns: 1fr;
  }

  #home-portfolio-embed .pulse-portfolio-totals-foot__body,
  #home-portfolio-embed .pulse-portfolio-products-foot__body {
    max-height: min(36vh, 360px);
  }
}

/* My Portfolio — narrow phones: full-width controls, scrollable collections, shorter chart block */
@media (max-width: 600px) {
  #home-portfolio-embed .pulse-portfolio-hero-panel-header--chart .pulse-portfolio-hero-heading {
    font-size: 0.78rem !important;
    line-height: 1.22 !important;
  }

  #home-portfolio-embed .pulse-portfolio-hero-sub {
    max-width: 100%;
  }

  #home-portfolio-embed .pulse-mode-btn {
    padding: 4px 7px;
    font-size: 0.65rem;
  }

  #home-portfolio-embed .pulse-portfolio-hero-chart-col .chart-container,
  #home-portfolio-embed .pulse-portfolio-hero-chart-col .pulse-portfolio-hero-canvas-wrap.chart-container {
    min-height: min(52vw, 260px);
    max-height: min(62vh, 420px);
    padding: 6px 8px;
  }

  /* Narrow phones: single-column tool stack — tighter gap vs global .panel-header { gap:12px } */
  #home-portfolio-embed .pulse-portfolio-hero-panel-header--chart.panel-header {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 8px 10px;
  }

  #home-portfolio-embed .pulse-portfolio-hero-panel-header--chart .pulse-portfolio-hero-panel-actions {
    display: flex;
    flex: 0 1 auto;
    flex-direction: row;
    flex-wrap: nowrap;
    width: 100%;
    align-items: center;
    gap: 8px 10px;
  }

  #home-portfolio-embed .pulse-portfolio-hero-panel-header--chart .pulse-portfolio-hero-panel-actions .legend-wrapper {
    margin-left: 0;
  }

  #home-portfolio-embed #pulsePortfolioMetricSelectorContainer {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
  }

  #home-portfolio-embed .pulse-portfolio-collections-rail.home-pinned-column {
    max-height: min(50vh, 420px);
    min-height: 0;
    overflow: hidden;
  }

  #home-portfolio-embed .pulse-portfolio-collections-blurb {
    padding: 0 12px 12px;
  }

  #home-portfolio-embed .pulse-portfolio-collections-rail .panel-header,
  #home-portfolio-embed .pulse-portfolio-rail-panel-header.panel-header {
    padding: 10px 12px;
  }

  #home-portfolio-embed .pulse-portfolio-pie-metric-toggle--overlay {
    top: 6px;
    right: 6px;
  }

  #home-portfolio-embed .pulse-chart-group-select {
    max-width: 100%;
  }

  #home-portfolio-embed .pulse-tracked-group-name-input {
    max-width: 100%;
  }

  #home-portfolio-embed .pulse-stat-row.pulse-stat-row--portfolio-cards {
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
  }

  #home-portfolio-embed button.pulse-stat--toggle {
    min-width: 0;
    width: 100%;
  }

  #home-portfolio-embed .pulse-tracked-groups-toolbar {
    padding: 8px 10px;
  }

  #home-portfolio-embed .pulse-tracked-groups-toolbar__row {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 420px) {
  #home-portfolio-embed .pulse-portfolio-mode-toggle {
    display: flex;
    width: 100%;
    flex-wrap: nowrap;
  }

  #home-portfolio-embed .pulse-mode-btn {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    padding: 5px 4px;
    font-size: 0.6rem;
  }

  #home-portfolio-embed #pulsePortfolioRangeSelector {
    width: 100%;
    justify-content: flex-start;
  }
}

/* Tracked products — optional custom chart lines (named groups beside categories) */
#home-portfolio-embed .pulse-tracked-groups-toolbar-host {
  margin: 10px 0 14px;
}

#home-portfolio-embed .pulse-tracked-groups-toolbar {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--theme-border-default, rgba(255, 255, 255, 0.1));
  background: var(--theme-profile-panel-bg, rgba(0, 0, 0, 0.22));
}

#home-portfolio-embed .pulse-tracked-groups-toolbar__intro {
  margin: 0 0 8px;
  font-size: 0.82rem;
  line-height: 1.4;
}

#home-portfolio-embed .pulse-tracked-groups-toolbar__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

#home-portfolio-embed .pulse-tracked-group-name-input {
  flex: 1 1 160px;
  min-width: 120px;
  max-width: 280px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--theme-border-default, rgba(255, 255, 255, 0.12));
  background: transparent;
  color: inherit;
  font-family: inherit;
}

#home-portfolio-embed .pulse-tracked-groups-list {
  list-style: none;
  padding: 6px 0 0;
  margin: 6px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#home-portfolio-embed .pulse-tracked-groups-list-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.82rem;
}

#home-portfolio-embed .pulse-tracked-group-remove {
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--theme-text-muted, #a8b4c8);
  font-size: 1.2rem;
  line-height: 1;
  padding: 0 4px;
}

/* Match metric/trends selects; color-scheme + solid fill so the open list isn’t a harsh light panel on Windows/Chromium */
#home-portfolio-embed .pulse-chart-group-select {
  max-width: 11rem;
  width: 100%;
  min-height: 32px;
  padding: 6px 26px 6px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: inherit;
  line-height: 1.25;
  cursor: pointer;
  box-sizing: border-box;
  color-scheme: inherit;
  background-color: var(--theme-bg-metric-select, #1e1e2f);
  color: var(--theme-text-metric-select, #e0e0e0);
  border: 1px solid var(--theme-border-metric-select, #444);
}

#home-portfolio-embed .pulse-chart-group-select:hover {
  background-color: var(--theme-bg-metric-select-hover, #2a2a3f);
  border-color: var(--theme-border-metric-select-hover, #666);
}

#home-portfolio-embed .pulse-chart-group-select:focus {
  outline: none;
  border-color: var(--theme-border-metric-select-hover, #666);
  box-shadow: 0 0 0 2px var(--theme-accent-a25, rgba(75, 156, 211, 0.25));
}

/* Options: limited browser support for the open list, but helps Firefox & some Chromium builds */
#home-portfolio-embed .pulse-chart-group-select option {
  background-color: var(--theme-bg-metric-select, #1e1e2f);
  color: var(--theme-text-metric-select, #e0e0e0);
}

#home-portfolio-embed .pulse-tracked-section-heading {
  margin: 16px 0 8px;
  padding-bottom: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--theme-text-caption, #8b96ab);
  border-bottom: 1px solid var(--theme-border-default, rgba(255, 255, 255, 0.1));
}

#home-portfolio-embed .pulse-tracked-section-heading:first-child {
  margin-top: 0;
}

#home-portfolio-embed .pulse-tracked-section-heading--secondary {
  margin-top: 20px;
  opacity: 0.92;
}

#home-portfolio-embed .pulse-portfolio-group-summary--custom {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

#home-portfolio-embed .pulse-portfolio-group-summary--custom .home-pin-group-card__title-row {
  flex: 1 1 auto;
  min-width: 0;
}

#home-portfolio-embed .pulse-tracked-group-remove-inline {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  margin-left: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--theme-text-muted, #a8b4c8);
  font-size: 1.1rem;
  line-height: 1;
  border-radius: 6px;
}

#home-portfolio-embed .pulse-tracked-group-remove-inline:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--theme-text-primary, #e8eef7);
}

#home-portfolio-embed .pulse-portfolio-group-summary--custom .home-pin-group-card__chev {
  flex-shrink: 0;
  margin-left: 0;
}

.collector-pulse-skin .pulse-mini-table td.pulse-metric--carried {
  color: var(--theme-text-muted, #a8b4c8);
  font-style: italic;
}
