/* ============================================================
   SCOPED â€” .altport-fl
   ============================================================ */
.altport-fl, .altport-fl *,
.altport-fl *::before, .altport-fl *::after { box-sizing: border-box; }

.altport-fl {
  --altp-orange:#E57B28;
  --altp-orange-dark:#C76916;
  --altp-orange-soft:#FFF1E5;
  --altp-navy:#1A2B3C;
  --altp-navy-2:#2D4054;
  --altp-gold:#C5A059;
  --altp-gold-soft:#F5EBD8;
  --altp-cream:#FAF7F2;
  --altp-white:#FFFFFF;
  --altp-ink:#1A2B3C;
  --altp-ink-2:#4A5868;
  --altp-ink-3:#7A8898;
  --altp-line:#E8E2D6;
  --altp-line-2:#F0EAE0;
  --altp-pos:#1F8A4C;
  --altp-neg:#C0392B;
  --altp-shadow:0 1px 2px rgba(26,43,60,.04), 0 6px 18px rgba(26,43,60,.06);
  --altp-radius:14px;

  color:var(--altp-ink);
  /*background:var(--altp-cream);*/
  padding:36px 0;
  line-height:1.5;
  font-size:16px;
  -webkit-font-smoothing:antialiased;
}

.altport-fl__container {
  max-width:1320px;
  margin:0 auto;
  padding:0 24px;
}

/* ============================================================
   LAYOUT GRID
   ============================================================ */
.altport-fl__layout {
  display:grid;
  grid-template-columns:300px 1fr;
  gap:28px;
  align-items:flex-start;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.altport-fl__sidebar {
  position:sticky;
  top:120px;
  display:flex;
  flex-direction:column;
  gap:20px;
}

.altport-fl__compare-card {
  background:var(--altp-white);
  border:1px solid var(--altp-line);
  border-radius:var(--altp-radius);
  box-shadow:var(--altp-shadow);
  overflow:hidden;
}

.altport-fl__tabs {
  display:grid;
 /* grid-template-columns:1fr 1fr;*/
  border-bottom:1px solid var(--altp-line);
}

.altport-fl__tab {
  appearance:none;
  border:0;
  background:transparent;
  padding:16px 14px;
  font:600 16px/1 'Montserrat', sans-serif;
  color:var(--altp-ink-2);
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border-bottom:2px solid transparent;
  transition:color .18s ease, border-color .18s ease, background .18s ease;
}
.altport-fl__tab:hover { color:var(--altp-navy); }
.altport-fl__tab.is-active {
  color:var(--altp-navy);
  border-bottom-color:var(--altp-orange);
 /* background:var(--altp-orange-soft);*/
}
.altport-fl__tab svg { width:16px; height:16px; }
.altport-fl__tab-count {
  font-family:'JetBrains Mono', monospace;
  font-weight:600;
  font-size:16px;
  color:var(--altp-ink-3);
}

.altport-fl__compare-list {
  padding:8px 0;
  min-height:120px;
  max-height:260px;
  overflow-y:auto;
}

.altport-fl__compare-item {
  display:grid;
  grid-template-columns: 1fr 28px;
  align-items:center;
  gap:10px;
  padding:10px 14px;
  border-bottom:1px solid var(--altp-line-2);
  transition:background .15s ease;
}
.altport-fl__compare-item:last-child { border-bottom:0; }
.altport-fl__compare-item:hover { background:var(--altp-cream); }

.altport-fl__compare-logo {
  width:36px; height:36px;
  border-radius:8px;
  background:var(--altp-cream);
  border:1px solid var(--altp-line);
  display:grid; place-items:center;
  font:700 16px 'Montserrat', sans-serif;
  color:var(--altp-navy);
  letter-spacing:.02em;
  flex-shrink:0;
}

.altport-fl__compare-name {
  font-size:16px;
  font-weight:600;
  color:var(--altp-navy);
  line-height:1.3;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.altport-fl__compare-remove {
  appearance:none;
  border:0;
  background:transparent;
  width:28px; height:28px;
  padding:0;
  display:grid; place-items:center;
  cursor:pointer;
  color:var(--altp-orange);
  border-radius:50%;
  transition:background .15s ease, color .15s ease;
}
.altport-fl__compare-remove:hover {
  background:var(--altp-orange-soft);
  color:var(--altp-orange-dark);
}
.altport-fl__compare-remove svg { width:20px; height:20px; }

.altport-fl__compare-footer { padding:14px; }

.altport-fl__compare-btn {
  width:100%;
  appearance:none;
  border:0;
  background:var(--altp-navy);
  color:var(--altp-white);
  font:600 16px/1 'Montserrat', sans-serif;
  padding:14px 16px;
  border-radius:10px;
  cursor:pointer;
  transition:background .18s ease, transform .12s ease;
  letter-spacing:.01em;
}
.altport-fl__compare-btn:hover { background:#0F1C2A; }
.altport-fl__compare-btn:active { transform:translateY(1px); }

/* Schedule CTA */
.altport-fl__cta-card {
  background:var(--altp-white);
  border:1px solid var(--altp-line);
  border-radius:var(--altp-radius);
  box-shadow:var(--altp-shadow);
  padding:18px;
  text-align:center;
  position:relative;
  overflow:hidden;
}
.altport-fl__cta-card::before {
  content:"";
  position:absolute; left:0; top:0; right:0;
  height:3px;
  background:linear-gradient(90deg, var(--altp-gold) 0%, var(--altp-orange) 100%);
}
.altport-fl__cta-icon {
  width:48px; height:48px;
  border-radius:50%;
  background:var(--altp-orange-soft);
  display:grid; place-items:center;
  margin:6px auto 12px;
  color:var(--altp-orange);
}
.altport-fl__cta-icon svg { width:24px; height:24px; }
.altport-fl__cta-label {
  font-family:'DM Serif Display', serif;
  font-size:20px;
  color:var(--altp-navy);
  letter-spacing:.01em;
  margin-bottom:4px;
}
.altport-fl__cta-sub {
  font-size:16px;
  color:var(--altp-ink-3);
  margin-bottom:14px;
}
.altport-fl__cta-btn {
  display:inline-block;
  padding:10px 22px;
  background:var(--altp-orange);
  color:var(--altp-white);
  font:600 16px/1 'Montserrat', sans-serif;
  text-decoration:none;
  border-radius:8px;
  transition:background .18s ease;
}
.altport-fl__cta-btn:hover { background:var(--altp-orange-dark); }

/* Promo card * /
.altport-fl__promo-card {
  background:linear-gradient(135deg, var(--altp-navy) 0%, var(--altp-navy-2) 100%);
  border-radius:var(--altp-radius);
  padding:22px 18px;
  color:var(--altp-white);
  text-align:center;
  box-shadow:var(--altp-shadow);
  position:relative;
  overflow:hidden;
}
.altport-fl__promo-card::after {
  content:"";
  position:absolute;
  right:-20px; bottom:-20px;
  width:100px; height:100px;
  background:radial-gradient(circle, rgba(229,123,40,.18) 0%, transparent 70%);
}
.altport-fl__promo-eyebrow {
  font-size:16px;
  font-weight:600;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:var(--altp-gold);
  margin-bottom:6px;
}
.altport-fl__promo-num {
  font-family:'DM Serif Display', serif;
  font-size:38px;
  line-height:1;
  letter-spacing:.01em;
}
.altport-fl__promo-num span { color:var(--altp-orange); }
.altport-fl__promo-text {
  font-size:16px;
  color:rgba(255,255,255,.78);
  margin-top:8px;
  line-height:1.45;
}
*/
/* ============================================================
   MAIN
   ============================================================ */
.altport-fl__main { min-width:0; }

.altport-fl__toolbar {
  background:var(--altp-white);
  border:1px solid var(--altp-line);
  border-radius:var(--altp-radius);
  padding:16px;
  margin-bottom:18px;
  box-shadow:var(--altp-shadow);
}

.altport-fl__toolbar-top {
  display:flex;
  justify-content:space-between;
  align-items:center;
  flex-wrap:wrap;
  gap:10px;
  margin-bottom:14px;
}

.altport-fl__result-count {
  font-size:16px;
  color:var(--altp-ink-2);
}
.altport-fl__result-count strong {
  color:var(--altp-navy);
  font-weight:700;
  font-family:'JetBrains Mono', monospace;
}

.altport-fl__table-link {
  color:var(--altp-orange);
  text-decoration:none;
  font-size:16px;
  font-weight:600;
  display:inline-flex;
  align-items:center;
  gap:6px;
  transition:color .18s ease;
}
.altport-fl__table-link:hover { color:var(--altp-orange-dark); text-decoration:underline; }
.altport-fl__table-link svg { width:16px; height:16px; }

.altport-fl__filters {
  display:grid;
  grid-template-columns:1.4fr repeat(3, 1fr);
  gap:10px;
}

.altport-fl__field {
  position:relative;
  display:flex;
  align-items:center;
}

.altport-fl__field svg.altp-search-icon {
  position:absolute;
  left:12px;
  width:16px; height:16px;
  color:var(--altp-ink-3);
  pointer-events:none;
}

.altport-fl__input,
.altport-fl__select {
  width:100%;
  appearance:none;
  -webkit-appearance:none;
  background:var(--altp-white);
  border:1px solid var(--altp-line);
  border-radius:8px;
  padding:11px 14px;
  font:500 16px/1.2 'Montserrat', sans-serif;
  color:var(--altp-navy);
  transition:border-color .18s ease, box-shadow .18s ease;
}
.altport-fl__input { padding-left:36px; }
.altport-fl__select {
  padding-right:36px;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'><path d='M3 4.5l3 3 3-3' stroke='%231A2B3C' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat:no-repeat;
  background-position:right 12px center;
  cursor:pointer;
}
.altport-fl__input:focus,
.altport-fl__select:focus {
  outline:0;
  border-color:var(--altp-orange);
  box-shadow:0 0 0 3px rgba(229,123,40,.15);
}

/* ============================================================
   FUND CARDS
   ============================================================ */
.altport-fl__list, .fund-grid {
  display:flex;
  flex-direction:column;
  gap:14px;
}

.altport-fl__fund-card {
  background:var(--altp-white);
  border:1px solid var(--altp-line);
  border-radius:var(--altp-radius);
  box-shadow:var(--altp-shadow);
  overflow:hidden;
  transition:border-color .2s ease, box-shadow .2s ease;
}
.altport-fl__fund-card:hover {
  border-color:var(--altp-gold);
  box-shadow:0 4px 14px rgba(26,43,60,.08), 0 10px 30px rgba(229,123,40,.08);
}

.altport-fl__fund-top {
  display:grid;
  grid-template-columns:1fr auto; /*108px  */
  gap:18px;
  padding:18px 20px;
  align-items:flex-start;
}

.altport-fl__fund-logo {
  width:108px; height:72px;
  border-radius:10px;
  background:var(--altp-cream);
  border:1px solid var(--altp-line);
  display:grid; place-items:center;
  font:700 16px 'Montserrat', sans-serif;
  color:var(--altp-navy);
  letter-spacing:.04em;
  text-align:center;
  padding:6px;
  line-height:1.2;
}

.altport-fl__fund-info { min-width:0; }

.altport-fl__fund-name {
  font:700 18px/1.35 'Montserrat', sans-serif;
  color:#234090;
  margin:0 0 8px;
}

.altport-fl__fund-tags {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px 10px;
  margin-bottom:10px;
}

.altport-fl__tag {
  display:inline-flex;
  align-items:center;
  padding:4px 10px;
  border-radius:999px;
  font-size:16px;
  font-weight:600;
  background:var(--altp-orange-soft);
  color:var(--altp-orange-dark);
}
.altport-fl__tag--equity { background:#E8F2EC; color:#1F8A4C; }
.altport-fl__tag--hybrid { background:#F0EAE0; color:#8C6F2E; }

.altport-fl__rank {
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:16px;
  color:var(--altp-ink-2);
  font-weight:500;
}
.altport-fl__rank-medal {
  width:20px; height:20px;
  display:grid; place-items:center;
  color:var(--altp-gold);
}
.altport-fl__rank-medal svg { width:20px; height:20px; }
.altport-fl__rank strong {
  color:var(--altp-navy);
  font-weight:700;
  font-family:'JetBrains Mono', monospace;
}

.altport-fl__fund-meta {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:6px 24px;
  font-size:16px;
  color:var(--altp-ink-2);
}
.altport-fl__fund-meta strong {
  color:var(--altp-navy);
  font-weight:600;
}
.altport-fl__fund-meta-num {
  font-family:'JetBrains Mono', monospace;
  color:var(--altp-navy);
  font-weight:600;
}
.altport-fl__fund-meta-muted { color:var(--altp-ink-3); }

.altport-fl__fund-actions {
  display:flex;
  flex-direction:column;
  gap:10px;
  align-items:flex-end;
}

.altport-fl__action {
  appearance:none;
  border:0;
  background:transparent;
  padding:6px 4px;
  font:600 16px/1 'Montserrat', sans-serif;
  color:var(--altp-ink-2);
  display:inline-flex;
  align-items:center;
  gap:6px;
  cursor:pointer;
  transition:color .18s ease;
  white-space:nowrap;
  text-decoration:none;
}
.altport-fl__action svg { width:18px; height:18px; }
.altport-fl__action:hover { color:var(--altp-orange); }
.altport-fl__action.is-active { color:var(--altp-orange); }
.altport-fl__action[data-action="favourite"] svg { fill:none; stroke:currentColor; stroke-width:2; }
.altport-fl__action[data-action="favourite"].is-active svg { fill:var(--altp-orange); stroke:var(--altp-orange); }

/* Returns grid */
.altport-fl__fund-returns {
  border-top:1px solid var(--altp-line-2);
  background:#FCFAF6;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}
.altport-fl__returns-grid {
  display:grid;
  grid-template-columns:repeat(8, minmax(82px, 1fr));
 /* min-width:max-content;*/
}
.altport-fl__return {
  padding:12px 8px;
  text-align:center;
  border-right:1px solid var(--altp-line-2);
  display:flex;
  flex-direction:column;
  gap:4px;
  align-items:center;
  justify-content:center;
}
.altport-fl__return:last-child { border-right:0; }
.altport-fl__return.is-active {
  background:var(--altp-orange-soft);
  position:relative;
}
.altport-fl__return.is-active::before {
  content:"";
  position:absolute; left:0; right:0; top:0;
  height:2px;
  background:var(--altp-orange);
}
.altport-fl__return-value {
  font:600 16px/1 'JetBrains Mono', monospace;
  color:var(--altp-pos);
}
.altport-fl__return-value.is-neg { color:var(--altp-neg); }
.altport-fl__return-value.is-na { color:var(--altp-ink-3); }
.altport-fl__return-label {
  font-size:16px;
  color:var(--altp-ink-3);
  font-weight:500;
}

/* ============================================================
   RESPONSIVE â€” TABLET â‰¤ 1024px
   ============================================================ */
@media (max-width:1024px) {
  .altport-fl { padding:24px 0; }
  .altport-fl__layout {
    grid-template-columns:1fr;
    gap:18px;
  }
  .altport-fl__sidebar {
    position:static;
    flex-direction:row;
    flex-wrap:wrap;
    gap:14px;
  }
  .altport-fl__compare-card { flex:1 1 320px; }
  .altport-fl__cta-card { flex:1 1 220px; }
  .altport-fl__promo-card { flex:1 1 220px; }
  .altport-fl__filters {
    grid-template-columns:1fr 1fr 1fr;
  }
  .altport-fl__fund-top {
    grid-template-columns: 1fr; /*88px*/
    gap:14px;
    padding:16px;
  }
  .altport-fl__fund-logo { width:88px; height:64px; font-size:14px; }
  .altport-fl__fund-actions {
    grid-column:1 / -1;
    flex-direction:row;
    justify-content:flex-end;
    gap:18px;
    padding-top:6px;
    border-top:1px dashed var(--altp-line-2);
  }
  .altport-fl__fund-meta { grid-template-columns:1fr; }
}

/* ============================================================
   RESPONSIVE â€” MOBILE â‰¤ 430px
   ============================================================ */
@media (max-width:430px) {
  .altport-fl { padding:18px 0; }
  .altport-fl__container { padding:0 14px; }
  .altport-fl__sidebar { flex-direction:column; gap:14px; }
  .altport-fl__compare-card,
  .altport-fl__cta-card,
  .altport-fl__promo-card { flex:1 1 100%; }
  .altport-fl__filters {
    grid-template-columns:1fr 1fr;
  }
  .altport-fl__field:first-child { grid-column:1 / -1; }
  .altport-fl__toolbar { padding:14px; }
  .altport-fl__fund-top {
    grid-template-columns:1fr; /*64px  */
    padding:14px;
    gap:12px;
  }
  .altport-fl__fund-logo {
    width:64px; height:52px;
    font-size:12px;
  }
  .altport-fl__fund-name { font-size:16px; }
  .altport-fl__promo-num { font-size:30px; }
}
#fundTable_wrapper{ display:none;}
#compareBtn{ display:none;}
#compareBtn.active{ display:block;}

/* ===== SCOPED RESET & TOKENS ===== */
.altport-funds-section,
.altport-funds-section *,
.altport-funds-section *::before,
.altport-funds-section *::after { box-sizing: border-box; }
.tools-tiltle{color: #234090;    padding: 0px 0px 20px;}
.tools-tiltle em{color: #e67e22;}

.altport-funds-section {
  --af-orange: #E57B28;
  --af-orange-dark: #C8651A;
  --af-navy: #1A2B3C;
  --af-navy-soft: #2C3E50;
  --af-gold: #C5A059;
  --af-gold-soft: #C9A084;
  --af-cream: #FAF7F2;
  --af-cream-warm: #F5EFE6;
  --af-white: #FFFFFF;
  --af-border: #E8E2D6;
  --af-border-soft: #F0EBE0;
  --af-text: #1A2B3C;
  --af-text-muted: #6B7280;
  --af-success: #10B981;
  --af-danger: #DC2626;
  --af-shadow-sm: 0 2px 8px rgba(26, 43, 60, 0.05);
  --af-shadow-md: 0 8px 24px rgba(26, 43, 60, 0.08);
  --af-shadow-lg: 0 20px 48px rgba(26, 43, 60, 0.12);

 /* background: var(--af-cream);
  color: var(--af-text);
  padding: 80px 24px 140px;
  min-height: 100vh;*/
}

/* ===== INNER WRAP ===== * /
.altport-funds-section .af-wrap { max-width: 150rem; margin: 0 auto; }


/* ===== FILTER BAR ===== * /
.altport-funds-section .af-filters {
  background: var(--af-white);
  border: 1px solid var(--af-border);
  border-radius: 14px;
  padding: 16px 20px;
  display: flex; align-items: center; gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  box-shadow: var(--af-shadow-sm);
}
.altport-funds-section .af-filter-label {
  font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--af-text-muted); font-weight: 600;
}
.altport-funds-section .af-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.altport-funds-section .af-pill {
  padding: 7px 16px;
  background: transparent;
  border: 1px solid var(--af-border);
  border-radius: 100px;
  
  font-size: 12px; font-weight: 500; color: var(--af-text);
  cursor: pointer; transition: all .25s ease;
}
.altport-funds-section .af-pill:hover { border-color: var(--af-orange); color: var(--af-orange); }
.altport-funds-section .af-pill.is-active {
  background: var(--af-navy); border-color: var(--af-navy); color: var(--af-white);
}
.altport-funds-section .af-search {
  flex: 1; min-width: 220px; margin-left: auto;
  position: relative;
}
.altport-funds-section .af-search input {
  width: 100%; padding: 10px 14px 10px 38px;
  border: 1px solid var(--af-border); border-radius: 8px;
   font-size: 13px;
  background: var(--af-cream); transition: all .2s ease;
}
.altport-funds-section .af-search input:focus {
  outline: none; border-color: var(--af-orange); background: var(--af-white);
}
.altport-funds-section .af-search svg {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--af-text-muted);
}
.altport-funds-section .af-sort {
  display: flex; align-items: center; gap: 8px;
}
.altport-funds-section .af-sort select {
  padding: 9px 32px 9px 14px;
  border: 1px solid var(--af-border); border-radius: 8px;
  font-size: 12px; font-weight: 500;
  background: var(--af-cream) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%231A2B3C' stroke-width='2.5'><path d='m6 9 6 6 6-6'/></svg>") no-repeat right 12px center;
  appearance: none; cursor: pointer; color: var(--af-navy);
}
.altport-funds-section .af-sort select:focus { outline: none; border-color: var(--af-orange); }

/* ===== LIST ===== * /
.altport-funds-section .af-list {
  background: var(--af-white);
  border: 1px solid var(--af-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--af-shadow-sm);
}

/* column header (desktop only) * /
.altport-funds-section .af-list-head {
  display: grid;
  grid-template-columns: minmax(220px, 2.2fr) 80px 72px 72px 72px 100px  180px; /*100px 60px* /
  gap: 12px; align-items: center;
  padding: 14px 20px;
  background: #f1f1f1;
  border-bottom: 1px solid var(--af-border);
  font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase;
  font-weight: 700; color: var(--af-text-muted);
}
.altport-funds-section .af-list-head .af-th-num { text-align: right; }
.altport-funds-section .af-list-head .af-th-center { text-align: center; }

/* row * /
.altport-funds-section .af-row {
  display: grid;
  grid-template-columns: minmax(220px, 2.2fr) 80px 72px 72px 72px 100px  180px; /*100px 60px* /
  gap: 12px; align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--af-border-soft);
  position: relative;
  transition: background .2s ease;
}
.altport-funds-section .af-row:last-child { border-bottom: none; }
.altport-funds-section .af-row::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--af-orange); transform: scaleY(0); transform-origin: center;
  transition: transform .25s ease;
}
.altport-funds-section .af-row:hover { background: var(--af-cream); }
.altport-funds-section .af-row:hover::before { transform: scaleY(1); }
.altport-funds-section .af-row.is-selected { background: rgba(229,123,40,.04); }
.altport-funds-section .af-row.is-selected::before { transform: scaleY(1); }

/* logo cell * /
.altport-funds-section .af-amc-logo {
  width: 44px; height: 44px;
  background: var(--af-navy); color: var(--af-white);
font-size: 17px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px; letter-spacing: -0.5px;
}

/* fund identity * /
.altport-funds-section .af-fund {
  min-width: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.altport-funds-section .af-fund-name {
  font-size: 16px; line-height: 1.2; color: var(--af-navy);
  letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.altport-funds-section .af-fund-amc {
  font-size: 14px; color: var(--af-text-muted); font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* badge * /
.altport-funds-section .af-badge {
  padding: 5px 10px; border-radius: 100px;
  font-size: 9.5px; letter-spacing: 1px; text-transform: uppercase;
  font-weight: 700; display: inline-block;
  background: var(--af-cream-warm); color: var(--af-navy);
  border: 1px solid var(--af-border);
  white-space: nowrap;
}
.altport-funds-section .af-badge.is-pms { background: rgba(229,123,40,.1); color: var(--af-orange); border-color: rgba(229,123,40,.2); }
.altport-funds-section .af-badge.is-aif1 { background: rgba(26,43,60,.08); color: var(--af-navy); border-color: rgba(26,43,60,.15); }
.altport-funds-section .af-badge.is-aif2 { background: rgba(197,160,89,.15); color: #8B6F2C; border-color: rgba(197,160,89,.3); }
.altport-funds-section .af-badge.is-aif3 { background: rgba(16,185,129,.1); color: #047857; border-color: rgba(16,185,129,.25); }

/* return cell * /
.altport-funds-section .af-return, .altport-funds-section .af-cell-return {
  font-size: 18px; text-align: right; line-height: 1;
  color: var(--af-navy);
}
.altport-funds-section .af-return.is-positive { color: var(--af-success); }
.altport-funds-section .af-return.is-negative { color: var(--af-danger); }
.altport-funds-section .af-return.is-empty { color: var(--af-text-muted);  font-weight: 400; font-size: 16px; }
.altport-funds-section .af-return sup {
  font-size: 10px; font-weight: 600; margin-left: 1px;
}

/* numeric cell * /
.altport-funds-section .af-num {
  text-align: right; font-size: 14px; font-weight: 600; color: var(--af-navy);
  white-space: nowrap;
}
.altport-funds-section .af-num small {
  display: block; font-size: 10px; font-weight: 500; letter-spacing: 1px;
  color: var(--af-text-muted); text-transform: uppercase; margin-top: 2px;
}

/* risk * /
.altport-funds-section .af-risk {
  display: flex; gap: 3px; align-items: center; justify-content: center;
}
.altport-funds-section .af-risk-bar {
  width: 4px; height: 14px; background: var(--af-border); border-radius: 2px;
}
.altport-funds-section .af-risk-bar.is-on { background: var(--af-orange); }

/* actions * /
.altport-funds-section .af-row-actions {
  display: flex; gap: 8px; justify-content: flex-end;
}
.altport-funds-section .af-row-btn {
  padding: 9px 14px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.8px;
  text-transform: uppercase; text-align: center;
  border-radius: 8px; cursor: pointer;
  transition: all .25s ease; border: 1px solid;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  text-decoration: none;
}
.altport-funds-section .af-row-btn-view {
  border-color: #a1a1a1;
  color: #919191;
  /*background: var(--af-navy); border-color: var(--af-navy); color: var(--af-white);* /
}
/*
.altport-funds-section .af-row-btn-view:hover {
  background: var(--af-orange); border-color: var(--af-orange);
}* /
.altport-funds-section .af-row-btn-compare {
  width: 36px; padding: 0; flex-shrink: 0;
  background: var(--af-white); border-color: var(--af-border); color: var(--af-navy);
  height: 36px;
}
.altport-funds-section .af-row-btn-compare:hover {
  border-color: var(--af-orange); color: var(--af-orange);
}
.altport-funds-section .af-row-btn-compare.is-active {
  background: var(--af-orange); border-color: var(--af-orange); color: var(--af-white);
}
.altport-funds-section .af-row-btn-compare svg { transition: transform .2s ease; }
.altport-funds-section .af-row-btn-compare.is-active svg { transform: rotate(45deg); }

/* mobile labels (hidden on desktop) * /
.altport-funds-section .af-cell-label { display: none; }

/* result count * /
.altport-funds-section .af-result-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 4px; margin-bottom: 12px;
  font-size: 12px; color: var(--af-text-muted);
}
.altport-funds-section .af-result-bar strong { color: var(--af-navy); font-weight: 600; }

/* ===== STICKY COMPARE BAR ===== * /
.altport-funds-section .af-compare-bar {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(140%);
  width: calc(100% - 48px); max-width: 880px;
  background: var(--af-navy); color: var(--af-white);
  border-radius: 18px; padding: 16px 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,.25);
  display: flex; align-items: center; gap: 16px;
  z-index: 90;
  transition: transform .4s cubic-bezier(.2,.8,.2,1);
  border: 1px solid rgba(255,255,255,.08);
}
.altport-funds-section .af-compare-bar.is-visible {
  transform: translateX(-50%) translateY(0);
}
.altport-funds-section .af-compare-label {
  font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--af-gold); font-weight: 600; flex-shrink: 0;
}
.altport-funds-section .af-compare-slots { display: flex; gap: 8px; flex: 1; overflow: hidden; }
.altport-funds-section .af-slot {
  flex: 1; min-width: 0; max-width: 180px;
  padding: 8px 12px; border-radius: 10px;
  background: rgba(255,255,255,.06);
  border: 1px dashed rgba(255,255,255,.15);
  font-size: 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  transition: all .25s ease;
}
.altport-funds-section .af-slot.is-empty { color: rgba(255,255,255,.35); font-style: italic; }
.altport-funds-section .af-slot.is-filled {
  background: rgba(229,123,40,.15);
  border: 1px solid rgba(229,123,40,.4);
  color: var(--af-white);
}
.altport-funds-section .af-slot-name {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500;
}
.altport-funds-section .af-slot-remove {
  background: none; border: none; color: var(--af-gold);
  cursor: pointer; padding: 0; line-height: 0; flex-shrink: 0;
}
.altport-funds-section .af-slot-remove:hover { color: var(--af-orange); }
.altport-funds-section .af-compare-cta { display: flex; gap: 10px; flex-shrink: 0; }
.altport-funds-section .af-compare-clear {
  background: transparent; border: 1px solid rgba(255,255,255,.2);
  color: var(--af-white); padding: 10px 16px; border-radius: 10px;
  font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all .2s ease;
}
.altport-funds-section .af-compare-clear:hover { background: rgba(255,255,255,.06); }
.altport-funds-section .af-compare-go {
  background: var(--af-orange); border: 1px solid var(--af-orange);
  color: var(--af-white); padding: 10px 22px; border-radius: 10px;
   font-size: 12px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase;
  cursor: pointer; transition: all .2s ease;
  display: flex; align-items: center; gap: 8px;
}
.altport-funds-section .af-compare-go:hover { background: var(--af-orange-dark); }
.altport-funds-section .af-compare-go:disabled { opacity: .4; cursor: not-allowed; } */

/* ===== COMPARE MODAL ===== */
.altport-funds-section .af-modal {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(26,43,60,.6); backdrop-filter: blur(8px);
  display: none; align-items: flex-start; justify-content: center;
  padding: 40px 24px; overflow-y: auto;
}
.altport-funds-section .af-modal.is-open { display: flex; }
.altport-funds-section .af-modal-card {
  background: var(--af-cream); border-radius: 22px;
  width: 100%; max-width: 1100px;
  box-shadow: 0 40px 80px rgba(0,0,0,.3);
  overflow: hidden;
  animation: afModalIn .35s cubic-bezier(.2,.8,.2,1);
}
@keyframes afModalIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.altport-funds-section .af-modal-head {
  padding: 28px 32px; border-bottom: 1px solid var(--af-border);
  display: flex; justify-content: space-between; align-items: center;
  background: var(--af-white);
}
.altport-funds-section .af-modal-title {
  font-size: 26px; color: #234090;
}
.altport-funds-section .af-modal-title em { color: #e67e22; }
.altport-funds-section .af-modal-close {
  background: var(--af-cream-warm); border: none;
  width: 40px; height: 40px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--af-navy); transition: all .2s ease;
}
.altport-funds-section .af-modal-close:hover { background: var(--af-navy); color: var(--af-white); }
.altport-funds-section .af-table-wrap { overflow-x: auto; }
.altport-funds-section .af-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.altport-funds-section .af-table th,
.altport-funds-section .af-table td {
  padding: 16px 20px; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--af-border);
}
.altport-funds-section .af-table th:first-child,
.altport-funds-section .af-table td:first-child {
  background: #f1f1f1;
  font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
  font-weight: 700; color: var(--af-text-muted);
  width: 200px; position: sticky; left: 0;
}
.altport-funds-section .af-table thead th {
  background: var(--af-white); padding: 24px 20px;
  border-bottom: 2px solid var(--af-navy);
}
.altport-funds-section .af-table thead th:first-child { background: #f1f1f1; }
.altport-funds-section .af-table .af-th-amc {
  font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--af-orange); margin-bottom: 4px; font-weight: 600;
}
.altport-funds-section .af-table .af-th-name {
   font-size: 18px;
  color: var(--af-navy); line-height: 1.2;
}
.altport-funds-section .af-table td {
  font-size: 14px; color: var(--af-navy); font-weight: 500;
}
.altport-funds-section .af-table td.af-pos { color: var(--af-success); font-weight: 600; }
.altport-funds-section .af-table td.af-neg { color: var(--af-danger); font-weight: 600; }
.altport-funds-section .af-modal-foot {
  padding: 24px 32px; background: var(--af-white);
  border-top: 1px solid var(--af-border);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 16px;
}
.altport-funds-section .af-modal-foot small {
  font-size: 12px; color: var(--af-text-muted); max-width: 600px; line-height: 1.5;
}
.altport-funds-section .af-modal-cta {
  background: var(--af-orange); color: var(--af-white);
  padding: 12px 24px; border: none; border-radius: 10px;
  font-size: 12px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; cursor: pointer;
  transition: all .2s ease; flex-shrink: 0;
}
.altport-funds-section .af-modal-cta:hover { background: var(--af-orange-dark); }

/* ===== EMPTY STATE ===== */
.altport-funds-section .af-empty {
  padding: 80px 24px; text-align: center; color: var(--af-text-muted);
}
.altport-funds-section .af-empty-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--af-cream-warm); margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: center;
  color: var(--af-orange);
}

/* =========================================================
   BREAKPOINTS: 768px and 430px
   - > 768px : desktop row layout (all 9 columns)
   - ≤ 768px : stacked card layout (tablet + mobile)
   - ≤ 430px : tightened small-mobile layout
   ========================================================= */

/* ===== TABLET / MOBILE (≤ 768px) ===== */
@media (max-width: 768px) {
  .altport-funds-section { padding: 56px 20px 160px; }

  .altport-funds-section .af-header { margin-bottom: 28px; padding-bottom: 24px; }
  .altport-funds-section .af-stats { width: 100%; justify-content: flex-start; gap: 28px; }
  .altport-funds-section .af-stat-item { text-align: left; }
  .altport-funds-section .af-stat-num { font-size: 26px; }

  .altport-funds-section .af-filters { padding: 14px 16px; gap: 12px; }
  .altport-funds-section .af-search { width: 100%; margin-left: 0; order: 3; }
  .altport-funds-section .af-sort { width: 100%; order: 4; }
  .altport-funds-section .af-sort select { width: 100%; }

  /* Hide column header, switch list to transparent stack */
  .altport-funds-section .af-list-head { display: none; }
  .altport-funds-section .af-list {
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible;
  }

  /* Each row becomes a card */
  .altport-funds-section .af-row {
    display: block;
    background: var(--af-white);
    border: 1px solid var(--af-border);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 12px;
    box-shadow: var(--af-shadow-sm);
    position: relative;
  }
  .altport-funds-section .af-row:hover { background: var(--af-white); }
  .altport-funds-section .af-row.is-selected {
    background: var(--af-white);
    border-color: var(--af-orange);
    box-shadow: 0 0 0 1px var(--af-orange), var(--af-shadow-sm);
  }
  .altport-funds-section .af-row::before { display: none; }

  /* Identity row */
  .altport-funds-section .af-cell-identity {
    display: flex; align-items: center; gap: 14px;
    margin-bottom: 16px; padding-bottom: 16px;
    padding-right: 90px; /* leave room for floating badge */
    border-bottom: 1px solid var(--af-border-soft);
  }
  .altport-funds-section .af-fund-name { white-space: normal; font-size: 17px; }

  /* Badge floats top-right */
  .altport-funds-section .af-cell-badge {
    position: absolute; top: 20px; right: 20px;
  }
  .altport-funds-section .af-cell-badge .af-cell-label { display: none; }

  /* Metric grid: 1Y / 3Y / 5Y / AUM / Min / Risk in 3-up grid */
  .altport-funds-section .af-cell-return,
  .altport-funds-section .af-cell-aum,
  .altport-funds-section .af-cell-min,
  .altport-funds-section .af-cell-risk-wrap {
    display: inline-flex; flex-direction: column; gap: 5px;
    width: calc(33.333% - 8px);
    margin-right: 12px; margin-bottom: 16px;
    vertical-align: top;
  }
  .altport-funds-section .af-cell-return:nth-child(3n+1),
  .altport-funds-section .af-cell-aum:nth-child(3n+1),
  .altport-funds-section .af-cell-min:nth-child(3n+1),
  .altport-funds-section .af-cell-risk-wrap:nth-child(3n+1) { margin-right: 12px; }

  .altport-funds-section .af-cell-label {
    display: block;
    font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase;
    color: var(--af-text-muted); font-weight: 600;
  }

  .altport-funds-section .af-return { text-align: left; font-size: 18px; }
  .altport-funds-section .af-num { text-align: left; font-size: 14px; }
  .altport-funds-section .af-num small { display: none; }
  .altport-funds-section .af-risk { justify-content: flex-start; }

  /* Action row at bottom */
  .altport-funds-section .af-row-actions {
    display: flex; gap: 8px; padding-top: 4px;
    border-top: 1px solid var(--af-border-soft);
    margin-top: 4px; padding-top: 16px;
  }
  .altport-funds-section .af-row-btn-view { flex: 1; padding: 12px; font-size: 11px; }
  .altport-funds-section .af-row-btn-compare { width: 44px; height: 44px; }

  /* Compare bar stacks */
  .altport-funds-section .af-compare-bar {
    flex-wrap: wrap; padding: 14px;
    bottom: 12px; width: calc(100% - 24px);
    gap: 12px;
    z-index: 9999;
  }
  .altport-funds-section .af-compare-label { width: 100%; }
  .altport-funds-section .af-compare-slots { width: 100%; flex-wrap: wrap; }
  .altport-funds-section .af-slot { min-width: calc(50% - 4px); flex: 1 1 calc(50% - 4px); }
  .altport-funds-section .af-compare-cta { width: 100%; }
  .altport-funds-section .af-compare-cta button { flex: 1; }

  /* Modal */
  .altport-funds-section .af-modal { padding: 16px; }
  .altport-funds-section .af-modal-head { padding: 20px 24px; }
  .altport-funds-section .af-modal-title { font-size: 20px; }
  .altport-funds-section .af-modal-foot { padding: 20px 24px; }
}

/* ===== SMALL MOBILE (≤ 430px) ===== */
@media (max-width: 430px) {
  .altport-funds-section { padding: 48px 16px 180px; }

  .altport-funds-section .af-title { font-size: 28px; }
  .altport-funds-section .af-subtitle { font-size: 14px; }

  /* Tighter card padding */
  .altport-funds-section .af-row { padding: 18px; }
  .altport-funds-section .af-cell-identity {
    padding-right: 80px;
    margin-bottom: 14px; padding-bottom: 14px;
  }
  .altport-funds-section .af-cell-badge { top: 18px; right: 18px; }
  .altport-funds-section .af-fund-name { font-size: 16px; }
  .altport-funds-section .af-amc-logo { width: 40px; height: 40px; font-size: 15px; }

  /* Metric grid: 2-up instead of 3-up */
  .altport-funds-section .af-cell-return,
  .altport-funds-section .af-cell-aum,
  .altport-funds-section .af-cell-min,
  .altport-funds-section .af-cell-risk-wrap {
    width: calc(50% - 6px);
    margin-right: 12px; margin-bottom: 14px;
  }
  .altport-funds-section .af-return { font-size: 17px; }

  /* Compact filter pills */
  .altport-funds-section .af-pill { padding: 7px 12px; font-size: 11.5px; }
  .altport-funds-section .af-filter-label { display: none; }
}

 .af-table-wrap{ padding: 20px;}
.apmi-grid{
    gap:20px;
    display: flex;
    flex-direction: column;
}


    .apmi-card{
    background:#fff;
    border:1px solid #dcdcde;
    border-radius:8px;
    padding:20px;
    margin-bottom:20px;
    box-shadow:0 1px 3px rgba(0,0,0,.05);
    min-width: 748px;
}

.apmi-card-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:15px;
}

.apmi-title{
    font-size:16px;
    margin:0;
}

.apmi-benchmark{
    font-size:12px;
    color:#666;
}

.apmi-actions .button{
    margin-left:8px;
        font-size: 15px;
}

.apmi-chart{
    height:260px;
}

.apmi-card-footer{
    display:flex;
    justify-content:space-between;
    font-size:13px;
    margin-top:10px;
    color:#555;
}

.apmi-return b{
    color:#0a7d2c;
}
.apmi-pagination{
margin-top:20px;
}

.apmi-pagination a{
padding:6px 12px;
border:1px solid #dcdcde;
margin-right:5px;
text-decoration:none;
background:#fff;
}

.apmi-pagination a.active{
background:#2271b1;
color:#fff;
border-color:#2271b1;
}
.apmi-table {
    margin-top: 15px;
    font-family: Arial, sans-serif;
    font-size: 13px;
    color: #333;
}

.apmi-table table {
    width: 100%;
    border-collapse: collapse;
}

.apmi-table th,
.apmi-table td {
    padding: 6px 10px;
    text-align: center;
}

.apmi-table th {
    font-weight: 600;
    color: #666;
    border-bottom: 1px solid #ddd;
}

.apmi-table td {
    border-bottom: 1px solid #f0f0f0;
}

.apmi-table .label {
    text-align: left;
    font-weight: 600;
    color: #444;
}

.apmi-table tr:last-child td {
    border-bottom: none;
}

/* optional highlight for negative values */
.apmi-table td.negative {
    color: #d9534f;
}

/* optional highlight for positive values */
.apmi-table td.positive {
    color: #28a745;
}