/* =====================================================
   Portzo — Explore (AUDITED & CONSOLIDATED)
   ===================================================== */

/* ==============================
   PORTZO BRAND SEMANTICS
   ============================== */

:root {
  /* Focus & intent (NOT success) */
  --pz-focus: #3f8f6f;              /* existing Portzo green */
  --pz-focus-soft: rgba(63,143,111,0.12);

  /* Neutral ink */
  --pz-ink-primary: #0f172a;
  --pz-ink-secondary: #667085;
  --pz-ink-muted: #94a3b8;

  /* Contrast (NOT bad) */
  --pz-contrast: #b56b5a;
  --pz-contrast-soft: rgba(181,107,90,0.16);

  /* Surfaces */
  --pz-surface: #ffffff;
  --pz-surface-alt: #f8fafc;
  --pz-border: rgba(16,24,40,.12);
}



/* ==============================
   BASE LAYOUT
   ============================== */

#exploreApp {
  margin-top: 12px;
  background: #ffffff;
}

#compare,
#chartWrap,
#compareTableWrap {
  overflow-anchor: none;
}

#explore {
  scroll-margin-top: 120px; /* tune */
  background: #ffffff;
}

.exploreSeoIntro {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.exploreBootShell {
  max-width: 1120px;
  margin: 0 auto;
}

.exploreBootHeader {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.exploreBootLine,
.exploreBootSearch,
.exploreBootToolbar span,
.exploreBootChart {
  display: block;
  border-radius: 999px;
  background: linear-gradient(90deg, #eef3f1 0%, #f8fafc 46%, #eef3f1 100%);
  background-size: 220% 100%;
  animation: exploreBootSheen 1.15s ease-in-out infinite;
}

.exploreBootLineTitle {
  width: min(420px, 72vw);
  height: 28px;
}

.exploreBootLineText {
  width: min(310px, 58vw);
  height: 16px;
  margin-top: 12px;
}

.exploreBootSearch {
  width: min(340px, 34vw);
  height: 46px;
  flex: 0 0 auto;
}

.exploreBootCard {
  min-height: 420px;
  padding: 24px;
  border: 1px solid rgba(16,24,40,.08);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 10px 32px rgba(16,24,40,.05);
}

.exploreBootToolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.exploreBootToolbar span {
  width: 118px;
  height: 42px;
}

.exploreBootToolbar span:first-child {
  width: 170px;
}

.exploreBootChart {
  height: 310px;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(16,24,40,.04) 1px, transparent 1px),
    linear-gradient(90deg, #eef3f1 0%, #f8fafc 46%, #eef3f1 100%);
  background-size: 100% 62px, 220% 100%;
}

@keyframes exploreBootSheen {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

#centerColumn {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  gap: 18px; /* more breathing room between cards */
}


.card {
  background: rgba(255,255,255,0.85);
  border: 1px solid var(--ui-border-subtle, rgba(16,24,40,.08));
  border-radius: var(--ui-radius-lg, 16px);
  padding: 18px 20px; /* 🔑 gives Insights proper body spacing */
  box-shadow: var(--ui-shadow-sm, 0 2px 6px rgba(16,24,40,.04));
}


.hidden {
  display: none !important;
}

/* ==============================
   EXPLORE HEADER + SEARCH
   ============================== */

.exploreHeaderRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 12px;
  position: relative;
  z-index: 70;
  overflow: visible;
}

.exploreHeaderText h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
}

.exploreHeaderText p {
  margin: 6px 0 0;
  font-size: 14px;
  color: #667085;
}

.exploreHeaderText h1,
.exploreHeaderText p {
  caret-color: transparent;
}

/* Compare search */

.compareSearchWrap {
  position: relative;
  width: 340px;
  flex-shrink: 0;
  z-index: 90;
}

#compareSearchInput {
  width: 100%;
  height: var(--ui-control-h-lg, 44px);
  border-radius: var(--ui-radius-pill, 999px);
  border: 1px solid var(--ui-border-default, rgba(16,24,40,.12));
  padding: 0 44px 0 18px;
  font-size: 15px;
  background: #ffffff;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

#compareSearchInput::placeholder {
  color: #98a2b3;
}

#compareSearchInput:focus {
  outline: none;
  border-color: rgba(79,174,143,.6);
  box-shadow:
    0 0 0 3px rgba(79,174,143,.15),
    0 2px 6px rgba(79,174,143,.10);
}

.compareAddIcon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 40px;
  font-weight: 600;
  color: #4FAE8F;
  line-height: 1;
  pointer-events: none;
  opacity: 0.9;
}

.compareSearchResults {
  position: fixed;
  top: 0;
  left: 0;
  width: 340px;
  background: #ffffff;
  border-radius: var(--ui-radius-md, 12px);
  border: 1px solid var(--ui-border-default, rgba(16,24,40,.12));
  box-shadow: var(--ui-shadow-lg, 0 18px 45px rgba(16,24,40,.12));
  max-height: 320px;
  overflow-y: auto;
  z-index: 1000;
}

.compareSearchFilterBar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  gap: 6px;
  padding: 10px 12px 8px;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.94));
  border-bottom: 1px solid rgba(16,24,40,.06);
  overflow-x: auto;
  scrollbar-width: none;
}

.compareSearchFilterBar::-webkit-scrollbar {
  display: none;
}

.compareSearchFilterPill {
  appearance: none;
  border: 1px solid rgba(16,24,40,.08);
  background: rgba(248,250,252,.92);
  color: #475467;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .01em;
  white-space: nowrap;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}

.compareSearchFilterPill:hover {
  border-color: rgba(63,143,111,0.16);
  background: rgba(63,143,111,0.06);
  color: #356f58;
}

.compareSearchFilterPill.is-active {
  border-color: rgba(63,143,111,0.18);
  background: rgba(63,143,111,0.10);
  color: #356f58;
  box-shadow: inset 0 0 0 1px rgba(63,143,111,0.06);
}

.compareSearchItem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 14px;
}

.compareSearchCopy {
  min-width: 0;
}

.compareSearchItem strong {
  display: block;
  font-weight: 600;
  line-height: 1.35;
}

.compareSearchMeta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  min-width: 0;
}

.compareSearchMeta .provider {
  min-width: 0;
  color: #667085;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compareSearchTypePill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(63,143,111,0.18);
  background: rgba(63,143,111,0.08);
  color: #356f58;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.compareSearchAddBtn {
  appearance: none;
  flex: 0 0 auto;
  border: 1px solid rgba(63,143,111,0.18);
  border-radius: 999px;
  background: rgba(63,143,111,0.08);
  color: #356f58;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.compareSearchAddBtn:hover {
  background: rgba(63,143,111,0.14);
}

.compareSearchAddBtn:disabled {
  cursor: default;
}

.compareSearchItem:hover {
  background: rgba(63,143,111,0.06);
}

.compareSearchItem.selected {
  opacity: 0.45;
  pointer-events: none;
}

.comparePortfolioAction {
  color: #356f58;
}

.comparePortfolioAction.is-loading {
  opacity: 0.7;
}

.comparePortfolioFunds .compareSearchItem {
  padding-left: 28px;
}

.comparePortfolioFunds .compareSearchItem strong {
  font-weight: 500;
}

/* ==============================
   UNIFIED COMPARE CARD
   ============================== */

.compareCard.unifiedCompare {
  padding: 0;
  overflow: visible;
  background: #ffffff;
  border: 1px solid var(--ui-border-subtle, rgba(16,24,40,.08));
  box-shadow: var(--ui-shadow-md, 0 10px 28px rgba(16,24,40,0.06));
  border-radius: var(--ui-radius-xl, 20px);
  margin-top: 12px;
  display: block;
  position: relative;
  z-index: 20;
  isolation: isolate;
}

.exploreLoadingOverlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(1px);
  pointer-events: none;
}

.exploreLoadingOverlay img {
  width: 72px;
  height: 72px;
  opacity: 0.5;
  animation: exploreLoaderFloat 1.35s ease-in-out infinite;
  transform-origin: center;
  filter: drop-shadow(0 4px 10px rgba(27, 94, 32, 0.14));
}

@keyframes exploreLoaderFloat {
  0% { transform: translateY(0) scale(0.98); }
  50% { transform: translateY(-4px) scale(1.02); }
  100% { transform: translateY(0) scale(0.98); }
}

.compareLimitNotice {
  position: absolute;
  left: 50%;
  top: 18%;
  transform: translate(-50%, -50%);
  z-index: 7;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(236, 247, 242, 0.97);
  border: 1px solid rgba(63,143,111,0.42);
  box-shadow: 0 12px 24px rgba(63,143,111,0.2);
  color: #245746;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  max-width: min(92%, 440px);
  pointer-events: auto;
  cursor: pointer;
}

/* ==============================
   TOOLBAR
   ============================== */

.exploreToolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 18px 20px 14px;
  background: transparent;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  flex-wrap: nowrap;
  position: relative;
  z-index: 6;
}

.toolbarLeft {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  flex-wrap: nowrap;
}

.toolbarRight {
  display: flex;
  align-items: center;
  margin-left: auto;
  gap: 8px;
  flex-wrap: nowrap;
}


/* ==============================
   FILTER / RANGE PILLS
   ============================== */

.filterPill,
.rangePill {
  border: 0;
  background: rgba(16,24,40,0.035);
    padding: 6px 14px;
  height: 32px;
  font-size: 13px;
  font-weight: 500;
  color: #667085;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background var(--motion-fast, 140ms) var(--motion-ease, ease),
    color var(--motion-fast, 140ms) var(--motion-ease, ease),
    box-shadow var(--motion-fast, 140ms) var(--motion-ease, ease),
    transform var(--motion-fast, 140ms) var(--motion-ease, ease);
}

.filterPill:hover,
.rangePill:hover {
  background: rgba(255,255,255,0.75);
  color: #101828;
}

.filterPill.active,
.rangePill.active {
  background: rgba(79,174,143,0.12);
  color: #1f7a5b;
  font-weight: 600;
  box-shadow: inset 0 0 0 2px rgba(79,174,143,0.45);
}

select.filterPill {
  appearance: none;
  padding: 0 26px 0 12px;
  background-image:
    linear-gradient(45deg, transparent 50%, #667085 50%),
    linear-gradient(135deg, #667085 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 13px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

#topTenFilters {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

#topTenFilters .filterPill {
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

#topTenFilters select.filterPill {
  padding: 0 22px 0 10px;
  background-position:
    calc(100% - 14px) 50%,
    calc(100% - 10px) 50%;
  background-size: 4px 4px;
}

#topTenRange,
#chartRisk,
#chartProvider {
  padding-left: 8px !important;
  padding-right: 18px !important;
}

#chartCategory {
  padding-left: 9px !important;
  padding-right: 20px !important;
}

.topTenFilterField {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.topTenFilterField .filterPill {
  width: 100%;
}

.topTenFilterField.has-multiple-filter {
  min-width: 178px;
}

.topTenFilterField.has-multiple-filter select.filterPill {
  padding-right: 58px !important;
}

.topTenFilterClearBtn {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
}

/* ==============================
   TOP TEN DROPDOWN (FLOATING)
   ============================== */

.topTenPortal {
  position: fixed;
  z-index: 9999;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.15);
  padding: 8px;
  min-width: 220px;
}

.topTenItem {
  width: 100%;
  padding: 10px;
  border: 0;
  background: transparent;
  text-align: left;
  font-weight: 600;
  cursor: pointer;
}

.topTenItem:hover {
  background: rgba(16,24,40,.04);
}

/* ==============================
   RANGE SELECTOR
   ============================== */

.range {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: #ffffff;
  border: 1px solid rgba(16,24,40,.08);
  box-shadow: 0 6px 16px rgba(16,24,40,.08);
  border-radius: 999px;
  flex-shrink: 0;
}

.rangeDock {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 7;
}

.exploreShareWrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 12;
}

.exploreShareBtn {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(63,143,111,0.2);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(240,248,244,0.96));
  color: #3F8F6F;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow:
    0 8px 20px rgba(63,143,111,0.14),
    inset 0 1px 0 rgba(255,255,255,0.7);
  transition:
    transform var(--motion-fast, 140ms) var(--motion-ease, ease),
    box-shadow var(--motion-fast, 140ms) var(--motion-ease, ease),
    border-color var(--motion-fast, 140ms) var(--motion-ease, ease),
    background var(--motion-fast, 140ms) var(--motion-ease, ease);
}

.exploreShareBtn:hover {
  transform: translateY(-1px);
  border-color: rgba(63,143,111,0.32);
  box-shadow:
    0 10px 24px rgba(63,143,111,0.18),
    inset 0 1px 0 rgba(255,255,255,0.76);
}

.exploreShareBtn:active {
  transform: translateY(0);
}

.exploreShareBtn:focus-visible,
.exploreShareCopyBtn:focus-visible,
.exploreShareField input:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(79,174,143,0.18),
    0 8px 20px rgba(63,143,111,0.14);
}

.exploreShareBtn svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.exploreSharePopover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(360px, calc(100vw - 32px));
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(16,24,40,0.08);
  background: rgba(255,255,255,0.98);
  box-shadow: 0 20px 48px rgba(16,24,40,0.14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.exploreSharePopoverTitle {
  color: #101828;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.exploreSharePopoverText {
  margin: 6px 0 0;
  color: #667085;
  font-size: 12px;
  line-height: 1.45;
}

.exploreShareField {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.exploreShareField input {
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(16,24,40,0.1);
  background: rgba(248,250,252,0.9);
  color: #344054;
  padding: 0 12px;
  font-size: 12px;
}

.exploreShareCopyBtn {
  flex: 0 0 auto;
  height: 40px;
  border: 1px solid rgba(63,143,111,0.18);
  border-radius: 12px;
  background: #3F8F6F;
  color: #ffffff;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(63,143,111,0.2);
}

.exploreShareStatus {
  min-height: 18px;
  margin-top: 10px;
  color: #356f58;
  font-size: 12px;
  font-weight: 600;
}

.range button {
  border: none;
  background: transparent;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.2;
  color: #667085;
  border-radius: 999px;
  cursor: pointer;
}

.range button.active {
  background: #3F8F6F;
  color: #ffffff;
  box-shadow: none;
}

.askAiPill {
  border: 1px solid rgba(255,255,255,0.45);
  background: #3F8F6F;
  color: #ffffff;
  border-radius: 999px;
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  --ask-ai-x: 0;
  transition:
    background var(--motion-fast, 140ms) var(--motion-ease, ease),
    border-color var(--motion-fast, 140ms) var(--motion-ease, ease),
    color var(--motion-fast, 140ms) var(--motion-ease, ease),
    box-shadow var(--motion-fast, 140ms) var(--motion-ease, ease),
    transform var(--motion-fast, 140ms) var(--motion-ease, ease);
  box-shadow:
    0 8px 20px rgba(63, 143, 111, 0.28),
    0 0 0 1px rgba(63, 143, 111, 0.2);
  transform: translateX(var(--ask-ai-x));
}

.askAiPill:hover {
  background: #3F8F6F;
  border-color: rgba(255,255,255,0.45);
  color: #ffffff;
  transform: translateX(var(--ask-ai-x)) translateY(-1px);
}

.askAiPill:active {
  transform: translateX(var(--ask-ai-x)) translateY(0);
}

.askAiPillUnderRange {
  position: absolute;
  top: calc(100% + 13px);
  left: 50%;
  --ask-ai-x: -50%;
  z-index: 20;
  pointer-events: auto;
}

.askAiPillInline {
  position: static;
  --ask-ai-x: 0;
  transform: none;
}

.askAiPillInline:hover {
  transform: translateY(-1px);
}

.askAiPillInline:active {
  transform: translateY(0);
}

.askAiPillCorner {
  margin-left: 8px;
  flex: 0 0 auto;
}

.toolbarRight .rangeDock {
  margin-right: 4px;
}

.exploreRangeMobileWrap {
  display: none;
  position: relative;
  z-index: 0;
}

.exploreRangeMobileWrap.isOpen {
  z-index: 24;
}

.exploreRangeMobileToggle {
  appearance: none;
  -webkit-appearance: none;
  min-height: 36px;
  padding: 6px 30px 6px 12px;
  border-radius: 13px;
  border: 1px solid rgba(255,255,255,0.48);
  background: rgba(255,255,255,0.48);
  color: #525f75;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.68),
    0 6px 16px rgba(16,24,40,0.05);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  position: relative;
}

.exploreRangeMobileToggle::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid rgba(98, 108, 129, 0.82);
  transform: translateY(-35%);
}

.exploreRangeMobileMenu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 132px;
  padding: 6px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.74);
  background: rgba(255,255,255,0.92);
  box-shadow: 0 18px 34px rgba(16,24,40,0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 25;
}

.exploreRangeMobileOption {
  width: 100%;
  border: 0;
  background: transparent;
  color: #475467;
  text-align: left;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
}

.exploreRangeMobileOption.active {
  background: #3F8F6F;
  color: #ffffff;
}

/* ==============================
   CHART
   ============================== */

#chartWrap {
  height: 320px;
  padding: 0;
  margin: 0;
  display: flex;
  background: #ffffff;
  overflow: visible;
  position: relative;
  box-sizing: border-box; /* 🔑 CRITICAL */
}

@media (pointer: coarse) {
  #chartWrap,
  #chartWrap * {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }

  #chartWrap,
  #chart {
    touch-action: pan-y;
  }

  #compareTableWrap,
  #compareTableWrap .compareTable,
  #compareTableWrap .compareTable th,
  #compareTableWrap .compareTable td,
  #compareTableWrap .compareTable .fundNameCell,
  #compareTableWrap .compareTable .fundNameText,
  #compareTableWrap .compareTable .comparePerformancePill,
  #compareTableWrap .compareTable .riskBadge,
  #compareTableWrap .compareTable .riskValue,
  #compareTableWrap .compareTable .providerPill,
  #compareTableWrap .compareTable canvas.spark {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }
}

#chartWrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-115%);
  background:
    linear-gradient(
      90deg,
      rgba(255,255,255,0) 0%,
      rgba(255,255,255,0.34) 46%,
      rgba(226,241,233,0.5) 52%,
      rgba(255,255,255,0) 100%
    );
  transition: opacity 0.18s ease;
  z-index: 2;
}

#chartWrap.is-loading::after {
  opacity: 1;
  animation: exploreChartWrapSweep 900ms ease-in-out infinite;
}

@keyframes exploreChartWrapSweep {
  0% {
    transform: translateX(-115%);
  }
  100% {
    transform: translateX(115%);
  }
}

.mobileTopTenSummary {
  display: none;
  padding: 0 12px 10px;
  justify-content: center;
}

.mobileTopTenSummaryBtn {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(63,143,111,0.18);
  background: rgba(236,245,240,0.92);
  color: #2f6f5a;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72);
}

.mobileTopTenSummaryBtn:hover {
  background: rgba(223,239,231,0.96);
}

.chartFloatingTitle {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  pointer-events: auto;
}

#chartTitle.info-wrap {
  z-index: 90;
}

#chartTitle.info-wrap .info-tooltip {
  z-index: 100;
}

#chartTitle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.72);
  background: rgba(255,255,255,0.62);
  backdrop-filter: blur(8px);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #475467;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(16,24,40,0.05);

  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial;
}

.chartTitleText {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.chartTitlePrimary,
.chartTitleSecondary {
  min-width: 0;
}

.chartTitleSecondary {
  color: #667085;
  font-weight: 550;
}

@media (min-width: 941px) {
  #chartTitle {
    gap: 8px;
    padding: 8px 14px;
    font-size: 16px;
    line-height: 1.15;
  }
}

.exploreInfoInline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  margin-left: -6px;
  z-index: 12;
}

.insightsCard,
.aiPanel {
  overflow: visible;
  position: relative;
  z-index: 1;
}

.insightsCard:hover,
.insightsCard:focus-within,
.aiPanel:hover,
.aiPanel:focus-within {
  z-index: 60;
}





#chart {
  width: 100% !important;
  height: 100% !important;
  display: block;
  position: relative !important;
  z-index: 0;
}

@media (pointer: coarse) {
  #chart {
    -webkit-user-drag: none;
    -webkit-tap-highlight-color: transparent;
  }
}

#chart.explore-chart-intro {
  transform-origin: center bottom;
  animation: exploreChartCanvasIntro 560ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes exploreChartCanvasIntro {
  0% {
    opacity: 0.38;
    transform: translateY(10px) scaleY(0.985);
    filter: saturate(0.92);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scaleY(1);
    filter: saturate(1);
  }
}

.tableSection {
  position: relative;
  z-index: 1;
}

.chartPanel {
  flex: 1;
  background: #ffffff;
}


/* ==============================
   DIVIDER
   ============================== */

.compareDivider {
  height: 1px;
  margin: 4px 0;
  background: rgba(16,24,40,0.06);
}

/* ==============================
   TABLE
   ============================== */

.tableSection {
  padding: 8px 20px 16px;
}

#compareTableWrap {
  overflow-x: auto;
  overflow-y: visible;
}

.compareTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.compareTable thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  box-sizing: border-box;
  background: #fff;
  text-align: center;
  font-size: 12px;
  letter-spacing: .04em;
  color: #64748b;
  text-transform: uppercase;
  padding: 12px 8px;
  user-select: none;
}

.compareTable thead th[data-key] {
  cursor: pointer;
  padding-right: 22px;
}

.compareTable thead th[data-key]::after {
  content: "↕";
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  opacity: .35;
}

.compareTable thead th.sorted {
  background: rgba(79,174,143,0.12);
  color: #3f8f6f;
  font-weight: 600;
}


.compareTable thead th.sorted::after {
  content: "▲";
  opacity: 1;
  color: #3f8f6f;
}

.compareTable thead th.sorted.desc::after {
  content: "▼";
}

.compareTable tbody tr {
  height: 52px;
  border-bottom: 1px solid rgba(16,24,40,0.06);
  transition: background .15s ease, box-shadow .15s ease;
}

.compareTable tbody tr:last-child {
  border-bottom: 0;
}

.compareTable tbody tr:hover {
  background: #f1f5f9;
}

.compareTable tbody tr.active {
  background: var(--pz-focus-soft);
  box-shadow: inset 3px 0 0 var(--pz-focus);
}


.compareTable td {
  box-sizing: border-box;
  height: 52px;
  padding: 8px;
  text-align: center;
  vertical-align: middle;
}

.compareTable tbody td:nth-child(1) {
  width: 152px;
  min-width: 152px;
  max-width: 152px;
}

.compareTable thead th:nth-child(2),
.compareTable tbody td:nth-child(2) {
  width: 30px;
  min-width: 30px;
  max-width: 30px;
}

.compareTable td.comparePerformanceCell {
  padding: 6px 8px;
}

.comparePerformancePill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  padding: 0;
  border-radius: 0;
  font-weight: 650;
  line-height: 1;
  color: #344054;
  background: transparent;
  border: none;
  transition: color .15s ease;
}

.comparePerformanceCell.is-neutral .comparePerformancePill,
.comparePerformanceCell.is-neutral {
  color: #98a2b3;
}

.comparePerformanceCell[data-performance-tone="excellent"] {
  background: transparent;
  box-shadow: none;
}

.comparePerformanceCell[data-performance-tone="excellent"] .comparePerformancePill {
  color: #166534;
}

.comparePerformanceCell[data-performance-tone="average"] {
  background: transparent;
  box-shadow: none;
}

.comparePerformanceCell[data-performance-tone="average"] .comparePerformancePill {
  color: #ca8a04;
}

.comparePerformanceCell[data-performance-tone="poor"] {
  background: transparent;
  box-shadow: none;
}

.comparePerformanceCell[data-performance-tone="poor"] .comparePerformancePill {
  color: #b42318;
}

.comparePerformanceCell[data-performance-tone="negative"] {
  background: transparent;
  box-shadow: none;
}

.comparePerformanceCell[data-performance-tone="negative"] .comparePerformancePill {
  color: #b42318;
}

.compareTable td:nth-child(3) {
  text-align: left;
  padding-left: 6px;
  width: 238px;
  min-width: 238px;
  max-width: 238px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compareTable thead th:nth-child(3) {
  width: 238px;
  min-width: 238px;
}

.compareTable thead th:nth-child(4),
.compareTable tbody td:nth-child(4) {
  width: 84px;
  min-width: 84px;
}

.compareTable thead th:nth-child(5),
.compareTable tbody td:nth-child(5) {
  width: 88px;
  min-width: 88px;
}

.compareTable thead th:nth-child(6),
.compareTable tbody td:nth-child(6) {
  width: 52px;
  min-width: 52px;
}

.compareTable thead th:nth-child(7),
.compareTable tbody td:nth-child(7),
.compareTable thead th:nth-child(8),
.compareTable tbody td:nth-child(8),
.compareTable thead th:nth-child(9),
.compareTable tbody td:nth-child(9) {
  width: 72px;
  min-width: 68px;
}

.compareTable thead th:nth-child(10),
.compareTable tbody td:nth-child(10),
.compareTable thead th:nth-child(11),
.compareTable tbody td:nth-child(11) {
  width: 86px;
  min-width: 86px;
  max-width: 86px;
}

.compareTable thead th:nth-child(10),
.compareTable thead th:nth-child(11) {
  padding-left: 6px;
  padding-right: 14px;
  white-space: nowrap;
}

.compareTable canvas.spark {
  display: block;
  width: 80px;
  height: 24px;
}

.compareTable td.fundNameCell {
  display: table-cell;
}

.fundNameMarquee {
  display: block;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
}

.fundNameText {
  display: inline-block;
  max-width: none;
  font-weight: 500;
  will-change: transform;
}

.fundNameMarquee.is-overflowing:hover .fundNameText {
  animation: fundNameMarquee 7s ease-in-out 0.8s infinite alternate;
}

@keyframes fundNameMarquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(-1 * var(--fund-name-marquee-distance, 0px)));
  }
}

@media (prefers-reduced-motion: reduce) {
  #chartWrap.is-loading::after {
    animation: none;
  }

  .fundNameMarquee.is-overflowing:hover .fundNameText {
    animation: none;
  }
}

.providerPill {
  display: inline-flex;
  align-items: center;

  font-size: 12px;           /* 🔑 force size */
  font-weight: 600;
  line-height: 1;

  padding: 4px 12px;         /* 🔑 same physical height as Added */
  border-radius: 999px;

  background: rgba(148,163,184,0.18);
  color: #475569;

  white-space: nowrap;
}

.compareTable .riskBadge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  color: #334155;
  background: rgba(148, 163, 184, 0.18);
  border: 1px solid rgba(148, 163, 184, 0.35);
  text-shadow: none;
}

.compareTable .riskBadge.riskBadge-empty,
.fundRow .riskBadge.riskBadge-empty {
  background: transparent;
  border-color: transparent;
  color: #98a2b3;
}

.compareTable .riskValue {
  color: #334155;
  font-weight: 600;
}

.fundRow .riskValue {
  min-width: 18px;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}





/* Remove button */

.removeBtn {
  cursor: pointer;
  color: #94a3b8;
}

.removeBtn:hover {
  color: #ef4444;
}

.removeSpacer {
  display: inline-block;
  width: 14px;
  height: 14px;
}
.removeCell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.removeBtn {
  border: none;
  background: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 14px;
}

.removeBtn:hover {
  color: #ef4444;
}

.compareStarBtn {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  font-size: 21px;
  font-weight: 800;
  line-height: 1;
  padding: 0;
  pointer-events: auto;
}

.compareStarBtn:hover {
  color: #3F8F6F;
  background: rgba(63, 143, 111, 0.08);
}

.compareStarBtn.is-selected {
  color: #3F8F6F;
}

/* Base pill */
.pill {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.pill.has-subtag {
  position: relative;
  overflow: visible;
}

.pill-subtag {
  position: absolute;
  top: -8px;
  right: -6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 13px;
  padding: 0 4px;
  border-radius: 999px;
  box-sizing: border-box;
  background: #4f9b7d;
  color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.16);
  font-size: 7px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  pointer-events: none;
}

/* Added fund */
.pill-added {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  box-sizing: border-box;
  background: rgba(148, 163, 184, 0.18);  /* slate-400 */
  color: #475569;                         /* slate-600 */
  border: 1px solid rgba(148, 163, 184, 0.35);
  font-weight: 600;
}

.pill-portfolio {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  box-sizing: border-box;
  background: rgba(63, 143, 111, 0.10);
  color: #356f58;
  border: 1px solid rgba(63, 143, 111, 0.22);
  font-weight: 600;
}


/* Top Ten fund */
.pill-topten {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(148, 163, 184, 0.12);
  color: #475569;
  border: 1px solid rgba(148, 163, 184, 0.24);
}

.pill-topten.has-subtag {
  overflow: visible;
}
#topTenToggle.disabled,
#topTenFilters.disabled {
  opacity: 0.4;
  pointer-events: none;
  filter: grayscale(1);
}

#topTenToggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(79,174,143,0.12);
  color: #2f6f5a;
  border: 1px solid rgba(79,174,143,0.35);
  min-height: 36px;
  padding: 0 12px;
}

.topTenToggleMode,
.topTenToggleConfig {
  display: inline-flex;
  align-items: center;
  min-height: 100%;
}

.topTenToggleMode {
  font-weight: 700;
}

.topTenToggleConfig {
  gap: 6px;
}

.topTenToggleClose {
  display: none;
  font-size: 20px;
  line-height: 1;
  font-weight: 800;
  color: #ffffff;
  margin-left: 6px;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
}

.topTenToggleDivider {
  width: 1px;
  height: 18px;
  background: currentColor;
  opacity: 0.22;
}

#topTenToggle:hover {
  background: rgba(79,174,143,0.2);
  color: #245746;
}

#topTenToggle.active {
  background: #3F8F6F !important;
  border-color: #3F8F6F !important;
  color: #ffffff !important;
}

.compareTable thead th.tableResetHeader {
  text-align: left !important;
  vertical-align: middle;
  width: 124px;
  min-width: 124px;
  max-width: 124px;
}

.compareTable thead th.tableResetHeader.hasSocialExport {
  width: 152px;
  min-width: 152px;
  max-width: 152px;
}

.tableResetControls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  min-width: max-content;
}

.exploreSocialExportBtn {
  appearance: none;
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(63,143,111,0.24);
  border-radius: 999px;
  background: rgba(255,255,255,0.86);
  color: #2d7f59;
  box-shadow: 0 8px 18px rgba(16,24,40,0.08);
  cursor: pointer;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.exploreSocialExportBtn:hover {
  background: #eff8f2;
  transform: translateY(-1px);
}

.exploreSocialExportBtn:active {
  transform: translateY(0);
}

.exploreResetBtn {
  height: 28px;
  min-width: 28px;
  flex: 0 0 auto;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  background: rgba(127, 29, 29, 0.06);
  color: #991b1b;
  border: 1px solid rgba(185, 28, 28, 0.12);
}

.tableResetHeader.hasSocialExport .exploreResetBtn {
  margin-left: 0;
}

.exploreResetBtn:hover {
  background: rgba(127, 29, 29, 0.1);
  color: #7f1d1d;
}

.exploreCompareBtn {
  height: 28px;
  min-width: 28px;
  flex: 0 0 auto;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  background: rgba(63, 143, 111, 0.08);
  color: #2f6f5a;
  border: 1px solid rgba(63, 143, 111, 0.18);
  white-space: nowrap;
}

.exploreCompareBtn:hover,
.exploreCompareBtn.is-selecting,
.exploreCompareBtn.is-comparing {
  background: rgba(63, 143, 111, 0.14);
  border-color: rgba(63, 143, 111, 0.34);
  color: #275f4d;
}

.exploreCompareBtn.is-comparing {
  background: #3F8F6F;
  border-color: #3F8F6F;
  color: #ffffff;
}

.mobileTableActions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 10px 20px 0;
}

.tableResetHeader #exploreSocialExportBtn,
.tableResetHeader #exploreCompareBtn {
  display: none !important;
}

.mobileTableActions #mobileExploreResetBtn {
  display: none !important;
}

.mobileTableActions #exploreSocialExportBottomBtn {
  width: auto;
  min-width: 64px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  font-weight: 700;
  line-height: 1;
}

.mobileTableActions #exploreSocialExportBottomBtn::before {
  content: "Studio";
  font-size: 11px;
  line-height: 1;
}


.insightPlaceholder {
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(16,24,40,0.04);
  font-size: 14px;
  color: #667085;
}
.insight.pill {
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 8px;
  display: inline-block;
  max-width: 100%;
}

.insight.pill.positive {
  background: #e6f6ef;
  color: #065f46;
}

.insight.pill.warning {
  background: #fff4e5;
  color: #92400e;
}

.insight.pill.neutral {
  background: #f1f5f9;
  color: #334155;
}

.insightTitle {
  margin-top: 0;
  margin-bottom: 6px;
  font-size: 15px;      /* 👈 stronger visual step */
  font-weight: 700;    /* 👈 bolder */
  letter-spacing: -0.01em;
  color: #0f172a;
  line-height: 1.15;

}


.insightText {
  font-size: 14px;
  font-weight: 500;
  color: #334155;
}



#insightsContent {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.insight.pill {
  flex: 0 0 auto;
  white-space: normal;
  max-width: 100%;

}
.insight.pill.context {
  border-radius: 14px;
  background: #f8fafc;
  color: #475569;
  max-width: 100%;
  flex: 1 1 100%;
  margin-top: 6px;
}
.insight.pill.context .insightText {
  max-width: 70ch;
}
.insightSentence {
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.5;
  background: #f8fafc;
  border-left: 4px solid #10b981;
  border-radius: 6px;
}
.compareInsights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.compareInsight {
  padding: 12px;
  border-radius: 8px;
  background: #f8fafc;
}

.compareInsight .title {
  font-weight: 600;
  margin-bottom: 4px;
}

.compareInsight.green {
  border-left: 4px solid #10b981;
}

.compareInsight.amber {
  border-left: 4px solid #f59e0b;
}

.compareInsight.white {
  border-left: 4px solid #94a3b8;
}
/* ==============================
   INSIGHTS
   ============================== */

.insightsCard {
  margin-top: 18px;
}

.insightsHeader h2 {
  margin: 0;
}

.insightsSub {
  margin-top: 6px;
  color: #667085;
}

.insightsContent {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.insight {
  flex: 1;
  min-width: 220px;
  border-radius: 14px;
  padding: 16px 14px 14px;  /* 👈 more top padding, less hacky */
  border: 1px solid #e5e7eb;
  position: relative;
}

/* 🔒 FORCE system pills to stay fully rounded */
.insight .pill {
  border-radius: 999px !important;
}



/* ==============================
   INSIGHT COLOUR BANDS
   ============================== */

/* GOOD */
.insight.green {
  background: var(--pz-focus-soft);
  border-color: var(--pz-focus);
}

.insight.green .insightTitle,
.insight.green .insightText {
  color: #065f46;
}


/* GREAT */
.insight.green .insightBadge {
  background: rgba(22,163,74,.30);
  color: #065f46;
}


.insight.amber {
  background: rgba(245,158,11,.18);
  border-color: rgba(245,158,11,.55);
}


.insight.white {
  background: var(--pz-surface-alt);
  border-color: var(--pz-border);
}
.insight.white .insightTitle,
.insight.white .insightText {
  color: #334155;
}


.insight.red {
  background: var(--pz-contrast-soft);
  border-color: var(--pz-contrast);
}
.insight.red .insightTitle,
.insight.red .insightText {
  color: #7f1d1d;
}


.insightSummary {
  margin-top: 14px;
  font-size: 14px;
  color: #475467;
  line-height: 1.4;
}

.insightGrade {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: .85;
}

.insightStatus {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}


.insightGrade.green { color: #166534; }
.insightGrade.amber { color: #92400e; }
.insightGrade.red   { color: #991b1b; }
.insightGrade.white { color: #475569; }


.insight {
  position: relative;
}

/* Insight cards (NOT system pills) */
.insightsContent .insight {
  border-radius: 12px;
}


/* Verdict badge (GREAT / GOOD / OK / POOR) */
.insightBadge {
  position: absolute;
  top: 10px;
  right: 14px;

  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;

  padding: 4px 8px;
  border-radius: 6px;

  background: rgba(0,0,0,0.06);
  color: #0f172a;
}

.insight.green .insightBadge { background: var(--pz-focus-soft); }
.insight.red   .insightBadge { background: var(--pz-contrast-soft); }
.insight.white .insightBadge { background: rgba(148,163,184,.12); }


/* 🔒 Force small system tags (Added / Top Ten) to always be pills */
#compareTableBody .pill,
#compareTableBody .pill-topten,
#compareTableBody .pill-added,
#compareTableBody .pill-portfolio {
  border-radius: 999px !important;
}

/* 🔒 Force Top Ten UI pills (toggle + filters) to always be rounded */
#topTenToggle,
#topTenFilters .filterPill,
#topTenFilters .rangePill,
.filterPill,
.rangePill {
  border-radius: 999px !important;
}
.removeBtn.disabled {
  opacity: 0.25;
  cursor: not-allowed;
  pointer-events: none;
}
#compareTableBody tr.isolated {
  background: var(--pz-focus-soft);
}


#compareTableBody tr.isolated td {
  font-weight: 600;
}
.navActions {
  display: flex;
  align-items: center;
  gap: 12px;
}
/* ==============================
   NAV AUTH BUTTONS
   ============================== */

.loginBtn {
  background: transparent;
  border: 1px solid var(--pz-border);
  color: var(--pz-ink-secondary);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
}

.loginBtn:hover {
  background: rgba(16,24,40,0.04);
  color: var(--pz-ink-primary);
}
/* === GREEN NORMALISATION === */

:root {
  --ui-green: var(--pz-focus);
  --ui-green-soft: rgba(63,143,111,0.18);
  --ui-mint: #22c55e;
  --ui-mint-soft: rgba(34,197,94,0.16);
}

/* Primary actions */
.btnPrimary,
.range button.active,
.filterPill.active {
  background: var(--ui-green) !important;
  border-color: var(--ui-green) !important;
  color: #fff !important;
}

/* Selected / focus surfaces */
.compareTable tbody tr.active,
#compareTableBody tr.isolated {
  background: var(--ui-green-soft) !important;
  border-color: var(--ui-green) !important;
}

.insight.green {
  background: var(--ui-mint-soft) !important;
  border-color: var(--ui-mint) !important;
}

.insight.green .insightTitle,
.insight.green .insightText {
  color: #166534 !important;
}

/* Green text / badges */
.insightGrade.green { color: var(--ui-mint) !important; }
.insightGrade.white { color: #475569 !important; }
.insightGrade.red   { color: #991b1b !important; }
.insightGrade.amber { color: #92400e !important; }

.insight.green .insightBadge {
  background: rgba(34,197,94,0.22) !important;
  color: #166534 !important;
}
.insight.white .insightBadge { color: #475569 !important; }
.insight.red   .insightBadge { color: #991b1b !important; }
.insight.amber .insightBadge { color: #92400e !important; }

.chart-line-muted {
  stroke: #94a3b8 !important;
  opacity: 0.85;
}

.chart-line-focus {
  stroke: var(--ui-mint) !important;
  stroke-width: 2.5;
}
.aiButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  white-space: nowrap;
  line-height: 1.1;
  padding: 9px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.45);
  background: #3F8F6F;
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  position: relative;
  box-shadow:
    0 8px 20px rgba(63, 143, 111, 0.28),
    0 0 0 1px rgba(63, 143, 111, 0.2);
  transition:
    transform var(--motion-fast, 140ms) var(--motion-ease, ease),
    box-shadow var(--motion-fast, 140ms) var(--motion-ease, ease),
    background-color var(--motion-fast, 140ms) var(--motion-ease, ease);
}

.aiButton:hover:not(:disabled) {
  transform: translateY(-1px);
}

.aiButton:active:not(:disabled) {
  transform: translateY(0);
}

.expandBtn {
  display: none;
  border: 0;
  background: rgba(16,24,40,0.06);
  color: #475467;
  border-radius: 999px;
  padding: 7px 12px;
  height: 32px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.expandBtn:hover {
  background: rgba(16,24,40,0.1);
}

/* ==============================
   MOBILE ONLY (do not affect desktop)
   ============================== */
@media (max-width: 940px) {
  body.exploreOnly #explore {
    padding-top: 24px;
  }

  html.portzo-app-shell #exploreApp,
  body.portzo-app-shell #exploreApp {
    margin-top: 24px;
  }

  html.portzo-app-shell .exploreHeaderText h1,
  body.portzo-app-shell .exploreHeaderText h1 {
    padding-top: 4px;
  }

  #centerColumn {
    gap: 12px;
  }

  .card {
    padding: 14px;
    border-radius: 14px;
  }

  .exploreHeaderRow {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 6px;
  }

  .exploreHeaderText h1 {
    font-size: 30px;
    line-height: 1.08;
    margin-bottom: 2px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .exploreHeaderText p {
    font-size: 12px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .compareSearchWrap {
    width: 100%;
  }

  .compareAddIcon {
    font-size: 30px;
    right: 12px;
  }

  .compareCard.unifiedCompare {
    border-radius: 16px;
    margin-top: 6px;
  }

  .exploreToolbar {
    padding: 12px 12px 10px;
    gap: 8px;
    flex-wrap: nowrap;
    align-items: center;
  }

  .toolbarLeft,
  .toolbarRight {
    width: auto;
    margin-left: 0;
  }

  .toolbarCenter {
    display: none;
  }

  .toolbarRight {
    display: flex;
    justify-content: flex-end;
    margin-left: auto;
    gap: 8px;
    min-width: 0;
    flex: 1 1 auto;
  }

  .toolbarLeft {
    position: relative;
    flex-shrink: 0;
  }

  #topTenFilters {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    border-radius: 12px;
    border: 1px solid rgba(16,24,40,.1);
    background: rgba(255,255,255,.98);
    box-shadow: 0 12px 26px rgba(16,24,40,.12);
  }

  #topTenFilters.hidden {
    display: none !important;
  }

  .expandBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
  }

  .expandBtn.is-disabled {
    opacity: 0.45;
    cursor: pointer;
  }

  .range {
    padding: 3px;
    gap: 2px;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .range::-webkit-scrollbar {
    display: none;
  }

  .range button {
    padding: 6px 9px;
    font-size: 11px;
    flex: 0 0 auto;
  }

  .askAiPill {
    height: 28px;
    padding: 0 10px;
    font-size: 11px;
  }

  .exploreSharePopover {
    right: -24px;
  }

  .askAiPillUnderRange {
    top: calc(100% + 12px);
  }

  #chartWrap {
    height: 280px;
  }

  .mobileTopTenSummary {
    display: flex;
  }

  .chartFloatingTitle {
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    padding: 0;
    text-align: center;
    z-index: 3;
  }

  #chartTitle {
    font-size: 10px;
    display: inline-flex;
    max-width: min(calc(100vw - 132px), 320px);
    justify-content: center;
    white-space: nowrap;
  }

  .tableSection {
    padding: 6px 10px 12px;
  }

  /* On mobile, hide only user-added marker so Fund + sparkline stay in view */
  #compareTableBody .pill-topten,
  #compareTableBody .pill-added,
  #compareTableBody .pill-portfolio {
    display: none !important;
  }

  /* On mobile, hide remove X so key data columns are prioritized */
  #compareTableBody .removeBtn {
    display: none !important;
  }

  /* Keep reset visible on mobile, but hide per-row remove cells */
  .compareTable tbody tr:not(.compareTableEmptyRow) > td:first-child {
    display: none;
  }

  #compare.compareSelectionActive .compareTable tbody tr:not(.compareTableEmptyRow) > td:first-child {
    display: table-cell;
    width: 32px;
    min-width: 32px;
    max-width: 32px;
    padding-right: 4px;
  }

  #compare.compareSelectionActive .removeCell {
    gap: 0;
  }

  .compareTableEmptyRow > td:first-child,
  .compareTableEmptyRow > td[colspan] {
    display: table-cell !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    padding: 16px 12px !important;
    text-align: center;
  }

  .compareTable thead th.tableResetHeader {
    display: table-cell;
    position: relative;
    overflow: visible;
    width: 104px;
    min-width: 104px;
    max-width: 104px;
    padding-left: 6px;
    padding-right: 4px;
  }

  .exploreResetBtn {
    position: static;
    transform: none;
    margin-left: 0;
    z-index: 2;
  }

  /* Hide color-dot column on mobile to reclaim horizontal room for sparkline */
  .compareTable thead th:nth-child(2),
  .compareTable tbody td:nth-child(2) {
    display: none;
  }

  /* Keep fund and sparkline in a stable opening position on mobile */
  .compareTable thead th:nth-child(3),
  .compareTable tbody td:nth-child(3) {
    width: 228px;
    min-width: 228px;
    padding-left: 8px;
    max-width: 228px;
  }

  .compareTable thead th:nth-child(4),
  .compareTable tbody td:nth-child(4) {
    width: 110px;
    min-width: 110px;
    padding-left: 8px;
    padding-right: 8px;
  }

  .compareTable tbody td:nth-child(4) .spark {
    margin-left: 0;
  }

  #compareTableWrap {
    display: block;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  .compareTable {
    min-width: 940px;
  }

  body.compare-expanded {
    overflow: hidden;
  }

  #compare.compareExpanded {
    position: fixed;
    inset: 0;
    z-index: 3000;
    margin: 0;
    border-radius: 0;
    border: none;
    box-shadow: 0 0 0 1px rgba(16,24,40,.08);
    background: #ffffff;
    display: flex;
    flex-direction: column;
    max-height: 100vh;
  }

  #compare.compareExpanded .exploreToolbar {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #ffffff;
    border-bottom: 1px solid rgba(16,24,40,.08);
  }

  #compare.compareExpanded #chartWrap {
    height: min(62vh, 420px);
  }

  #compare.compareExpanded .tableSection {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding-bottom: 18px;
  }

  #compare.compareExpanded #compareTableWrap {
    max-height: none;
  }

  @media (orientation: landscape) {
    #compare.compareExpanded #chartWrap {
      height: min(70vh, 470px);
    }
  }
}

@media (max-width: 940px) and (orientation: portrait) {
  #compareExpandBtn {
    display: none !important;
  }
}

@media (min-width: 941px) and (max-width: 1100px) {
  #centerColumn {
    gap: 14px;
  }

  .card {
    padding: 16px 18px;
  }

  .exploreHeaderRow {
    flex-wrap: wrap;
    gap: 12px;
  }

  .compareSearchWrap {
    width: min(440px, 100%);
    margin-left: auto;
  }

  .exploreToolbar {
    flex-wrap: wrap;
    row-gap: 10px;
  }

  .toolbarLeft {
    flex: 0 0 auto;
  }

  .toolbarRight {
    width: 100%;
    margin-left: 0;
    justify-content: flex-end;
    min-width: 0;
  }

  .toolbarCenter { display: none; }

  .range {
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .range::-webkit-scrollbar {
    display: none;
  }

  #chartWrap {
    height: 320px;
  }

  #compareTableWrap {
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .compareTable {
    min-width: 980px;
  }
}

.aiButton:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.aiResponse {
  margin-top: 16px;
  width: 100%;
  max-width: 100%;
  padding: 0;

  font-size: 15px;
  line-height: 1.65;
  color: #1f2937;
}

.aiResponseModal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 18px;
}

.aiResponseModal.hidden {
  display: none !important;
}

.aiResponseModalBackdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
}

.aiResponseModalCard {
  position: relative;
  z-index: 1;
  width: min(100%, 620px);
  max-height: min(78vh, 680px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
  padding: 18px 18px 20px;
}

.aiResponseModalHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.aiResponseModalHeader h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.aiResponseModalClose {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: rgba(16, 24, 40, 0.08);
  color: #101828;
  font-size: 22px;
  line-height: 1;
}

.aiResponseModalLoading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(239, 247, 243, 0.94);
}

.aiResponseModalBody {
  font-size: 15px;
  line-height: 1.65;
  color: #1f2937;
}

body.explore-ai-modal-open {
  overflow: hidden;
}

@media (min-width: 941px) {
  .aiResponseModal {
    display: none !important;
  }
}


.hidden {
  display: none;
}
/* =========================
   Portzo AI — visual polish
   ========================= */

.aiHeader {
  display: flex;
  align-items: center;
  gap: 10px;
}

.aiTitle {
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
}

.aiBadge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #ecf7f2;     /* matches GOOD / OK pills */
  color: #2f6f5f;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.aiBody {
  margin-top: 10px;
  width: 100%;
}

#ai,
#aiLoadingState,
#aiResponse {
  scroll-margin-top: 112px;
}

.aiLoadingState {
  margin-top: 14px;
  width: 100%;
  max-width: 700px;
  padding: 16px 18px;
  border: 1px solid rgba(63, 143, 111, 0.16);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(247, 251, 249, 0.96) 0%, rgba(239, 247, 243, 0.94) 100%);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.aiLoadingRow {
  display: flex;
  align-items: center;
  gap: 14px;
}

.aiLoadingLogo {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  filter: drop-shadow(0 6px 16px rgba(63, 143, 111, 0.18));
}

.aiLoadingCopy {
  min-width: 0;
}

.aiLoadingTitle {
  color: #1f3d32;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

.aiLoadingHint {
  margin-top: 2px;
  color: #5f6f67;
  font-size: 14px;
  line-height: 1.45;
}

.aiLoadingBar {
  position: relative;
  margin-top: 14px;
  width: min(100%, 620px);
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(63, 143, 111, 0.12);
}

.aiLoadingBarFill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 38%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3f8f6f 0%, #73b495 55%, #d8efe2 100%);
  animation: aiLoadingBarSweep 1.35s ease-in-out infinite;
}

.aiPanel {
  margin-top: 20px;
  padding: 24px 28px;
}

.aiPlaceholder {
  color: #6b7280;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
  max-width: 40ch;
}
@keyframes aiBreath {
  0% {
    box-shadow:
      0 8px 20px rgba(126, 86, 9, 0.18),
      0 0 0 0 rgba(255, 211, 77, 0.26);
  }
  50% {
    box-shadow:
      0 10px 24px rgba(126, 86, 9, 0.22),
      0 0 0 14px rgba(255, 211, 77, 0.16);
  }
  100% {
    box-shadow:
      0 8px 20px rgba(126, 86, 9, 0.18),
      0 0 0 0 rgba(255, 211, 77, 0.26);
  }
}
.aiHeaderRow {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.aiHeaderLeft {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  flex: 1 1 420px;
}

.aiButton {
  flex-shrink: 0;
  align-self: flex-start;
}

.aiHeaderRow .askAiPill {
  flex-shrink: 0;
  align-self: flex-start;
}

.aiHeaderRow .askAiPill.firstVisitAiHintActive {
  animation: aiBreath 1.85s ease-in-out infinite;
}

/* Keep Explore section headings on a shared type scale */
.exploreHeaderText h1,
.insightsHeader h2,
.aiTitle {
  font-family: "Metropolis", "Poppins", Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.insightsSub {
  font-size: 14px;
  line-height: 1.45;
}

/* ============================= */
/* Portzo AI — text consistency */
/* ============================= */

#aiResponse,
#aiResponse p,
#aiResponse span,
#aiResponse strong {
  font-size: 15px;
  line-height: 1.6;
}

/* Bold should NOT change size */
#aiResponse strong {
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  .aiHeaderRow .askAiPill.firstVisitAiHintActive,
  .aiButton {
    animation: none !important;
    transition: none !important;
  }

  .aiLoadingBarFill {
    animation: none !important;
  }
}

@media (max-width: 1100px) {
  .aiHeaderRow {
    gap: 10px;
  }

  .exploreHeaderText h1,
  .insightsHeader h2,
  .aiTitle {
    font-size: 22px;
  }

  .aiTitle {
    white-space: nowrap;
  }

  .aiButton {
    margin: 6px auto 0;
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 10px;
  }

  .aiLoadingTitle {
    font-size: 14px;
  }

  .aiLoadingHint {
    font-size: 13px;
  }

  .aiLoadingLogo {
    width: 38px;
    height: 38px;
  }
}

@media (max-width: 940px) {
  .exploreHeaderText h1,
  .insightsHeader h2,
  .aiTitle {
    font-size: 30px;
  }

  .aiHeaderRow {
    align-items: flex-start;
  }

  .aiButton {
    align-self: center;
    margin-top: 8px;
  }
}

@keyframes aiLoadingBarSweep {
  0% {
    transform: translateX(-115%);
  }
  100% {
    transform: translateX(265%);
  }
}

/* Final mobile tidy-up pass for Explore. Keep this last so it wins older mobile rules. */
@media (max-width: 760px) {
  #exploreApp {
    margin-top: calc(34px + env(safe-area-inset-top, 0px));
  }

  #centerColumn {
    gap: 14px;
  }

  .card,
  .compareCard.unifiedCompare,
  .insightsCard,
  .aiPanel {
    border-radius: 22px;
    border: 1px solid rgba(15, 23, 42, 0.05);
    background:
      linear-gradient(180deg, rgba(255,255,255,0.96), rgba(247,249,248,0.94));
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.8),
      0 14px 34px rgba(16,24,40,0.06);
  }

  .exploreHeaderRow {
    gap: 12px;
    margin-bottom: 14px;
    padding-top: 4px;
  }

  .exploreHeaderText {
    overflow: visible;
    padding-top: 4px;
  }

  .exploreHeaderText h1 {
    font-size: 31px;
    line-height: 1.28;
    letter-spacing: 0;
    padding-block: 12px 4px;
    margin-bottom: 6px;
    overflow: visible;
  }

  .exploreHeaderText p {
    font-size: 13px;
    line-height: 1.45;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    max-width: 34ch;
    color: rgba(102, 112, 133, 0.92);
  }

  .compareSearchWrap {
    width: 100%;
    margin-bottom: 0;
  }

  #compareSearchInput {
    height: 52px;
    padding: 0 48px 0 18px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255,255,255,0.82);
    font-size: 15px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.74);
  }

  .compareAddIcon {
    right: 16px;
    font-size: 34px;
    color: #6da286;
  }

  .compareCard.unifiedCompare {
    margin-top: -10px;
    margin-left: -10px;
    margin-right: -10px;
    overflow: hidden;
  }

  .exploreToolbar {
    padding: 14px 10px 10px;
    gap: 10px;
    align-items: center;
    border-bottom: 1px solid rgba(16,24,40,0.05);
  }

  .toolbarLeft {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .toolbarRight {
    flex: 0 0 auto;
    gap: 8px;
  }

  #chartAskAiPill {
    order: 4;
  }

  .exploreShareWrap {
    order: 2;
  }

  .exploreRangeMobileWrap {
    display: inline-flex;
    order: 3;
  }

  .rangeDock {
    display: none;
  }

  .filterPill,
  .range {
    border-radius: 999px !important;
  }

  #topTenToggle {
    min-height: 40px;
    padding: 0 14px;
    background: rgba(236, 245, 240, 0.92);
    color: #2f6f5a;
    border: 1px solid rgba(63,143,111,0.18);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.72);
  }

  .topTenToggleDivider {
    height: 16px;
    opacity: 0.18;
  }

  #topTenFilters {
    top: calc(100% + 8px);
    left: 0;
    width: auto;
    max-width: calc(100vw - 56px);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 12px;
    gap: 10px;
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255,255,255,0.96);
    box-shadow: 0 18px 34px rgba(16,24,40,0.12);
  }

  #topTenFilters .filterPill {
    width: 178px;
    max-width: calc(100vw - 104px);
    min-height: 44px;
    min-width: 0;
    padding: 0 16px;
    justify-content: flex-start;
    font-size: 14px;
  }

  #topTenFilters select.filterPill {
    padding: 0 38px 0 16px;
    background-position:
      calc(100% - 18px) 50%,
      calc(100% - 13px) 50%;
    background-size: 5px 5px;
  }

  #topTenFilters .topTenFilterField.has-active-filter select.filterPill {
    padding-right: 62px;
    background-position:
      calc(100% - 42px) 50%,
      calc(100% - 37px) 50%;
  }

  #topTenFilters .topTenFilterClearBtn {
    right: 12px;
  }

  #topTenFilters .topTenFilterField.has-multiple-filter {
    min-width: 214px;
    max-width: calc(100vw - 104px);
  }

  #topTenFilters .topTenFilterField.has-multiple-filter .filterPill {
    width: 214px;
    max-width: calc(100vw - 104px);
  }

  #topTenFilters .topTenFilterField.has-active-filter .topTenFilterClearBtn {
    display: inline-flex;
  }

  #topTenRange {
    font-weight: 700;
  }

  .range {
    padding: 3px;
    gap: 3px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 8px 18px rgba(16,24,40,0.06);
  }

  .range button {
    min-width: 38px;
    padding: 7px 10px;
    font-size: 11px;
    font-weight: 600;
  }

  .askAiPill {
    height: 40px;
    padding: 0 14px;
    font-size: 12px;
    font-weight: 620;
    background: linear-gradient(180deg, #3f8f6f 0%, #34785d 100%);
    border-color: rgba(255,255,255,0.45);
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.12),
      0 12px 24px rgba(63, 143, 111, 0.22);
  }

  .exploreSharePopover {
    right: 0;
    left: auto;
  }

  .exploreShareField {
    flex-direction: column;
    align-items: stretch;
  }

  .exploreShareCopyBtn {
    width: 100%;
  }

  @media (max-width: 640px) {
    .exploreSharePopover {
      position: fixed;
      top: var(--explore-share-popover-top, 140px);
      left: 50%;
      right: auto;
      transform: translateX(-50%);
      width: min(360px, calc(100vw - 24px));
      max-width: calc(100vw - 24px);
      box-sizing: border-box;
    }
  }

  #chartWrap {
    height: 348px;
    margin-left: 0;
    margin-right: 0;
  }

  .chartFloatingTitle {
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
  }

  #chartTitle {
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.72);
    background: rgba(255,255,255,0.62);
    box-shadow: 0 6px 16px rgba(16,24,40,0.05);
    font-size: 13px;
    font-weight: 600;
    color: #475467;
    letter-spacing: -0.01em;
    max-width: min(calc(100vw - 112px), 336px);
    justify-content: center;
    white-space: nowrap;
    text-align: center;
  }

  #chartTitle .info-icon {
    flex: 0 0 auto;
  }

  .chartTitleText {
    display: inline-flex;
    align-items: center;
    gap: 0;
    min-width: 0;
    flex: 1 1 auto;
  }

  .chartTitlePrimary {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
    max-width: 100%;
  }

  .chartTitleSecondary {
    display: none;
  }

  .tableSection {
    position: relative;
    padding: 0;
  }

  .tableSection::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 24px;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.92));
  }

  #compareTableWrap {
    margin-left: 0;
    margin-right: 0;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(63, 143, 111, 0.45) rgba(15, 23, 42, 0.06);
    padding-bottom: 6px;
    touch-action: pan-x pan-y;
  }

  #compareTableWrap::-webkit-scrollbar {
    display: block;
    height: 6px;
  }

  #compareTableWrap::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.06);
    border-radius: 999px;
  }

  #compareTableWrap::-webkit-scrollbar-thumb {
    background: rgba(63, 143, 111, 0.45);
    border-radius: 999px;
  }

  #compareTableWrap.scrollHintActive {
    box-shadow: inset -18px 0 22px -22px rgba(63, 143, 111, 0.34);
  }

  #compareTableWrap.scrollHintActive::after {
    content: "← swipe →";
    position: absolute;
    right: 12px;
    bottom: 14px;
    z-index: 3;
    pointer-events: none;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(63, 143, 111, 0.14);
    color: rgba(63, 143, 111, 0.9);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 6px 14px rgba(16, 24, 40, 0.06);
    animation: exploreSwipeHintPulse 900ms ease-in-out 1;
  }

  @keyframes exploreSwipeHintPulse {
    0% {
      opacity: 0;
      transform: translateX(8px);
    }
    25% {
      opacity: 1;
      transform: translateX(0);
    }
    60% {
      opacity: 1;
      transform: translateX(-4px);
    }
    100% {
      opacity: 0.9;
      transform: translateX(0);
    }
  }

  .compareTable {
    min-width: 920px;
    font-size: 13px;
  }

  .compareTable tbody tr:not(.compareTableEmptyRow) > td:first-child {
    display: none;
  }

  .compareTable thead th.tableResetHeader {
    position: relative;
    overflow: visible;
    width: 78px;
    min-width: 78px;
    max-width: 78px;
    padding-left: 4px;
    padding-right: 2px;
    text-align: left !important;
  }

  .compareTable thead th.tableResetHeader.hasSocialExport {
    width: 78px;
    min-width: 78px;
    max-width: 78px;
  }

  .tableResetControls {
    gap: 4px;
  }

  .exploreSocialExportBtn,
  .exploreResetBtn {
    width: 22px;
    min-width: 22px;
    height: 22px;
    padding: 0;
    font-size: 11px;
  }

  #compare.compareSelectionActive .compareTable tbody tr:not(.compareTableEmptyRow) > td:first-child {
    display: table-cell;
    width: 28px;
    min-width: 28px;
    max-width: 28px;
    padding-left: 6px;
    padding-right: 4px;
  }

  .compareTable thead th {
    padding: 14px 10px;
    font-size: 11px;
    font-weight: 650;
    color: #667085;
  }

  .compareTable td {
    height: 58px;
    padding: 10px 10px;
  }

  #compareTableBody .removeBtn {
    display: none !important;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font-size: 13px;
    color: #98a2b3;
  }

  #compare.compareSelectionActive #compareTableBody .removeBtn {
    display: inline-flex !important;
  }

  .compareTable thead th:nth-child(3),
  .compareTable tbody td:nth-child(3) {
    width: 220px;
    min-width: 220px;
    padding-left: 8px;
    max-width: 220px;
  }

  .compareTable thead th:nth-child(4),
  .compareTable tbody td:nth-child(4) {
    width: 90px;
    min-width: 90px;
    max-width: 90px;
    padding-left: 4px;
    padding-right: 4px;
  }

  .compareTable tbody td:nth-child(4) .spark {
    margin-left: 0;
  }

  .compareTable canvas.spark {
    width: 84px;
  }

  .compareTable thead th:nth-child(n+7),
  .compareTable tbody td:nth-child(n+7) {
    width: 86px;
    min-width: 86px;
    max-width: 86px;
    padding-left: 6px;
    padding-right: 6px;
  }

  .compareTable thead th:nth-child(10),
  .compareTable tbody td:nth-child(10),
  .compareTable thead th:nth-child(11),
  .compareTable tbody td:nth-child(11) {
    width: 104px;
    min-width: 104px;
    max-width: 104px;
  }

  .compareTable thead th:last-child,
  .compareTable tbody td:last-child {
    padding-right: 14px;
  }

  .comparePerformancePill {
    min-width: 0;
    width: 100%;
  }

  .compareTable tbody tr:hover {
    background: transparent;
  }

  .compareDivider {
    margin: 0;
    background: rgba(16,24,40,0.05);
  }

  .insightsCard,
  .aiPanel {
    margin-top: 10px;
    padding: 20px 18px;
    margin-left: -10px;
    margin-right: -10px;
  }

  .aiPanel {
    margin-bottom: 8px;
  }

  .insightsHeader h2,
  .aiTitle {
    font-size: 30px;
    line-height: 1.06;
    letter-spacing: -0.03em;
  }

  .insightsSub,
  .aiPlaceholder {
    font-size: 13px;
    line-height: 1.5;
    color: rgba(102, 112, 133, 0.92);
    max-width: 28ch;
  }

  .insightsContent {
    flex-direction: column;
    gap: 14px;
    margin-top: 16px;
  }

  .insight {
    min-width: 0;
    width: 100%;
    flex: 1 1 100%;
    border-radius: 20px;
    padding: 18px 16px 16px;
    border-width: 1px;
  }

  .insightTitle {
    font-size: 17px;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
  }

  .insightText {
    font-size: 14px;
    line-height: 1.45;
  }

  .insightBadge {
    top: 16px;
    right: 16px;
    padding: 7px 11px;
    border-radius: 12px;
    font-size: 11px;
    letter-spacing: 0.08em;
  }

  .aiHeaderRow {
    align-items: center;
    gap: 12px;
  }

  .aiHeaderRow .askAiPill {
    min-height: 44px;
    padding: 0 18px;
    font-size: 14px;
    font-weight: 700;
  }

  .aiBadge {
    padding: 6px 12px;
    font-size: 11px;
    background: rgba(236, 245, 240, 0.92);
    color: #3d6f5c;
  }

.aiButton {
    min-height: 44px;
    padding: 0 18px;
    border-radius: 14px;
    font-size: 13px;
    border-color: rgba(36, 70, 53, 0.9);
    background: linear-gradient(180deg, #5d9b7c 0%, #467e66 100%);
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.18),
      0 12px 24px rgba(44, 84, 67, 0.18);
  }

  .aiLoadingState {
    padding: 14px 14px;
    border-radius: 16px;
  }

  #ai,
  #aiLoadingState,
  #aiResponse {
    scroll-margin-top: 132px;
  }

  .aiLoadingRow {
    align-items: flex-start;
    gap: 12px;
  }

  .aiLoadingTitle {
    font-size: 14px;
  }

  .aiLoadingHint {
    font-size: 13px;
  }

  .aiLoadingLogo {
    width: 36px;
    height: 36px;
  }
}

.topTenBrowseWrap {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 14px 8px 4px;
}

.topTenBrowseWrap.is-browsing {
  align-items: center;
}

.topTenBrowseRight {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  justify-self: start;
  width: max-content;
}

.topTenBrowseBtn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(63, 143, 111, 0.2);
  background: linear-gradient(180deg, #ffffff 0%, #f8fcfa 100%);
  color: #3f8f6f;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.01em;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  width: max-content;
}

#topTenPrevBtn {
  justify-self: end;
}

.topTenBrowseBtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
  border-color: rgba(63, 143, 111, 0.32);
}

.topTenBrowseBtn:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.topTenBrowseBtnSecondary {
  color: #5b667a;
  border-color: rgba(91, 102, 122, 0.14);
  background: #fff;
}

.topTenBrowseLabel {
  min-width: 84px;
  text-align: center;
  font-size: 13px;
  font-weight: 650;
  color: #64748b;
  justify-self: center;
}

.topTenBrowseWrap:not(.is-browsing) .topTenBrowseLabel,
.topTenBrowseWrap:not(.is-browsing) .topTenBrowseBtnSecondary {
  display: none;
}

.topTenBrowseArrow {
  font-size: 14px;
  line-height: 1;
}

.topTenBrowseMeta {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  letter-spacing: -0.01em;
  text-align: right;
}

.topTenBrowseWrap:not(.is-browsing) .topTenBrowseRight {
  grid-column: 2;
  justify-self: center;
  align-items: center;
}

.topTenBrowseWrap:not(.is-browsing) .topTenBrowseMeta {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}

.topTenBrowseWrap.is-browsing .topTenBrowseMeta {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}

@media (max-width: 560px) {
  .exploreBootHeader {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .exploreBootSearch {
    width: 100%;
  }

  .exploreBootCard {
    min-height: 360px;
    padding: 18px;
    border-radius: 16px;
  }

  .exploreBootToolbar {
    flex-wrap: wrap;
  }

  .exploreBootToolbar span,
  .exploreBootToolbar span:first-child {
    width: calc(50% - 6px);
    height: 38px;
  }

  .exploreBootChart {
    height: 260px;
  }

  .topTenToggleMode,
  .topTenToggleDivider,
  .exploreInfoInline {
    display: none !important;
  }

  .topTenBrowseWrap {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px 8px 6px;
  }

  .topTenBrowseWrap:not(.is-browsing) .topTenBrowseRight,
  .topTenBrowseWrap.is-browsing .topTenBrowseRight {
    grid-column: 1;
    justify-self: stretch;
    width: 100%;
    align-items: stretch;
  }

  .topTenBrowseWrap:not(.is-browsing) .topTenBrowseMeta,
  .topTenBrowseWrap.is-browsing .topTenBrowseMeta {
    position: static;
    transform: none;
    width: 100%;
    margin-top: 2px;
    text-align: center;
  }

  .topTenBrowseWrap:not(.is-browsing) .topTenBrowseBtn,
  .topTenBrowseWrap.is-browsing .topTenBrowseBtn {
    width: 100%;
    justify-content: center;
  }

  .topTenBrowseWrap.is-browsing .topTenBrowseLabel,
  .topTenBrowseWrap.is-browsing #topTenPrevBtn {
    grid-column: 1;
    justify-self: stretch;
    width: 100%;
    text-align: center;
  }

  #topTenToggle {
    gap: 6px;
    padding: 0 12px;
  }

  #topTenToggle.active .chevron {
    display: none;
  }

  #topTenToggle.active .topTenToggleClose {
    display: inline-block;
  }
}

/* iOS app-shell safeguard: prevent Safari/WebView from clipping the top of
   the Explore heading glyph box on narrow screens. Keep this last so it wins. */
@supports (-webkit-touch-callout: none) {
  @media (max-width: 940px) {
    #exploreApp {
      margin-top: 0;
    }

    #centerColumn {
      padding-top: 0;
    }

    .exploreHeaderRow {
      padding-top: 0;
    }

    html.portzo-app-shell .exploreHeaderText,
    body.portzo-app-shell .exploreHeaderText {
      padding-top: 0;
    }

    html.portzo-app-shell #exploreApp,
    body.portzo-app-shell #exploreApp {
      margin-top: 0;
    }

    html.portzo-app-shell .exploreHeaderRow,
    body.portzo-app-shell .exploreHeaderRow {
      padding-top: 0;
    }

    .exploreHeaderText {
      overflow: visible;
      padding-top: 4px;
    }

    html.portzo-app-shell .exploreHeaderText h1,
    body.portzo-app-shell .exploreHeaderText h1 {
      display: block;
      line-height: 1.28;
      padding-block: 12px 4px;
      overflow: visible;
    }

    .exploreHeaderText h1 {
      display: block;
      line-height: 1.28;
      padding-block: 12px 4px;
      overflow: visible;
    }
  }
}

@media (max-width: 940px) {
  body.exploreOnly.mobile-bottom-nav-active #explore,
  body.exploreOnly.mobile-bottom-nav-active #exploreApp {
    background: #ffffff !important;
  }

  body.exploreOnly.mobile-bottom-nav-active .mobileBottomNav::after {
    content: "";
    position: fixed;
    left: 0;
    right: 0;
    bottom: -48px;
    height: calc(48px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, rgba(39, 72, 57, 0.96), rgba(39, 72, 57, 0.96));
    pointer-events: none;
  }

  #chartAskAiPill {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}

@media (max-width: 940px) and (orientation: landscape) {
  html,
  body.exploreOnly,
  body.exploreOnly.portzo-app-shell {
    overflow: hidden !important;
    overscroll-behavior: none;
  }

  body.exploreOnly #topTenToggle.active .chevron {
    display: none;
  }

  body.exploreOnly #topTenToggle.active .topTenToggleClose {
    display: inline-block;
  }

  body.exploreOnly #navMount .nav,
  body.exploreOnly #navMount .mobileBottomNav,
  body.exploreOnly .mobileBottomNav,
  body.exploreOnly.compare-expanded #navMount .mobileBottomNav,
  body.exploreOnly.compare-expanded .mobileBottomNav {
    display: none !important;
  }

  body.exploreOnly,
  body.exploreOnly.portzo-app-shell {
    padding-bottom: 0 !important;
  }

  body.exploreOnly #exploreApp,
  body.exploreOnly.portzo-app-shell #exploreApp {
    margin-top: 0 !important;
  }

  body.exploreOnly #compare.compareExpanded {
    position: fixed;
    inset: 0;
    z-index: 3000;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    margin: 0 !important;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    background: #ffffff;
  }

  body.exploreOnly #compare.compareExpanded .exploreToolbar {
    flex: 0 0 auto;
    position: relative;
    top: auto;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(16,24,40,.08);
  }

  body.exploreOnly #compare.compareExpanded #compareExpandBtn {
    display: none !important;
  }

  body.exploreOnly #compare.compareExpanded #chartWrap {
    flex: 0 0 calc(100vh - 56px);
    flex-basis: calc(100dvh - 56px);
    height: calc(100vh - 56px) !important;
    height: calc(100dvh - 56px) !important;
    min-height: 260px;
    max-height: none;
    overflow: hidden;
  }

  body.exploreOnly #compare.compareExpanded .chartFloatingTitle {
    z-index: 80;
  }

  body.exploreOnly #compare.compareExpanded #chartTitle.info-wrap .info-tooltip {
    position: absolute;
    top: calc(100% + 8px);
    bottom: auto;
    z-index: 3200;
  }

  body.exploreOnly #compare.compareExpanded .tableSection {
    flex: 0 0 auto;
    min-height: 0;
    padding: 0 10px 4px;
    overflow: visible;
    overscroll-behavior: contain;
  }

  body.exploreOnly #compare.compareExpanded #compareTableWrap {
    width: 100%;
    min-height: 0;
    height: auto;
    max-height: none;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-x pan-y;
  }

  body.exploreOnly #compare.compareExpanded .compareTable thead th:first-child,
  body.exploreOnly #compare.compareExpanded .compareTable tbody tr:not(.compareTableEmptyRow) > td:first-child {
    display: table-cell;
    width: 28px;
    min-width: 28px;
    max-width: 28px;
    padding-left: 6px;
    padding-right: 4px;
  }

  body.exploreOnly #compare.compareExpanded #compareTableBody .removeBtn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font-size: 13px;
    color: #98a2b3;
  }
}

/* Stronger mobile swipe hint for the compare table */
@media (max-width: 680px) {
  .compareSearchWrap.firstVisitHintActive {
    position: relative;
  }

  .compareSearchWrap.firstVisitHintActive #compareSearchInput {
    border-color: rgba(245, 188, 38, 0.78) !important;
    background:
      linear-gradient(#fff, #fff) padding-box,
      linear-gradient(135deg, rgba(255, 221, 94, 0.95), rgba(232, 160, 17, 0.88)) border-box !important;
    box-shadow:
      0 0 0 4px rgba(255, 211, 77, 0.22),
      0 0 26px rgba(245, 188, 38, 0.34),
      0 12px 28px rgba(162, 114, 15, 0.16) !important;
  }

  .compareSearchWrap.firstVisitHintActive::after {
    content: "Add funds to chart" !important;
    position: absolute;
    left: 50% !important;
    top: -12px !important;
    transform: translateX(-50%) !important;
    padding: 7px 12px !important;
    border-radius: 999px !important;
    background: linear-gradient(180deg, rgba(255, 225, 104, 0.98) 0%, rgba(239, 174, 24, 0.98) 100%) !important;
    border: 1px solid rgba(255, 238, 156, 0.86) !important;
    color: #332400 !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    letter-spacing: 0.02em !important;
    box-shadow:
      0 0 0 4px rgba(255, 211, 77, 0.16),
      0 0 28px rgba(245, 188, 38, 0.48),
      0 12px 26px rgba(126, 86, 9, 0.22) !important;
    z-index: 4 !important;
    pointer-events: none !important;
    animation: exploreSwipeHintPulse 2.8s ease-out forwards !important;
  }

  #compareTableWrap.scrollHintActive::after {
    content: "<- SWIPE ->" !important;
    left: 50% !important;
    right: auto !important;
    bottom: 58px !important;
    padding: 8px 14px !important;
    border-radius: 999px !important;
    background: linear-gradient(180deg, rgba(255, 225, 104, 0.98) 0%, rgba(239, 174, 24, 0.98) 100%) !important;
    border: 1px solid rgba(255, 238, 156, 0.86) !important;
    color: #332400 !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    letter-spacing: 0.08em !important;
    box-shadow:
      0 0 0 5px rgba(255, 211, 77, 0.18),
      0 0 32px rgba(245, 188, 38, 0.5),
      0 12px 28px rgba(126, 86, 9, 0.24) !important;
    transform: translateX(-50%) translateY(4px) !important;
    animation-duration: 2.75s !important;
    z-index: 4 !important;
  }
}
/* Keep the explore chart title info icon tappable above the canvas on mobile */
@media (max-width: 680px) {
  .chartTitle,
  .chartTitlePill,
  .chartTitleInfo,
  .chartTitleInfoBtn,
  #exploreChartTitle,
  #exploreChartTitle .infoIcon {
    pointer-events: auto !important;
  }

  .chartTitle,
  .chartTitlePill,
  #exploreChartTitle {
    position: relative;
    z-index: 6 !important;
  }

  .chartTitleInfo,
  .chartTitleInfoBtn,
  #exploreChartTitle .infoIcon {
    position: relative;
    z-index: 7 !important;
    touch-action: manipulation;
    cursor: pointer;
  }
}

/* Disabled: this card layout broke the app Explore comparison table on mobile. */
@media (max-width: 0px) {
  .tableSection {
    padding: 0 12px 14px;
  }

  .tableSection::after,
  #compareTableWrap.scrollHintActive::after {
    display: none;
  }

  #compareTableWrap {
    overflow: visible;
    padding-bottom: 0;
  }

  .compareTable,
  .compareTable thead,
  .compareTable tbody,
  .compareTable tr,
  .compareTable th,
  .compareTable td {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    box-sizing: border-box;
  }

  .compareTable {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
  }

  .compareTable thead {
    display: none;
  }

  .compareTable tbody {
    display: grid;
    gap: 10px;
  }

  .compareTable tbody tr:not(.compareTableEmptyRow) {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(112px, 34%);
    grid-template-areas:
      "fund action"
      "provider trend"
      "risk trend";
    gap: 9px 12px;
    height: auto;
    min-height: 0;
    padding: 14px;
    border: 1px solid rgba(16, 24, 40, 0.08);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(16, 24, 40, 0.045);
  }

  .compareTable tbody tr.active {
    background: rgba(63, 143, 111, 0.06);
    border-color: rgba(63, 143, 111, 0.22);
    box-shadow: inset 3px 0 0 var(--pz-focus), 0 8px 22px rgba(16, 24, 40, 0.045);
  }

  .compareTable tbody tr:not(.compareTableEmptyRow) > td {
    height: auto;
    padding: 0;
    border: 0;
    text-align: left;
  }

  .compareTable tbody tr:not(.compareTableEmptyRow) > td:nth-child(1) {
    grid-area: action;
    display: flex !important;
    justify-content: flex-end;
    align-items: flex-start;
  }

  .compareTable tbody tr:not(.compareTableEmptyRow) > td:nth-child(2) {
    display: none !important;
  }

  .compareTable tbody tr:not(.compareTableEmptyRow) > td:nth-child(3) {
    grid-area: fund;
    align-self: start;
    padding: 0;
    white-space: normal;
    overflow: visible;
  }

  .compareTable tbody tr:not(.compareTableEmptyRow) > td:nth-child(4) {
    grid-area: trend;
    display: flex;
    justify-content: flex-end;
    align-items: center;
  }

  .compareTable tbody tr:not(.compareTableEmptyRow) > td:nth-child(5) {
    grid-area: provider;
    display: inline-flex;
    width: auto !important;
    min-width: 0 !important;
    vertical-align: middle;
  }

  .compareTable tbody tr:not(.compareTableEmptyRow) > td:nth-child(6) {
    grid-area: risk;
    display: inline-flex;
    width: auto !important;
    min-width: 0 !important;
    align-items: center;
    vertical-align: middle;
    color: #64748b;
    font-weight: 700;
  }

  .compareTable tbody tr:not(.compareTableEmptyRow) > td:nth-child(6)::before {
    content: "Risk ";
    margin-right: 3px;
    color: #98a2b3;
    font-size: 11px;
    font-weight: 650;
    text-transform: uppercase;
  }

  .compareTable tbody tr:not(.compareTableEmptyRow) > td:nth-child(n+7) {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    min-height: 34px;
    padding: 7px 8px;
    border-radius: 8px;
    background: #f8fafc;
  }

  .compareTable tbody tr:not(.compareTableEmptyRow) > td:nth-child(7) {
    grid-column: 1;
    grid-row: 4;
  }

  .compareTable tbody tr:not(.compareTableEmptyRow) > td:nth-child(8) {
    grid-column: 2;
    grid-row: 4;
  }

  .compareTable tbody tr:not(.compareTableEmptyRow) > td:nth-child(9) {
    grid-column: 1;
    grid-row: 5;
  }

  .compareTable tbody tr:not(.compareTableEmptyRow) > td:nth-child(10) {
    grid-column: 2;
    grid-row: 5;
  }

  .compareTable tbody tr:not(.compareTableEmptyRow) > td:nth-child(11) {
    grid-column: 1 / -1;
    grid-row: 6;
  }

  .compareTable tbody tr:not(.compareTableEmptyRow) > td:nth-child(7)::before { content: "1Y"; }
  .compareTable tbody tr:not(.compareTableEmptyRow) > td:nth-child(8)::before { content: "3Y"; }
  .compareTable tbody tr:not(.compareTableEmptyRow) > td:nth-child(9)::before { content: "5Y"; }
  .compareTable tbody tr:not(.compareTableEmptyRow) > td:nth-child(10)::before { content: "CAGR 3Y"; }
  .compareTable tbody tr:not(.compareTableEmptyRow) > td:nth-child(11)::before { content: "CAGR 5Y"; }

  .compareTable tbody tr:not(.compareTableEmptyRow) > td:nth-child(n+7)::before {
    color: #667085;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.02em;
  }

  .fundNameMarquee {
    white-space: normal;
  }

  .fundNameText {
    display: -webkit-box;
    max-width: 100%;
    overflow: hidden;
    color: #111827;
    font-size: 15px;
    font-weight: 650;
    line-height: 1.3;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .fundNameMarquee.is-overflowing:hover .fundNameText {
    animation: none;
  }

  .providerPill {
    max-width: 148px;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 4px 9px;
    font-size: 11px;
  }

  .compareTable canvas.spark {
    width: 96px;
    height: 28px;
  }

  .comparePerformancePill {
    min-width: 0;
    font-size: 13px;
  }

  #compareTableBody .pill-topten,
  #compareTableBody .pill-added,
  #compareTableBody .pill-portfolio {
    display: inline-flex !important;
  }

  #compareTableBody .removeBtn {
    display: inline-flex !important;
  }

  .removeCell {
    min-height: 28px;
    gap: 6px;
  }

  .removeBtn,
  .removeSpacer {
    width: 22px;
    height: 22px;
  }

  .compareTableEmptyRow > td[colspan] {
    display: block !important;
    padding: 20px 12px !important;
  }
}

/* Disabled: the earlier mobile table rules are the intended layout. */
@media (max-width: 0px) {
  .tableSection {
    padding: 6px 10px 12px;
  }

  .tableSection::after,
  #compareTableWrap.scrollHintActive::after {
    display: block;
  }

  #compareTableWrap {
    display: block;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  .compareTable {
    display: table;
    width: 100%;
    min-width: 940px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
  }

  .compareTable thead {
    display: table-header-group;
  }

  .compareTable tbody {
    display: table-row-group;
  }

  .compareTable tr {
    display: table-row;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
  }

  .compareTable th,
  .compareTable td {
    display: table-cell;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    box-sizing: border-box;
  }

  .compareTable tbody tr:not(.compareTableEmptyRow) {
    position: static;
    height: 58px;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .compareTable tbody tr.active {
    background: var(--pz-row-active, rgba(63, 143, 111, 0.08));
    border-color: transparent;
    box-shadow: none;
  }

  .compareTable tbody tr:not(.compareTableEmptyRow) > td {
    height: 58px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border, rgba(16, 24, 40, 0.08));
    text-align: left;
    vertical-align: middle;
  }

  .compareTable tbody tr:not(.compareTableEmptyRow) > td:nth-child(n+7) {
    display: table-cell;
    min-height: 0;
    padding: 10px 12px;
    border-radius: 0;
    background: transparent;
  }

  .compareTable tbody tr:not(.compareTableEmptyRow) > td:nth-child(n+7)::before,
  .compareTable tbody tr:not(.compareTableEmptyRow) > td:nth-child(6)::before {
    content: none !important;
  }

  .compareTable thead th.tableResetHeader {
    display: table-cell;
    position: relative;
    overflow: visible;
    width: 104px !important;
    min-width: 104px !important;
    max-width: 104px !important;
    padding-left: 6px;
    padding-right: 4px;
  }

  .compareTable tbody tr:not(.compareTableEmptyRow) > td:first-child {
    display: none;
  }

  #compare.compareSelectionActive .compareTable tbody tr:not(.compareTableEmptyRow) > td:first-child {
    display: table-cell;
    width: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    padding-right: 4px;
  }

  .compareTable thead th:nth-child(2),
  .compareTable tbody td:nth-child(2) {
    display: none;
  }

  .compareTable thead th:nth-child(3),
  .compareTable tbody td:nth-child(3) {
    display: table-cell;
    width: 228px !important;
    min-width: 228px !important;
    max-width: 228px !important;
    padding-left: 8px;
    white-space: normal;
    overflow: hidden;
  }

  .compareTable thead th:nth-child(4),
  .compareTable tbody td:nth-child(4) {
    display: table-cell;
    width: 110px !important;
    min-width: 110px !important;
    max-width: 110px !important;
    padding-left: 8px;
    padding-right: 8px;
  }

  .compareTable tbody td:nth-child(4) .spark,
  .compareTable canvas.spark {
    width: 96px;
    height: 28px;
    margin-left: 0;
  }

  .fundNameMarquee {
    white-space: nowrap;
  }

  .fundNameText {
    display: block;
    max-width: 210px;
    overflow: hidden;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    text-overflow: ellipsis;
    white-space: nowrap;
    -webkit-line-clamp: initial;
  }

  .providerPill {
    max-width: 120px;
    padding: 3px 8px;
    font-size: 11px;
  }

  #compareTableBody .pill-topten,
  #compareTableBody .pill-added,
  #compareTableBody .pill-portfolio,
  #compareTableBody .removeBtn {
    display: none !important;
  }

  .compareTableEmptyRow > td[colspan] {
    display: table-cell !important;
    padding: 16px 12px !important;
  }
}

/* Mobile rollback: keep desktop compare controls, but restore the pre-compare
   table shape on phones while compare is reintroduced gradually. */
@media (max-width: 940px) {
  .tableSection {
    padding: 0;
  }

  .tableSection::after {
    display: none;
  }

  #compareTableWrap {
    display: block;
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    padding-bottom: 0;
    -webkit-overflow-scrolling: touch;
  }

  .compareTable {
    display: table;
    width: 100%;
    min-width: 660px !important;
    border-collapse: collapse;
    border-spacing: 0;
    table-layout: fixed;
    font-size: 12px;
  }

  .compareTable thead {
    display: table-header-group !important;
  }

  .compareTable tbody {
    display: table-row-group !important;
  }

  .compareTable tr {
    display: table-row !important;
  }

  .compareTable th,
  .compareTable td {
    display: table-cell;
    box-sizing: border-box;
  }

  .compareTable tbody tr:not(.compareTableEmptyRow) {
    display: table-row !important;
    height: 58px;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .compareTable tbody tr:not(.compareTableEmptyRow) > td {
    height: 58px;
    padding: 9px 8px;
    border-bottom: 1px solid rgba(16, 24, 40, 0.08);
    text-align: center;
    vertical-align: middle;
  }

  .compareTable thead th.tableResetHeader,
  .compareTable thead th.tableResetHeader.hasSocialExport {
    display: none !important;
  }

  #compare.compareSelectionActive .compareTable thead th.tableResetHeader,
  #compare.compareSelectionActive .compareTable thead th.tableResetHeader.hasSocialExport {
    display: table-cell !important;
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    padding: 0 !important;
  }

  .compareTable thead th.tableResetHeader .tableResetControls,
  .compareTable thead th.tableResetHeader .exploreSocialExportBtn,
  .compareTable thead th.tableResetHeader .exploreResetBtn,
  .compareTable thead th.tableResetHeader .exploreCompareBtn {
    display: none !important;
  }

  #compare.compareSelectionActive .compareTable tbody tr:not(.compareTableEmptyRow) > td:first-child,
  .compareTable tbody tr:not(.compareTableEmptyRow) > td:first-child {
    display: none !important;
  }

  #compare.compareSelectionActive .compareTable tbody tr:not(.compareTableEmptyRow) > td:first-child {
    display: table-cell !important;
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    padding: 9px 4px !important;
    text-align: center;
  }

  #compare.compareSelectionActive .removeCell {
    align-items: center;
    justify-content: center;
    gap: 0;
  }

  #compare.compareSelectionActive #compareTableBody .compareStarBtn {
    display: inline-grid !important;
    width: 28px;
    height: 28px;
    font-size: 20px;
  }

  .compareTable thead th:nth-child(2),
  .compareTable tbody td:nth-child(2) {
    display: table-cell !important;
    width: 30px !important;
    min-width: 30px !important;
    max-width: 30px !important;
    padding-left: 6px !important;
    padding-right: 4px !important;
  }

  .compareTable thead th:nth-child(3),
  .compareTable tbody td:nth-child(3) {
    display: table-cell !important;
    width: 230px !important;
    min-width: 230px !important;
    max-width: 230px !important;
    padding-left: 10px !important;
    padding-right: 8px !important;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
  }

  .compareTable thead th:nth-child(3) {
    text-align: left;
    padding-left: 10px !important;
  }

  .compareTable thead th:nth-child(4),
  .compareTable tbody td:nth-child(4) {
    display: table-cell !important;
    width: 96px !important;
    min-width: 96px !important;
    max-width: 96px !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
    text-align: center;
  }

  .compareTable thead th:nth-child(5),
  .compareTable tbody td:nth-child(5) {
    display: table-cell !important;
    width: 122px !important;
    min-width: 122px !important;
    max-width: 122px !important;
    text-align: center;
  }

  .compareTable thead th:nth-child(6),
  .compareTable tbody td:nth-child(6) {
    display: table-cell !important;
    width: 64px !important;
    min-width: 64px !important;
    max-width: 64px !important;
    text-align: center;
  }

  .compareTable thead th:nth-child(n+7),
  .compareTable tbody td:nth-child(n+7) {
    display: table-cell !important;
    width: 70px !important;
    min-width: 70px !important;
    max-width: 70px !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
    text-align: center;
  }

  .compareTable thead th[data-key] {
    padding-right: 6px !important;
  }

  .compareTable thead th[data-key]::after,
  .compareTable thead th.sorted::after,
  .compareTable thead th.sorted.desc::after {
    content: none !important;
    display: none !important;
  }

  .compareTable tbody tr:not(.compareTableEmptyRow) > td:nth-child(n+7)::before,
  .compareTable tbody tr:not(.compareTableEmptyRow) > td:nth-child(6)::before {
    content: none !important;
  }

  .compareTable canvas.spark {
    width: 84px !important;
    height: 24px !important;
    margin: 0 auto !important;
  }

  .fundNameMarquee {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0;
    white-space: nowrap;
    text-align: left;
  }

  .fundNameText {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0;
    overflow: hidden;
    color: inherit;
    font-size: inherit;
    font-weight: 500;
    line-height: inherit;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    -webkit-line-clamp: initial;
  }

  .providerPill {
    max-width: 108px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #compareTableBody .pill-topten,
  #compareTableBody .pill-added,
  #compareTableBody .pill-portfolio {
    display: none !important;
  }

  #compare.compareSelectionActive #compareTableBody .removeBtn,
  #compareTableBody .removeBtn {
    display: none !important;
  }

  .mobileTableActions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 10px 12px 12px;
    border-top: 1px solid rgba(16, 24, 40, 0.06);
    background: #ffffff;
  }

  .mobileTableActionBtn {
    width: auto;
    height: 30px;
    min-width: 0;
    padding: 0 11px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
  }

  .mobileTableActions .exploreResetBtn.hidden {
    display: none !important;
  }

  .mobileTableActions #mobileExploreResetBtn:not(.hidden) {
    display: inline-flex !important;
  }

  .mobileTableActions .exploreResetBtn,
  .mobileTableActions .exploreCompareBtn,
  .mobileTableActions #exploreSocialExportBottomBtn {
    width: 74px;
    min-width: 74px;
    max-width: 74px;
    height: 30px;
    padding: 0 8px;
    font-size: 11px;
    line-height: 1;
    flex: 0 0 74px;
    justify-content: center;
    white-space: nowrap;
  }

  .mobileTableActions #exploreSocialExportBottomBtn::before {
    font-size: 11px;
  }

  .mobileTableActions #exploreSocialExportBottomBtn {
    font-size: 0;
  }
}
