/* ════════════════════════════════════════════════════════
   My Portfolio — Hedge Fund PM Workstation
   All layout, section, and component styles
   ════════════════════════════════════════════════════════ */

/* ── Page wrapper ───────────────────────────────────────── */
.my-portfolio-wrap {
  max-width: 1360px;
  margin: 0 auto;
  padding: 20px 20px 80px;
}

/* ── A. Market Intelligence Strip ───────────────────────── */
.market-intel-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
}
.mis-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .05em;
  white-space: nowrap;
}
.mis-badge-open    { background: rgba(6,214,160,.15);  color: var(--accent); }
.mis-badge-premarket { background: rgba(244,162,97,.15); color: var(--amber); }
.mis-badge-closed  { background: rgba(99,99,102,.15);  color: var(--text3); }
.mis-regime-trending  { background: rgba(6,214,160,.12);  color: var(--accent); }
.mis-regime-mixed     { background: rgba(244,162,97,.12);  color: var(--amber); }
.mis-regime-defensive { background: rgba(230,57,70,.12);   color: var(--red); }
.mis-regime-caution   { background: rgba(230,57,70,.20);   color: var(--red); animation: pulse-border 2s infinite; }
.mis-direction-bullish { background: rgba(6,214,160,.12);  color: var(--accent); }
.mis-direction-bearish { background: rgba(230,57,70,.12);  color: var(--red); }
.mis-direction-neutral { background: rgba(99,99,102,.12);  color: var(--text2); }
.mis-divider {
  width: 1px; height: 16px;
  background: var(--border);
  flex-shrink: 0;
}
.mis-metric {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  white-space: nowrap;
}
.mis-metric-label { color: var(--text3); font-family: var(--font-mono); font-size: 10px; }
.mis-metric-value { color: var(--text); font-weight: 600; font-family: var(--font-mono); }
.mis-model-rate   { margin-left: auto; font-family: var(--font-mono); font-size: 10px;
                    color: var(--text3); white-space: nowrap; }

/* ── B. What Iris Sees Today ────────────────────────────── */
.what-iris-sees {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}
.wis-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  cursor: pointer;
  user-select: none;
}
.wis-head-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  font-family: var(--font-mono);
  letter-spacing: .06em;
}
.wis-chevron { color: var(--text3); font-size: 12px; transition: transform .2s; }
.wis-chevron.open { transform: rotate(180deg); }
.wis-body { padding: 0 16px 16px; display: none; }
.wis-body.open { display: block; }

/* Portfolio narrative — replaces metric snapshot tiles */
.wis-narrative {
  margin-bottom: 12px;
  padding: 14px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.wis-narrative:empty { display: none; }
.wis-narr-lead {
  font-size: var(--fs-sm);
  color: var(--text);
  line-height: 1.6;
  margin: 0 0 10px;
  font-weight: 500;
}
.wis-narr-body {
  font-size: var(--fs-sm);
  color: var(--text2);
  line-height: 1.6;
  margin: 0 0 10px;
}
.wis-narr-body:last-child { margin-bottom: 0; }

/* Broker / account filter row above Portfolio Performance */
.mp-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.mp-filter-label {
  font-size: 11px;
  color: var(--text3);
  font-family: var(--font-mono);
  letter-spacing: .04em;
  flex-shrink: 0;
}

/* Compact urgent alert strip */
.wis-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  background: rgba(230,57,70,0.06);
  border: 1px solid rgba(230,57,70,0.22);
  border-radius: var(--radius);
  margin-bottom: 6px;
}
.wis-alert-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--red);
  background: rgba(230,57,70,0.12);
  padding: 2px 7px;
  border-radius: 3px;
  flex-shrink: 0;
  letter-spacing: .05em;
}
.wis-alert-text {
  font-size: var(--fs-sm);
  color: var(--text);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wis-alert-action {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--red);
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  opacity: .8;
}
.wis-alert-action:hover { opacity: 1; text-decoration: underline; }

/* 3-column compact card grid */
.wis-cards {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
@media (max-width: 900px) { .wis-cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .wis-cards { grid-template-columns: 1fr; } }

/* Individual insight card — tighter padding */
.wis-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-left: 3px solid var(--border);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.wis-card-urgent      { border-left-color: var(--red); }
.wis-card-opportunity { border-left-color: var(--accent); }
.wis-card-signal      { border-left-color: var(--blue); }
.wis-card-context     { border-left-color: var(--text3); }

/* Card header row */
.wis-card-head { display: flex; align-items: flex-start; gap: 8px; }

/* Badge pill */
.wis-card-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 2px 6px;
  border-radius: 3px;
  flex-shrink: 0;
  margin-top: 2px;
}
.wis-card-badge-urgent      { background: rgba(230,57,70,0.12);   color: var(--red); }
.wis-card-badge-opportunity { background: rgba(6,214,160,0.12);   color: var(--accent); }
.wis-card-badge-signal      { background: rgba(72,149,239,0.12);  color: var(--blue); }
.wis-card-badge-context     { background: rgba(150,150,150,0.10); color: var(--text3); }

/* Card title */
.wis-card-title {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

/* Card description */
.wis-card-body {
  font-size: var(--fs-sm);
  color: var(--text2);
  line-height: 1.6;
}

/* Card action link */
.wis-card-action {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  letter-spacing: .04em;
}
.wis-card-action:hover { text-decoration: underline; }

/* ── WIS: new card types ─────────────────────────────────── */
.wis-card-highlight   { border-left-color: var(--accent); }
.wis-card-lowlight    { border-left-color: var(--amber, #f4a261); }
.wis-card-news        { border-left-color: var(--amber, #f4a261); }
.wis-card-geo         { border-left-color: #9b5de5; }
.wis-card-premarket   { border-left-color: var(--blue); }

.wis-card-badge-highlight { background: rgba(6,214,160,.12);  color: var(--accent); }
.wis-card-badge-lowlight  { background: rgba(244,162,97,.13); color: var(--amber, #f4a261); }
.wis-card-badge-news      { background: rgba(244,162,97,.13); color: var(--amber, #f4a261); }
.wis-card-badge-geo       { background: rgba(155,93,229,.12); color: #9b5de5; }
.wis-card-badge-premarket { background: rgba(72,149,239,.13); color: var(--blue); }

/* ── WIS: phase badge in header ──────────────────────────── */
.wis-phase-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 8px;
  vertical-align: middle;
}
.wis-phase-live     { background: rgba(6,214,160,.15);   color: var(--accent); }
.wis-phase-pre      { background: rgba(72,149,239,.13);  color: var(--blue); }
.wis-phase-closed   { background: rgba(150,150,150,.10); color: var(--text3); }

/* ── WIS: portfolio stats pill row ──────────────────────── */
.wis-stats-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.wis-stats-row:empty { display: none; }

.wis-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  white-space: nowrap;
  background: var(--surface2);
  border: 1px solid var(--border);
}
.wis-stat-pill-label   { color: var(--text3); font-weight: 400; }
.wis-stat-pill-pos     { color: var(--accent); }
.wis-stat-pill-neg     { color: var(--red); }
.wis-stat-pill-neutral { color: var(--text2); }

/* ── WIS: position heatmap chip row ─────────────────────── */
.wis-heatmap-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.wis-heatmap-row:empty { display: none; }

.wis-heatmap-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--text3);
  letter-spacing: .07em;
  text-transform: uppercase;
  flex-shrink: 0;
  margin-right: 2px;
}

.wis-pos-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 9px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  white-space: nowrap;
  cursor: default;
  border: 1px solid transparent;
}
.wis-pos-chip-score { font-size: 9px; opacity: .75; }
.wis-pos-chip-dte   { font-size: 9px; font-weight: 700; }

.wis-pos-chip-hot     { background: rgba(6,214,160,.15);   color: var(--accent);            border-color: rgba(6,214,160,.25); }
.wis-pos-chip-warm    { background: rgba(72,149,239,.13);  color: var(--blue);              border-color: rgba(72,149,239,.25); }
.wis-pos-chip-neutral { background: rgba(150,150,150,.10); color: var(--text2);             border-color: var(--border); }
.wis-pos-chip-cold    { background: rgba(244,162,97,.13);  color: var(--amber, #f4a261);    border-color: rgba(244,162,97,.25); }
.wis-pos-chip-risk    { background: rgba(230,57,70,.12);   color: var(--red);               border-color: rgba(230,57,70,.22); }

/* ── Page Header ────────────────────────────────────────── */
.mp-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}
.mp-page-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--text);
  line-height: 1.1;
}
.mp-page-subtitle {
  font-size: 11px;
  color: var(--text3);
  font-family: var(--font-mono);
}
.mp-page-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.mp-settings-btn {
  font-size: 11px;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  transition: border-color .15s, color .15s;
  white-space: nowrap;
}
.mp-settings-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Period filter buttons (Equity Curve) ───────────────── */
.mp-period-btns { display: flex; gap: 4px; }
.mp-period-btn {
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text3);
  cursor: pointer;
  transition: all .15s;
}
.mp-period-btn:hover,
.mp-period-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── C. KPI Bar ─────────────────────────────────────────── */
.mp-kpi-bar {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
@media (max-width: 1000px) { .mp-kpi-bar { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 540px)  { .mp-kpi-bar { grid-template-columns: repeat(2, 1fr); } }
.mp-kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.mp-kpi-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text3);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.mp-kpi-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.mp-kpi-value.positive { color: var(--accent); }
.mp-kpi-value.negative { color: var(--red); }
.mp-kpi-sub {
  font-size: 10px;
  color: var(--text3);
  margin-top: 4px;
}
.mp-kpi-dollar {
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px;
  font-family: var(--font-mono);
}
.mp-kpi-trend {
  font-size: 9px;
  font-family: var(--font-mono);
  margin-top: 3px;
  letter-spacing: .02em;
}

/* ── D. Two-column main grid ────────────────────────────── */
/* Holdings is now full-width; below it sits a 2-col grid */
.mp-holdings-panel { margin-bottom: 14px; }

.mp-below-grid {
  display: grid;
  grid-template-columns: 55fr 45fr;
  gap: 14px;
  margin-bottom: 14px;
  align-items: start;
}
.mp-sector-col  { display: flex; flex-direction: column; gap: 14px; }
.mp-sidebar-col { display: flex; flex-direction: column; gap: 14px; }

/* Refresh button */
.mp-refresh-btn {
  font-size: 11px;
  padding: 3px 10px;
  cursor: pointer;
  background: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text3);
  transition: color .15s, border-color .15s;
}
.mp-refresh-btn:hover { color: var(--text2); border-color: var(--border2); }

/* ── D1. Position Intelligence Panel ───────────────────── */
.position-intelligence-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.pi-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.pi-head-title { font-size: var(--fs-sm); font-weight: 600; }
.pi-head-hint  { font-size: 10px; color: var(--text3); font-family: var(--font-mono); }

/* Holdings card header right-rail: total NAV + refresh button */
.mp-holdings-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.mp-holdings-total {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
}

/* ── Broker Tabs ─────────────────────────────────────────── */
.mp-broker-tabs:empty { display: none; }
.mp-broker-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.mp-broker-tabs::-webkit-scrollbar { display: none; }
.mp-broker-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 10px 16px;
  min-width: max-content;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: border-color .15s;
  gap: 1px;
}
.mp-broker-tab-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text3);
  transition: color .15s;
}
.mp-broker-tab-value {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text3);
  transition: color .15s;
}
.mp-broker-tab:hover .mp-broker-tab-name { color: var(--text); }
.mp-broker-tab.active { border-bottom-color: var(--accent); }
.mp-broker-tab.active .mp-broker-tab-name { color: var(--accent); }
.mp-broker-tab.active .mp-broker-tab-value { color: var(--accent); opacity: .75; }

.pi-table-head {
  display: grid;
  grid-template-columns: 72px 120px 1fr 72px 90px;
  gap: 8px;
  padding: 6px 16px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text3);
  letter-spacing: .06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.position-row {
  display: grid;
  grid-template-columns: 72px 120px 1fr 72px 90px;
  gap: 8px;
  align-items: center;
  padding: 9px 16px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  cursor: pointer;
  transition: background .15s;
}
.position-row:hover { background: var(--bg2); }
.position-row:last-of-type { border-bottom: none; }
.pos-ticker  { font-family: var(--font-mono); font-weight: 600; font-size: 13px; }
.pos-contract { font-family: var(--font-mono); font-size: 11px; color: var(--text2); }
.pos-pnl-positive { color: var(--accent); font-size: 12px; font-weight: 600; }
.pos-pnl-negative { color: var(--red);    font-size: 12px; font-weight: 600; }
.pos-pnl-unknown  { color: var(--text3);  font-size: 11px; }

.signal-bar-wrap {
  width: 100%;
  height: 5px;
  background: var(--surface2);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 2px;
}
.signal-bar-fill { height: 100%; border-radius: 3px; transition: width .4s; }
.signal-bar-fill.strong  { background: var(--accent); }
.signal-bar-fill.good    { background: #52c47a; }
.signal-bar-fill.fair    { background: var(--amber); }
.signal-bar-fill.weak    { background: var(--red); }
.signal-bar-label { font-family: var(--font-mono); font-size: 9px; color: var(--text3); }

/* Review badges */
.review-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
}
.review-expiring { background: rgba(230,57,70,.18);  color: var(--red); }
.review-soon     { background: rgba(244,162,97,.18);  color: var(--amber); }
.review-watching { background: rgba(72,149,239,.15);  color: var(--blue); }
.review-ok       { background: rgba(99,99,102,.12);   color: var(--text3); }

/* Expanded position row */
.pos-row-expanded {
  display: none;
  padding: 10px 16px 14px 88px;
  background: var(--bg2);
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.pos-row-expanded.open { display: block; }
.pos-thesis-text { font-size: 12px; color: var(--text2); line-height: 1.55; margin-bottom: 8px; }
.pos-signals-row { display: flex; flex-wrap: wrap; gap: 6px; }
.pos-signal-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--surface2);
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text2);
}
.pos-signal-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sig-dot-bullish  { background: var(--accent); }
.sig-dot-positive { background: #52c47a; }
.sig-dot-neutral  { background: var(--text3); }
.sig-dot-cautious { background: var(--amber); }
.sig-dot-bearish  { background: var(--red); }

/* No positions state */
.pi-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--text3);
  font-size: var(--fs-sm);
}
.pi-empty strong { display: block; color: var(--text2); margin-bottom: 4px; font-size: var(--fs-base); }

/* ── D2. Watchlist — What to Watch This Week ─────────────── */
.watchlist-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.wl-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.wl-head-title { font-size: var(--fs-sm); font-weight: 600; }
.wl-table-head {
  display: grid;
  grid-template-columns: 60px 60px 1fr 80px;
  gap: 8px;
  padding: 6px 16px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text3);
  letter-spacing: .06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.wl-row {
  display: grid;
  grid-template-columns: 60px 60px 1fr 80px;
  gap: 8px;
  align-items: center;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  cursor: pointer;
  transition: background .15s;
}
.wl-row:hover { background: var(--bg2); }
.wl-row:last-child { border-bottom: none; }
.wl-ticker  { font-family: var(--font-mono); font-weight: 600; font-size: 13px; }
.wl-price   { font-family: var(--font-mono); font-size: 12px; color: var(--text2); }
.wl-setup   { font-size: 11px; color: var(--text2); font-style: italic; line-height: 1.4; }
.wl-catalyst { font-size: 10px; font-family: var(--font-mono); color: var(--text3); }

/* Pending / hidden-note */
.wl-row-pending { opacity: .6; cursor: default; }
.wl-row-pending:hover { background: transparent; }
.wl-pending-label { font-size: 10px; font-style: italic; color: var(--text3); }
.wl-hidden-note {
  padding: 7px 16px;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text3);
  border-top: 1px solid var(--border);
  background: var(--bg2);
  letter-spacing: .02em;
}

/* Watchlist inline detail drawer */
.wl-drawer       { display: none; background: var(--bg2); border-bottom: 1px solid var(--border); }
.wl-drawer-open  { display: block; }
.wl-drawer-inner { padding: 10px 16px 12px; border-left: 3px solid var(--accent); }
.wl-row-active   { background: var(--bg2); }

/* Watchlist quick-add row */
.wl-add-row {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg2);
}
.wl-add-row input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text1);
  outline: none;
  transition: border-color .2s;
}
.wl-add-row input:focus { border-color: var(--accent); }
.wl-add-btn {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 6px;
  width: 32px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1;
  transition: opacity .15s;
}
.wl-add-btn:hover { opacity: .85; }

/* ── D3. Sector Allocation Analysis ─────────────────────── */
.sector-alloc-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.sa-head {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.sa-head-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  font-family: var(--font-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
}
/* Sector allocation — new list format */
.sa-rows { display: flex; flex-direction: column; padding: 12px 16px 4px; }
.sa-row  { padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.04); }
.sa-row:last-child { border-bottom: none; }

.sa-row-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}
.sa-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sa-row-name {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.sa-row-val {
  font-size: 12px;
  color: var(--text3);
  font-family: var(--font-mono);
  margin-right: 8px;
}
.sa-row-pct {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-mono);
  min-width: 44px;
  text-align: right;
}
.sa-bar-track {
  width: 100%;
  height: 5px;
  background: var(--surface2);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}
.sa-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .4s ease;
}
.sa-row-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
}
.sa-row-count { color: var(--text3); font-family: var(--font-mono); }

/* Legacy dot class kept for backward compat */
.sa-legend-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.sa-callouts { display: flex; flex-direction: column; gap: 7px; }
.sa-callout {
  border-radius: 7px;
  padding: 9px 12px;
  font-size: var(--fs-sm);
  line-height: 1.5;
}
.sa-callout-critical {
  background: rgba(230,57,70,0.08);
  border: 1px solid rgba(230,57,70,0.22);
}
.sa-callout-warn {
  background: rgba(244,162,97,0.08);
  border: 1px solid rgba(244,162,97,0.20);
}
.sa-callout-ok {
  background: rgba(6,214,160,0.06);
  border: 1px solid rgba(6,214,160,0.18);
}
.sa-callout-title {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 3px;
}
.sa-callout-critical .sa-callout-title { color: var(--red); }
.sa-callout-warn     .sa-callout-title { color: var(--amber); }
.sa-callout-ok       .sa-callout-title { color: var(--accent); }
.sa-callout-body { color: var(--text2); }

/* Indicator rows (Diversification + Options Exposure moved from health row) */
.sa-indicators {
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0;
}
.sa-indicator-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.sa-indicator-row:last-child { border-bottom: none; }
.sa-indicator-left { flex: 1; min-width: 0; }
.sa-indicator-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 3px;
}
.sa-indicator-value {
  font-size: 13px;
  font-weight: 600;
}
.sa-indicator-sub {
  font-size: 10px;
  color: var(--text3);
  margin-top: 3px;
  line-height: 1.4;
}
.sa-indicator-score {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  flex-shrink: 0;
  opacity: .85;
}

/* Bias badge */
.bias-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 12px;
  font-size: 9px;
  font-family: var(--font-mono);
  font-weight: 600;
}
.bias-bullish { background: rgba(6,214,160,.12);  color: var(--accent); }
.bias-positive { background: rgba(82,196,122,.12); color: #52c47a; }
.bias-neutral { background: rgba(99,99,102,.12);  color: var(--text3); }
.bias-cautious { background: rgba(244,162,97,.12); color: var(--amber); }
.bias-bearish { background: rgba(230,57,70,.12);  color: var(--red); }

/* ── E. Ask Iris — Portfolio Mode ───────────────────────── */
.mp-ask-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

/* ── F. Catalyst Timeline ────────────────────────────────── */
.catalyst-timeline {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  flex: 1;
}
.cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 8px;
}
.cat-head-title { font-size: var(--fs-sm); font-weight: 600; }
.cat-toggle-row { display: flex; gap: 4px; }
.cat-toggle-btn {
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 3px 10px;
  border-radius: 12px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text3);
  cursor: pointer;
  transition: all .15s;
}
.cat-toggle-btn:hover { color: var(--text2); border-color: var(--border2); }
.cat-toggle-btn.active { background: var(--surface2); color: var(--text); border-color: var(--border2); }
.catalyst-list { display: flex; flex-direction: column; }
.catalyst-item {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.catalyst-item:last-child { border-bottom: none; }
.catalyst-item.hidden { display: none; }
.cat-dte {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  padding-top: 2px;
}
.cat-dte.urgent   { color: var(--red); }
.cat-dte.soon     { color: var(--amber); }
.cat-dte.upcoming { color: var(--text2); }
.cat-body { flex: 1; }
.cat-event { font-size: 12px; font-weight: 500; margin-bottom: 2px; }
.cat-why { font-size: 11px; color: var(--text3); font-style: italic; line-height: 1.4; }
.cat-impact-pill {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  align-self: flex-start;
}
.impact-high   { background: rgba(230,57,70,.15);  color: var(--red); }
.impact-medium { background: rgba(244,162,97,.15);  color: var(--amber); }
.impact-low    { background: rgba(99,99,102,.12);   color: var(--text3); }
.cat-empty { padding: 20px 16px; text-align: center; color: var(--text3); font-size: 12px; }

/* ── G. Portfolio Health Row ─────────────────────────────── */
.portfolio-health-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.health-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.health-card-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text3);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.health-card-value {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  line-height: 1.2;
}
.health-card-sub { font-size: 10px; color: var(--text3); line-height: 1.4; }

/* Sector mini bars */
.sector-bars { display: flex; flex-direction: column; gap: 4px; }
.sector-bar-row { display: flex; align-items: center; gap: 6px; font-size: 10px; }
.sector-bar-label { width: 64px; color: var(--text2); font-family: var(--font-mono);
                    font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sector-bar-track { flex: 1; height: 4px; background: var(--surface2); border-radius: 2px; overflow: hidden; }
.sector-bar-fill  { height: 100%; border-radius: 2px; background: var(--accent); transition: width .4s; }
.sector-bar-fill.warn { background: var(--amber); }
.sector-bar-fill.over { background: var(--red); }
.sector-bar-pct { width: 28px; text-align: right; color: var(--text3); font-family: var(--font-mono); font-size: 9px; }

/* Model status dot */
.model-status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.model-status-dot.full       { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.model-status-dot.selective  { background: #52c47a; }
.model-status-dot.cautious   { background: var(--amber); }
.model-status-dot.defensive  { background: var(--red); animation: pulse-border 1.5s infinite; }

/* HWM bar */
.hwm-track { width: 100%; height: 6px; background: var(--surface2); border-radius: 3px;
             overflow: hidden; margin: 6px 0 4px; }
.hwm-fill  { height: 100%; border-radius: 3px; background: var(--accent); transition: width .4s; }

/* ── H. Equity Curve Section ─────────────────────────────── */
.mp-equity-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.mp-equity-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.mp-equity-title { font-size: var(--fs-sm); font-weight: 600; }
.mp-equity-hint  { font-size: 10px; color: var(--text3); font-family: var(--font-mono); }
.mp-equity-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
}
.mp-equity-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--surface2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2398989D' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E") no-repeat right 10px center;
  background-size: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 28px 5px 10px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s;
  min-width: 130px;
  max-width: 200px;
}
.mp-equity-select:hover { border-color: var(--border2); }
.mp-equity-select:focus { outline: none; border-color: var(--accent); }
[data-theme="light"] .mp-equity-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%236E6E73' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
}
.mp-equity-legend {
  display: flex;
  gap: 16px;
  margin-bottom: 10px;
}
.mp-equity-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--text3);
}
.mp-equity-legend-item::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 2px;
  border-radius: 1px;
}
.mp-equity-legend-portfolio::before { background: #4895EF; }
.mp-equity-legend-spy::before {
  background: transparent;
  border-top: 2px dashed #636366;
  height: 0;
}
.mp-equity-chart-wrap { position: relative; height: 240px; }
.mp-equity-chips {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 14px;
}
.mp-chip { text-align: center; }
.mp-chip-label { font-family: var(--font-mono); font-size: 9px; color: var(--text3);
                 text-transform: uppercase; letter-spacing: .06em; margin-bottom: 3px; }
.mp-chip-value { font-size: 15px; font-weight: 600; }
.mp-chip-sub   { font-size: 9px; color: var(--text3); margin-top: 2px; font-family: var(--font-mono); }

/* ── Earnings & Projections sub-tabs ─────────────────────── */
.ep-tab-nav {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-wrap: nowrap;
}
.ep-tab-nav::-webkit-scrollbar { display: none; }
.ep-tab-btn {
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: none;
  border: 1px solid transparent;
  border-bottom: none;
  color: var(--text2);
  cursor: pointer;
  position: relative;
  bottom: -1px;
  transition: all .2s;
}
.ep-tab-btn:hover { color: var(--text); }
.ep-tab-btn.active {
  background: var(--surface);
  border-color: var(--border);
  border-bottom-color: var(--surface);
  color: var(--text);
}
.ep-tab-content { display: none; }
.ep-tab-content.active { display: block; }

/* ── D1. Holdings — account cards ────────────────────────── */
.mp-account-card { border-bottom: 1px solid var(--border); }
.mp-account-card:last-child { border-bottom: none; }

/* Full-width toggle button — 48px min-height for Apple HIG touch compliance */
.mp-account-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  min-height: 48px;
  background: var(--bg2);
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background .15s;
}
.mp-account-toggle:hover { background: var(--surface2); }

.mp-account-toggle-info { flex: 1; min-width: 0; }
.mp-account-toggle-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mp-account-toggle-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  flex-wrap: wrap;
}

/* Right side: NAV + day P&L */
.mp-account-toggle-values { text-align: right; flex-shrink: 0; }
.mp-account-nav {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.mp-account-daychg {
  font-family: var(--font-mono);
  font-size: 10px;
  margin-top: 1px;
}

/* Chevron — rotates -90deg when account collapsed */
.mp-account-chevron {
  font-size: 10px;
  color: var(--text3);
  transition: transform .2s ease;
  flex-shrink: 0;
}
.mp-account-card.collapsed .mp-account-chevron { transform: rotate(-90deg); }

/* Animated accordion body */
.mp-account-body {
  overflow: hidden;
  max-height: 3000px;
  transition: max-height .3s ease;
}
.mp-account-card.collapsed .mp-account-body { max-height: 0; }

/* Backwards-compat alias for old .mp-account-block references */
.mp-account-block { border-bottom: 1px solid var(--border); }
.mp-account-block:last-child { border-bottom: none; }
.mp-account-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.mp-acct-tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  font-family: var(--font-mono);
}
.mp-acct-synced { background: rgba(72,149,239,.15); color: var(--blue); }
.mp-acct-manual { background: var(--surface2); color: var(--text3); }

/* Section sub-headers — flex so count badge floats right */
.mp-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 16px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.mp-section-count { font-weight: 400; opacity: .65; }
.mp-section-opts { background: rgba(201,166,58,.06); color: var(--amber); }
.mp-section-stk  { background: rgba(6,214,160,.06);  color: var(--accent); }

/* Direction tags */
.mp-dir-tag {
  display: inline-block;
  font-size: 9px;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  flex-shrink: 0;
}
.mp-dir-short { background: rgba(230,57,70,.15); color: var(--red); }
.mp-dir-long  { background: rgba(6,214,160,.12); color: var(--accent); }

/* Health score chip */
.mp-hs-chip {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: 6px;
  vertical-align: middle;
}

/* Option rows */
.mp-opt-row {
  padding: 10px 16px;
  min-height: 44px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  transition: background .15s;
}
.mp-opt-row.mp-expandable { cursor: pointer; }
.mp-opt-row.mp-expandable:hover { background: var(--bg2); }
.mp-opt-row:last-of-type { border-bottom: none; }

.mp-opt-main {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.mp-opt-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
  flex: 1;
  min-width: 0;
}
.mp-opt-qty { font-size: 11px; color: var(--text3); font-family: var(--font-mono); white-space: nowrap; }

.mp-opt-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.mp-opt-sig { min-width: 80px; }

.mp-expand-chevron {
  font-size: 10px;
  color: var(--text3);
  transition: transform .2s;
  margin-left: auto;
}
.mp-expand-chevron.open { transform: rotate(180deg); }

.mp-opt-expanded {
  display: none;
  padding: 8px 16px 12px 16px;
  background: var(--bg2);
  border-top: 1px solid rgba(255,255,255,.04);
}
.mp-opt-expanded.open { display: block; }

/* Stock rows */
.mp-stock-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  min-height: 44px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  gap: 12px;
}
.mp-stock-row:last-child { border-bottom: none; }
.mp-stock-left { flex: 1; min-width: 0; }
.mp-stock-right { text-align: right; flex-shrink: 0; }
.mp-stock-row-2col {
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  padding: 9px 12px;
  min-height: unset;
}
.mp-stock-ticker { font-family: var(--font-mono); font-weight: 600; font-size: 13px; color: var(--text); margin-right: 6px; }
.mp-stock-shares { font-family: var(--font-mono); font-size: 11px; color: var(--text3); }
.mp-stock-badges { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }

/* Shared colour helpers */
.mp-pos { color: var(--accent); font-weight: 600; }
.mp-neg { color: var(--red);    font-weight: 600; }
.mp-dim { color: var(--text3); }

/* ── Holdings Table ─────────────────────────────────────── */
.mp-holdings-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}
.mp-holdings-meta {
  font-size: 11px;
  color: var(--text3);
  margin-top: 3px;
  font-family: var(--font-mono);
}
.mp-holdings-search-wrap { position: relative; }
.mp-holdings-search-wrap::before {
  content: '⌕';
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--text3);
  pointer-events: none;
}
.mp-holdings-search {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px 5px 28px;
  font-size: 11px;
  color: var(--text);
  width: 190px;
  outline: none;
  transition: border-color .15s, width .2s;
}
.mp-holdings-search::placeholder { color: var(--text3); }
.mp-holdings-search:focus { border-color: var(--accent); width: 230px; }

/* Table base */
.ht-table { width: 100%; border-collapse: collapse; }
.ht-th {
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text3);
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
}
.ht-th.ht-right { text-align: right; }
.ht-sort {
  cursor: pointer;
  opacity: .5;
  font-size: 10px;
  transition: opacity .15s;
  margin-left: 3px;
}
.ht-sort:hover { opacity: 1; }
.ht-sort-active { opacity: 1; color: var(--accent); }
.ht-td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  vertical-align: middle;
}
[data-theme="light"] .ht-td { border-bottom-color: rgba(0,0,0,.06); }
.ht-td.ht-right { text-align: right; }
.ht-row:last-child .ht-td { border-bottom: none; }
.ht-row:hover .ht-td { background: var(--bg2); }

/* Ticker cell */
.ht-ticker-cell { display: flex; align-items: center; gap: 10px; }

/* Type badge — replaces plain letter avatar */
.ht-avatar {
  width: 36px;
  height: 22px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--font-mono);
}
.ht-badge-stk { background: rgba(6,214,160,.15);   color: var(--accent); }
.ht-badge-etf { background: rgba(72,149,239,.15);  color: var(--blue); }
.ht-badge-cry { background: rgba(199,146,234,.15); color: #c792ea; }
.ht-badge-opt { background: rgba(244,162,97,.15);  color: var(--amber); }

.ht-ticker-info { min-width: 0; }
.ht-ticker-label {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  transition: color .15s;
}
.ht-ticker-label:hover { color: var(--accent); }
.ht-ticker-name {
  font-size: 10px;
  color: var(--text3);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

/* Broker chip */
.ht-broker-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-mono);
  white-space: nowrap;
  letter-spacing: .02em;
}
.ht-broker-ibkr          { background: rgba(220,53,69,.15);   color: #e05a5a; }
.ht-broker-robinhood     { background: rgba(6,214,160,.15);   color: var(--accent); }
.ht-broker-fidelity      { background: rgba(49,168,107,.15);  color: #31a86b; }
.ht-broker-schwab        { background: rgba(72,149,239,.15);  color: var(--blue); }
.ht-broker-td-ameritrade { background: rgba(72,149,239,.15);  color: var(--blue); }
.ht-broker-webull        { background: rgba(199,146,234,.15); color: #c792ea; }
.ht-broker-snaptrade     { background: rgba(244,162,97,.15);  color: var(--amber); }
.ht-broker-manual        { background: rgba(255,255,255,.07); color: var(--text3); }
.ht-broker-unknown       { background: rgba(255,255,255,.07); color: var(--text2); }

/* Account label */
.ht-acct-label {
  font-size: 11px;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
  display: block;
  font-family: var(--font-mono);
}

/* Day P&L */
.ht-pnl { font-family: var(--font-mono); line-height: 1.3; }
.ht-pnl-d { font-size: 13px; font-weight: 600; }
.ht-pnl-p { font-size: 10px; opacity: .8; margin-top: 1px; }

/* Signal */
.ht-signal-cell { display: flex; align-items: center; gap: 8px; position: relative; }
.ht-signal-bar-wrap {
  flex: 1;
  height: 4px;
  background: var(--surface2);
  border-radius: 2px;
  overflow: hidden;
  min-width: 40px;
  max-width: 70px;
}
.ht-signal-bar { height: 100%; border-radius: 2px; transition: width .3s; }
.ht-signal-score {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  min-width: 28px;
}

/* Signal tooltip */
.ht-signal-tip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 9px 12px;
  font-size: 11px;
  color: var(--text2);
  white-space: nowrap;
  z-index: 30;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,.35);
  line-height: 1.6;
}
.ht-signal-cell:hover .ht-signal-tip { display: block; }

.ht-whale-badge {
  font-size: 13px;
  cursor: default;
  margin-left: 4px;
  vertical-align: middle;
  opacity: .85;
  transition: opacity .15s;
}
.ht-whale-badge:hover { opacity: 1; }
.ht-whale-label { font-size: 10px; font-weight: 600; letter-spacing: .02em; vertical-align: middle; }

/* Pagination footer */
.ht-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 8px;
}
.ht-page-info {
  font-size: 11px;
  color: var(--text3);
  font-family: var(--font-mono);
}
.ht-page-btns { display: flex; gap: 6px; }
.ht-page-btn {
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.ht-page-btn:hover:not([disabled]) { border-color: var(--accent); color: var(--accent); }
.ht-page-btn[disabled] { opacity: .35; cursor: default; }

/* ── Utilities / animations ──────────────────────────────── */
@keyframes pulse-border {
  0%, 100% { opacity: 1; }
  50%       { opacity: .5; }
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 960px) {
  /* Stack below-holdings grid to single column on tablet/mobile */
  .mp-below-grid { grid-template-columns: 1fr; }
  .mp-sector-col  { order: 2; }
  .mp-sidebar-col { order: 1; }
}
@media (max-width: 680px) {
  .my-portfolio-wrap   { padding: 12px 12px 80px; }
  .mp-kpi-bar          { grid-template-columns: repeat(2, 1fr); }
  .portfolio-health-row { grid-template-columns: repeat(2, 1fr); }
  .mp-equity-chips     { grid-template-columns: repeat(2, 1fr); }
  .pi-table-head,
  .position-row        { grid-template-columns: 64px 100px 1fr 80px; }
  .pi-table-head > :nth-child(4),
  .position-row > :nth-child(4) { display: none; }
  .wl-table-head,
  .wl-row              { grid-template-columns: 56px 1fr 72px; }
  .wl-table-head > :nth-child(2),
  .wl-row > :nth-child(2) { display: none; }
}
/* ≤ 480px: collapse signal bar to a colored dot to save row width */
@media (max-width: 480px) {
  .mp-opt-sig .signal-bar-wrap { display: none; }
  .mp-opt-sig {
    display: flex;
    align-items: center;
    gap: 4px;
  }
  .mp-account-toggle-name { font-size: 12px; }
  .mp-account-nav { font-size: 12px; }
}

/* ── Holdings table — tablet/mobile ─────────────────────── */

/* Scrollable wrapper (tablet: table scrolls if viewport very narrow) */
.ht-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Tablet (≤ 900px): tighten cell padding so 7 cols fit */
@media (max-width: 900px) {
  .ht-th { padding: 7px 8px; }
  .ht-td { padding: 8px 8px; }
  .ht-signal-bar-wrap { min-width: 28px; max-width: 52px; }
  .ht-ticker-name { max-width: 110px; }
}

/* Phone (≤ 600px): card layout — each row becomes a 2-line card */
@media (max-width: 600px) {
  /* Holdings header: stack title above search+refresh */
  .mp-holdings-header { flex-direction: column; align-items: stretch; gap: 10px; }
  .mp-holdings-header-right { width: 100%; justify-content: space-between; }
  .mp-holdings-search { width: 0; flex: 1; min-width: 0; }
  .mp-holdings-search:focus { width: 0; }

  /* Broker tabs: shrink text slightly */
  .mp-broker-tab-name  { font-size: 12px; }
  .mp-broker-tab-value { font-size: 10px; }

  /* Hide column headers */
  .ht-table thead { display: none; }

  /* Block-flow table so rows stack as cards */
  .ht-table,
  .ht-table tbody { display: block; }

  /* Each row = 2-line card */
  .ht-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    gap: 0;
  }
  [data-theme="light"] .ht-row { border-bottom-color: rgba(0,0,0,.07); }
  .ht-row:last-child { border-bottom: none; }
  .ht-row:hover { background: var(--bg2); }
  .ht-row:hover .ht-td { background: transparent; }

  /* Line 1 — left: TICKER (col 1) */
  .ht-td:nth-child(1) {
    order: 1;
    flex: 1 1 0;
    min-width: 0;
    padding: 0 8px 8px 0;
  }
  /* Line 1 — right: VALUE (col 6) */
  .ht-td:nth-child(6) {
    order: 2;
    flex: 0 0 auto;
    padding: 0 0 8px 0;
    text-align: right;
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
  }
  /* Line 2 — left: SIGNAL (col 3) */
  .ht-td:nth-child(3) {
    order: 3;
    flex: 1 1 0;
    min-width: 0;
    padding: 0 8px 0 0;
  }
  /* Line 2 — right: DAY P&L (col 2) */
  .ht-td:nth-child(2) {
    order: 4;
    flex: 0 0 auto;
    padding: 0;
    text-align: right;
  }
  /* Hidden on mobile: QTY (4), PRICE (5), ACCOUNT (7) */
  .ht-td:nth-child(4),
  .ht-td:nth-child(5),
  .ht-td:nth-child(7) { display: none !important; }

  /* Shorter signal bar on mobile */
  .ht-signal-bar-wrap { min-width: 28px; max-width: 48px; }

  /* Tooltip: anchor right so it doesn't clip viewport edge */
  .ht-signal-tip {
    left: auto;
    right: 0;
    white-space: normal;
    width: 190px;
  }

  /* Pagination: full-width on mobile */
  .ht-footer { flex-direction: column; align-items: flex-start; gap: 10px; }
  .ht-page-btns { width: 100%; justify-content: space-between; }
  .ht-page-btn { flex: 1; text-align: center; padding: 8px 12px; }
}

/* ── Whale Signals Section ───────────────────────────────── */
.mp-whale-section {
  margin-top: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.mp-whale-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 14px 20px 10px;
  border-bottom: 1px solid var(--border);
}

.mp-whale-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text1);
}

.mp-whale-hint {
  font-size: 11px;
  color: var(--text3);
}

.mp-whale-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 20px;
}

.mp-whale-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  min-width: 200px;
  flex: 1 1 200px;
  max-width: 340px;
}

.mp-whale-ticker {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
  letter-spacing: 0.4px;
}

.mp-whale-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.mp-whale-row:last-child {
  margin-bottom: 0;
}

.mp-whale-icon {
  font-size: 16px;
  line-height: 1.3;
  flex-shrink: 0;
}

.mp-whale-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mp-whale-label {
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.mp-whale-val {
  font-size: 12px;
  color: var(--text1);
  font-weight: 500;
  line-height: 1.4;
}

.mp-whale-strength {
  color: var(--green);
  font-weight: 600;
  font-size: 10px;
}

.mp-whale-names {
  font-size: 10px;
  color: var(--text3);
  font-style: italic;
}

@media (max-width: 680px) {
  .mp-whale-cards { gap: 8px; padding: 12px; }
  .mp-whale-card  { max-width: 100%; }
}

/* ── Add Position Button (holdings header) ───────────────────── */
.mp-add-btn {
  font-size: 11px;
  padding: 3px 10px;
  cursor: pointer;
  background: var(--accent, #6c63ff);
  border: 1px solid var(--accent, #6c63ff);
  border-radius: 12px;
  color: #fff;
  font-weight: 600;
  transition: opacity .15s;
  white-space: nowrap;
}
.mp-add-btn:hover { opacity: .85; }

/* ── Manual Position Action Buttons (holdings table rows) ─────── */
.ht-actions {
  display: flex;
  gap: 5px;
  align-items: center;
}

.ht-action-btn {
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}

.ht-action-btn:hover { background: var(--surface3, var(--bg2)); color: var(--text1); }

.ht-close-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.ht-delete-btn:hover {
  border-color: var(--red);
  color: var(--red);
}

@media (max-width: 680px) {
  .ht-actions { flex-direction: column; gap: 3px; }
  .ht-action-btn { font-size: 10px; padding: 2px 6px; }
}
