:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-dark: #0b1220;
  --text: #111827;
  --muted: #667085;
  --border: #e4e7ec;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --accent-soft: #ecfdf5;
  --blue: #2563eb;
  --warning-bg: #fff7ed;
  --warning-border: #fed7aa;
  --warning-text: #9a3412;
  --danger: #b42318;
  --shadow: 0 16px 44px rgba(15, 23, 42, 0.08);
  --radius: 18px;
  --radius-sm: 12px;
  --tap: 44px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.05), transparent 32rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

button {
  min-height: var(--tap);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.25);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: -4rem;
  z-index: 999;
  padding: 0.75rem 1rem;
  background: #fff;
  color: var(--text);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.skip-link:focus {
  top: 1rem;
}

.shell {
  width: min(1740px, calc(100% - 1rem));
  margin-inline: auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  color: #fff;
  background: rgba(11, 18, 32, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.topbar__inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
  text-decoration: none;
}

.brand__mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(145deg, #14b8a6, #0f766e);
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22);
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: #aab4c4;
  font-size: 0.75rem;
}

.data-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #cbd5e1;
  font-size: 0.82rem;
}

.data-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245,158,11,.12);
}

.data-status.is-online .data-status__dot {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34,197,94,.12);
}

.data-status.is-offline .data-status__dot {
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239,68,68,.12);
}

.page {
  padding-block: 1.25rem 2.5rem;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.25rem;
  align-items: end;
  padding: clamp(1.4rem, 4vw, 2.4rem);
  color: #fff;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.96), rgba(11, 18, 32, 0.98)),
    var(--surface-dark);
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero h1 {
  max-width: 760px;
  margin: 0.35rem 0 0.75rem;
  font-size: clamp(2rem, 5vw, 3.7rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.hero p {
  margin: 0;
  max-width: 660px;
  color: #d6e1eb;
  font-size: clamp(0.98rem, 2vw, 1.08rem);
}

.eyebrow {
  color: #0f766e;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #99f6e4;
}

.hero__search label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.82rem;
  font-weight: 800;
}

.search-box {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.55rem;
  min-height: 58px;
  padding-inline: 0.9rem 0.45rem;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,.16);
}

.search-box svg {
  width: 21px;
  fill: none;
  stroke: #64748b;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.search-box input {
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 1rem;
}

.icon-button {
  width: var(--tap);
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font-size: 1.5rem;
}

.field-hint {
  margin-top: 0.55rem !important;
  color: #b8c7d8 !important;
  font-size: 0.78rem !important;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(520px, 620px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  margin-top: 1rem;
}

.content-stack {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  box-shadow: var(--shadow);
}

.panel--results {
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 104px);
  overflow: hidden;
}

.panel__header,
.fund-header,
.section-block__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.panel__header h2,
.fund-header h2,
.section-block h3,
.chart-card h3 {
  margin: 0.18rem 0 0;
}

.panel__header p,
.fund-header p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.count-badge {
  min-width: 34px;
  padding: 0.25rem 0.55rem;
  text-align: center;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.result-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.85rem;
  max-height: calc(100vh - 205px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.result-card {
  width: 100%;
  min-height: 86px;
  display: grid;
  gap: 0.3rem;
  padding: 0.8rem;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.result-card:hover,
.result-card.is-selected {
  transform: translateY(-1px);
  border-color: rgba(15, 118, 110, 0.55);
  box-shadow: 0 8px 24px rgba(15, 118, 110, 0.09);
}

.result-card strong {
  font-size: 0.9rem;
  line-height: 1.32;
}

.result-card span {
  color: var(--muted);
  font-size: 0.76rem;
}

.result-card__footer {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.15rem;
}

.result-card__nav {
  color: var(--accent) !important;
  font-weight: 800;
}

.empty-state {
  min-height: 220px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.35rem;
  text-align: center;
  color: var(--muted);
}

.empty-state__icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--surface-soft);
  font-size: 1.6rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 1rem 0;
}

.metric {
  padding: 0.95rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
}

.metric span,
.metric small {
  display: block;
  color: var(--muted);
}

.metric span {
  font-size: 0.76rem;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin: 0.35rem 0 0.15rem;
  font-size: clamp(1.1rem, 2.5vw, 1.45rem);
  letter-spacing: -0.025em;
}

.metric small {
  font-size: 0.72rem;
}

.button {
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.7rem 1rem;
  border: 0;
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.button:hover {
  background: var(--accent-strong);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.button--secondary {
  background: #e8f7f4;
  color: var(--accent-strong);
}

.button--secondary:hover {
  background: #d8f1ec;
}

.button--ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.button--ghost:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.range-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin: 1rem 0 0.75rem;
}

.range-pills {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 0.1rem;
}

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

.range-pills button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0.45rem 0.72rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
  font-size: 0.78rem;
}

.range-pills button.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.chart-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.chart-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem 0;
}

.chart-card__header p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.legend__line {
  width: 20px;
  height: 2px;
  background: var(--accent);
}

.legend__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
}

.chart-shell {
  position: relative;
  min-height: 360px;
  padding: 0.8rem 0.7rem 0.5rem;
  overflow: hidden;
}

.chart-shell svg {
  width: 100%;
  height: 100%;
  min-height: 330px;
  display: block;
}

.chart-empty,
.chart-error,
.chart-loading {
  min-height: 330px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
}

.skeleton {
  background:
    linear-gradient(90deg, #eef2f6 25%, #f8fafc 37%, #eef2f6 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

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

.notice {
  margin-top: 0.75rem;
  padding: 0.8rem;
  border-radius: 12px;
  font-size: 0.86rem;
}

.notice--warning {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: var(--warning-text);
}

.section-block {
  margin-top: 1.1rem;
}

.payout-list,
.comparison-summary {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.8rem;
}

.payout-row,
.comparison-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
}

.payout-row span,
.comparison-row span {
  color: var(--muted);
  font-size: 0.82rem;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 38px;
  padding: 0.45rem 0.55rem 0.45rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  font-size: 0.8rem;
}

.chip button {
  width: 28px;
  min-height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.muted {
  color: var(--muted);
}

.footer {
  padding: 0.5rem 0 2rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.toast-region {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 90;
  display: grid;
  gap: 0.5rem;
  width: min(360px, calc(100% - 2rem));
}

.toast {
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 0.85rem;
}

@media (max-width: 920px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .panel--results {
    position: static;
    max-height: none;
  }

  .result-list {
    max-height: 360px;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 0.75rem, 1740px);
  }

  .topbar__inner {
    min-height: 64px;
  }

  .brand small {
    display: none;
  }

  .data-status {
    max-width: 48%;
    justify-content: flex-end;
    text-align: right;
  }

  .page {
    padding-top: 0.5rem;
  }

  .hero {
    border-radius: 18px;
    padding: 1.1rem;
  }

  .hero h1 {
    font-size: clamp(1.85rem, 10vw, 2.7rem);
  }

  .panel {
    border-radius: 16px;
    padding: 0.9rem;
  }

  .fund-header,
  .compare-header {
    display: grid;
    grid-template-columns: 1fr;
  }

  .fund-header .button,
  .compare-header .button {
    width: 100%;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .range-toolbar > .button {
    width: 100%;
  }

  .chart-card__header {
    flex-direction: column;
  }

  .chart-shell {
    min-height: 300px;
    padding-inline: 0.35rem;
  }

  .chart-shell svg {
    min-height: 280px;
  }

  .payout-row,
  .comparison-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer__inner {
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  .data-status span:last-child {
    font-size: 0.72rem;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .search-box {
    min-height: 54px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0.32rem 0.62rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.badge--risk-low {
  background: #ecfdf3;
  border-color: #abefc6;
  color: #067647;
}

.badge--risk-medium,
.badge--risk-moderate {
  background: #fffaeb;
  border-color: #fedf89;
  color: #b54708;
}

.badge--risk-high {
  background: #fef3f2;
  border-color: #fecdca;
  color: #b42318;
}

.badge--risk-range {
  background: #f4f3ff;
  border-color: #d9d6fe;
  color: #5925dc;
}

.badge--risk-na {
  background: #f2f4f7;
  border-color: #d0d5dd;
  color: #475467;
}

.badge--shariah {
  background: #eef4ff;
  border-color: #c7d7fe;
  color: #3538cd;
}

.result-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.15rem;
}

.result-card__badges .badge {
  min-height: 24px;
  padding: 0.2rem 0.45rem;
  font-size: 0.66rem;
}

@media (min-width: 1500px) {
  .panel {
    padding: 1.25rem;
  }

  .panel--results {
    max-height: calc(100vh - 96px);
  }

  .result-list {
    max-height: calc(100vh - 210px);
  }
}


.browse-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 0.85rem;
}

.button--compact {
  min-height: 38px;
  padding: 0.45rem 0.75rem;
  font-size: 0.78rem;
}

.sort-control {
  display: grid;
  gap: 0.25rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.sort-control select {
  min-height: 38px;
  max-width: 150px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  padding: 0.4rem 2rem 0.4rem 0.65rem;
  font: inherit;
  font-size: 0.78rem;
}

.load-more {
  width: 100%;
  margin-top: 0.7rem;
}

@media (max-width: 420px) {
  .browse-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .sort-control select {
    width: 100%;
    max-width: none;
  }
}


.browse-toolbar {
  display: block;
}

.sort-control--wide select {
  width: 100%;
  max-width: none;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: 0.65rem;
}

.filter-grid .sort-control select {
  width: 100%;
  max-width: none;
}

.filter-grid .button {
  align-self: end;
}

@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: minmax(430px, 500px) minmax(0, 1fr);
  }
}

@media (max-width: 920px) {
  .workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .filter-grid {
    grid-template-columns: 1fr;
  }
}


@media (min-width: 1101px) {
  .panel--results .result-card {
    padding: 0.95rem 1rem;
  }

  .panel--results .result-card strong {
    font-size: 0.96rem;
  }

  .panel--results .result-card__footer {
    align-items: center;
  }
}


.fund-header__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.6rem;
}

.detail-tabs {
  display: flex;
  gap: 0.4rem;
  margin: 1rem 0;
  padding-bottom: 0.15rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.detail-tabs::-webkit-scrollbar {
  display: none;
}

.detail-tabs button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.detail-tabs button.is-active {
  background: var(--surface-dark);
  color: #fff;
  border-color: var(--surface-dark);
}

.detail-section {
  display: none;
}

.detail-section.is-active {
  display: block;
}

.metric-grid--six {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.info-card {
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}

.info-card span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.info-card strong {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.95rem;
}

.performance-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 1rem;
}

.performance-grid article {
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-soft);
}

.performance-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.performance-grid strong {
  display: block;
  margin-top: 0.3rem;
  font-size: 1rem;
}

.performance-note {
  margin: 0.8rem 0 0;
  font-size: 0.78rem;
}

.return-positive {
  color: #067647;
}

.return-negative {
  color: #b42318;
}

.return-neutral {
  color: var(--text);
}

@media (max-width: 1200px) {
  .performance-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .fund-header__actions {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr;
  }

  .fund-header__actions .button {
    width: 100%;
  }

  .metric-grid--six {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .performance-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .metric-grid--six,
  .detail-grid,
  .performance-grid {
    grid-template-columns: 1fr;
  }
}


.info-card small {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.aum-positive {
  color: #067647;
}

.aum-negative {
  color: #b42318;
}


.compare-selection-list {
  display: grid;
  gap: 0.55rem;
  margin: 0.85rem 0;
}

.compare-selection {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  min-height: 52px;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  transition:
    box-shadow 140ms ease,
    border-color 140ms ease,
    transform 140ms ease;
}

.compare-selection.is-dragging {
  opacity: 0.55;
  border-color: var(--accent);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
}

.compare-selection.is-drop-target {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.compare-drag-handle {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 1.05rem;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.compare-drag-handle:active {
  cursor: grabbing;
}

.compare-selection__content {
  min-width: 0;
}

.compare-selection__content strong,
.compare-selection__content span {
  display: block;
}

.compare-selection__content strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-selection__content span {
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.76rem;
}

.compare-remove {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
  cursor: pointer;
}

.compare-remove:hover {
  background: #fee2e2;
  color: #b42318;
}

.compare-toolbar {
  align-items: center;
}

.compare-tabs {
  margin-top: 1rem;
}

.compare-section {
  display: none;
}

.compare-section.is-active {
  display: block;
}

.compare-highlights {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin-bottom: 0.9rem;
}

.compare-highlight {
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
}

.compare-highlight span,
.compare-highlight small {
  display: block;
}

.compare-highlight span {
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.compare-highlight strong {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.92rem;
}

.compare-highlight small {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.comparison-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}

.comparison-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.comparison-table th,
.comparison-table td {
  padding: 0.72rem 0.8rem;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  text-align: right;
  vertical-align: middle;
  white-space: nowrap;
}

.comparison-table th:last-child,
.comparison-table td:last-child {
  border-right: 0;
}

.comparison-table tr:last-child th,
.comparison-table tr:last-child td {
  border-bottom: 0;
}

.comparison-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-dark);
  color: #fff;
  font-weight: 800;
}

.comparison-table th:first-child,
.comparison-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 150px;
  text-align: left;
  background: #fff;
  font-weight: 800;
}

.comparison-table thead th:first-child {
  z-index: 3;
  background: var(--surface-dark);
}

.comparison-table td.is-best {
  background: #ecfdf3;
  color: #067647;
  font-weight: 900;
}

.comparison-table td.is-lowest {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 900;
}

.comparison-empty-cell {
  padding: 1.5rem !important;
  color: var(--muted);
  text-align: center !important;
}

.drag-ghost {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.92;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100vw - 2rem));
}

@media (max-width: 1100px) {
  .compare-highlights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .compare-highlights {
    grid-template-columns: 1fr;
  }

  .compare-selection {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
}

.search-wrap{position:relative}
.mobile-search-results{position:absolute;z-index:50;top:calc(100% + .35rem);left:0;right:0;max-height:min(58vh,420px);overflow-y:auto;border:1px solid var(--border);border-radius:14px;background:#fff;box-shadow:0 18px 42px rgba(15,23,42,.16)}
.mobile-search-result{display:block;width:100%;padding:.78rem .82rem;border:0;border-bottom:1px solid var(--border);background:#fff;color:inherit;text-align:left;cursor:pointer}
.mobile-search-result:last-child{border-bottom:0}.mobile-search-result:hover,.mobile-search-result:focus-visible{background:var(--surface-soft);outline:none}
.mobile-search-result strong,.mobile-search-result span{display:block}.mobile-search-result strong{font-size:.88rem}.mobile-search-result>span{margin-top:.15rem;color:var(--muted);font-size:.72rem}
.mobile-search-result__meta{display:flex!important;flex-wrap:wrap;gap:.42rem;margin-top:.38rem!important}.mobile-search-result__meta span{padding:.18rem .38rem;border-radius:999px;background:var(--surface-soft)}
.metric-label{display:inline-flex!important;align-items:center;gap:.32rem}
.info-tip{position:relative;display:inline-grid;place-items:center;width:19px;height:19px;padding:0;border:0;border-radius:50%;background:var(--surface-soft);color:var(--muted);font-size:.72rem;cursor:help}
.info-tip::after{content:attr(data-tooltip);position:absolute;z-index:80;left:50%;bottom:calc(100% + .55rem);width:min(290px,calc(100vw - 2rem));padding:.68rem .72rem;border-radius:10px;background:#111827;color:#fff;font-size:.74rem;font-weight:500;line-height:1.45;text-align:left;box-shadow:0 12px 28px rgba(15,23,42,.22);opacity:0;visibility:hidden;transform:translate(-50%,4px);transition:opacity 130ms ease,transform 130ms ease,visibility 130ms ease;pointer-events:none}
.info-tip:hover::after,.info-tip:focus-visible::after,.info-tip.is-open::after{opacity:1;visibility:visible;transform:translate(-50%,0)}
.history-coverage{margin-top:.7rem;padding:.7rem .8rem;border:1px solid #fed7aa;border-radius:12px;background:#fff7ed;color:#9a3412;font-size:.78rem;line-height:1.45}
.comparison-table .info-tip{margin-left:.3rem;vertical-align:middle}
@media(min-width:641px){.mobile-search-results{display:none!important}}
@media(max-width:640px){.panel--results .browse-toolbar,.panel--results .filter-grid,.panel--results .result-list,.panel--results .panel__footer{display:none}.panel--results{overflow:visible}}


/* v11: global help popover avoids clipping inside tables, cards and scroll areas. */
.info-tip::after {
  content: none !important;
}

.help-popover {
  position: fixed;
  z-index: 10000;
  width: min(320px, calc(100vw - 24px));
  padding: 0.72rem 0.78rem;
  border-radius: 11px;
  background: #111827;
  color: #fff;
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.48;
  text-align: left;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.28);
  pointer-events: none;
}

.help-popover::after {
  content: "";
  position: absolute;
  left: var(--arrow-left, 24px);
  width: 10px;
  height: 10px;
  background: #111827;
  transform: rotate(45deg);
}

.help-popover[data-placement="top"]::after {
  bottom: -5px;
}

.help-popover[data-placement="bottom"]::after {
  top: -5px;
}

.badge--risk-low,
.result-card__badges .badge--risk-low {
  background: #ecfdf3 !important;
  border-color: #86efac !important;
  color: #067647 !important;
}

.badge--risk-medium,
.badge--risk-moderate,
.result-card__badges .badge--risk-medium,
.result-card__badges .badge--risk-moderate {
  background: #fffaeb !important;
  border-color: #facc15 !important;
  color: #a15c00 !important;
}

.badge--risk-high,
.result-card__badges .badge--risk-high {
  background: #fef2f2 !important;
  border-color: #fca5a5 !important;
  color: #b42318 !important;
}

.metric strong.is-unpublished {
  font-size: 1rem;
  color: var(--muted);
}

.expense-guidance {
  margin-top: 0.85rem;
  padding: 0.78rem 0.85rem;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 0.78rem;
  line-height: 1.5;
}


/* v12 visual refresh */
.market-strip {
  width: min(1740px, calc(100% - 1rem));
  margin: 0 auto 1rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.market-stat {
  min-height: 108px;
  padding: 1rem 1.05rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(13, 148, 136, 0.10), transparent 42%),
    linear-gradient(145deg, #ffffff, #f8fafc);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.market-stat span,
.market-stat small { display: block; }

.market-stat span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.market-stat strong {
  display: block;
  margin-top: 0.34rem;
  color: #0f172a;
  font-size: 1.28rem;
}

.market-stat small {
  margin-top: 0.18rem;
  color: var(--muted);
  font-size: 0.73rem;
}

.result-card {
  position: relative;
  overflow: hidden;
  padding: 0.95rem 1rem 0.9rem 4.65rem !important;
  border-radius: 16px !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.99), rgba(248,250,252,.99));
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.result-card::before {
  content: attr(data-brand);
  position: absolute;
  left: 0.9rem;
  top: 0.95rem;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(145deg, #0f766e, #0f172a);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
}

.result-card__metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.42rem;
  margin-top: 0.72rem;
}

.result-card__metric {
  padding: 0.48rem 0.52rem;
  border-radius: 11px;
  background: rgba(241, 245, 249, 0.92);
}

.result-card__metric span,
.result-card__metric strong { display: block; }

.result-card__metric span {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.result-card__metric strong {
  margin-top: 0.12rem;
  font-size: 0.8rem;
}

.fund-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.20);
  background:
    radial-gradient(circle at top right, rgba(45, 212, 191, 0.15), transparent 35%),
    linear-gradient(145deg, #ffffff, #f8fafc);
}

.fund-hero__identity {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 16px;
  background: linear-gradient(145deg, #0f766e, #0f172a);
  color: #fff;
  font-weight: 900;
  letter-spacing: 0.03em;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.18);
}

.brand-mark--large {
  width: 68px;
  height: 68px;
  font-size: 1rem;
}

.fund-hero__copy { min-width: 0; }

.fund-hero-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 0.85rem 0;
}

.fund-hero-metrics article {
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.fund-hero-metrics span,
.fund-hero-metrics small { display: block; }

.fund-hero-metrics span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.fund-hero-metrics strong {
  display: block;
  margin-top: 0.26rem;
  font-size: 1.06rem;
}

.fund-hero-metrics small {
  margin-top: 0.18rem;
  color: var(--muted);
  font-size: 0.7rem;
}

.risk-scale {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.3rem;
  margin: 0.3rem 0 1rem;
}

.risk-scale span {
  padding: 0.5rem 0.35rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.67rem;
  font-weight: 800;
  text-align: center;
}

.risk-scale span.is-active[data-risk-step="very-low"],
.risk-scale span.is-active[data-risk-step="low"] {
  background: #dcfce7;
  color: #166534;
}

.risk-scale span.is-active[data-risk-step="moderate"],
.risk-scale span.is-active[data-risk-step="medium"] {
  background: #fef3c7;
  color: #92400e;
}

.risk-scale span.is-active[data-risk-step="high"] {
  background: #fee2e2;
  color: #991b1b;
}

@media (max-width: 920px) {
  .market-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(100% - 0.75rem, 1740px);
  }

  .fund-hero {
    flex-direction: column;
  }

  .fund-hero__identity {
    width: 100%;
  }

  .fund-hero-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .market-strip,
  .fund-hero-metrics {
    grid-template-columns: 1fr;
  }

  .result-card {
    padding-left: 4.3rem !important;
  }

  .risk-scale {
    grid-template-columns: 1fr;
  }

  .risk-scale span {
    text-align: left;
    padding-left: 0.8rem;
  }
}


/* v13 dedicated comparison workspace */
.market-strip--five { grid-template-columns: repeat(5,minmax(0,1fr)); }
.compare-panel--dedicated[hidden] { display:none !important; }
.compare-header__title { display:flex; align-items:flex-start; gap:.75rem; }
.compare-tray {
  position:fixed; z-index:9000; left:50%; bottom:18px; transform:translateX(-50%);
  width:min(980px,calc(100vw - 24px)); display:grid;
  grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:.8rem;
  padding:.72rem .82rem; border:1px solid rgba(148,163,184,.3); border-radius:18px;
  background:rgba(15,23,42,.96); color:#fff; box-shadow:0 18px 50px rgba(15,23,42,.3);
  backdrop-filter:blur(12px);
}
.compare-tray[hidden]{display:none!important}
.compare-tray__copy strong,.compare-tray__copy span{display:block}
.compare-tray__copy span{margin-top:.12rem;color:#cbd5e1;font-size:.74rem}
.compare-tray__items{display:flex;gap:.45rem;overflow-x:auto;scrollbar-width:none}
.compare-tray__items::-webkit-scrollbar{display:none}
.compare-tray-chip{display:inline-flex;align-items:center;gap:.35rem;flex:0 0 auto;padding:.42rem .52rem;border-radius:999px;background:rgba(255,255,255,.1);font-size:.74rem}
.compare-tray-chip button{border:0;background:transparent;color:#fff;cursor:pointer;font-size:1rem;line-height:1}
body.compare-mode .hero,
body.compare-mode .market-strip,
body.compare-mode .workspace > .panel--results,
body.compare-mode #fund-panel,
body.compare-mode #compare-tray { display:none !important; }
body.compare-mode .workspace { display:block; }
body.compare-mode .content-stack { width:100%; }
body.compare-mode .compare-panel--dedicated { display:block !important; width:100%; }
body.compare-mode .workspace { width:min(1740px,calc(100% - 1rem)); margin-inline:auto; }
@media(max-width:1100px){.market-strip--five{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:720px){
  .market-strip--five{grid-template-columns:1fr 1fr}
  .compare-tray{grid-template-columns:1fr auto;}
  .compare-tray__items{grid-column:1 / -1;grid-row:2}
  .compare-tray__copy{min-width:0}
  .compare-header__title{display:block}
  #compare-back{margin-bottom:.65rem}
}
@media(max-width:480px){.market-strip--five{grid-template-columns:1fr}}


/* v14 compact information hierarchy */
.topbar__inner {
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
}

.topbar-insight {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  color: #cbd5e1;
  font-size: 0.74rem;
  white-space: nowrap;
}

.topbar-insight strong {
  color: #fff;
}

.topbar-insight__divider {
  color: #475569;
}

.hero-search-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.65rem;
}

.hero-search-stats > div {
  padding: 0.6rem 0.7rem;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  background: rgba(255,255,255,0.07);
  backdrop-filter: blur(4px);
}

.hero-search-stats span,
.hero-search-stats small {
  display: block;
}

.hero-search-stats span {
  color: #a7f3d0;
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hero-search-stats strong {
  display: block;
  margin-top: 0.12rem;
  color: #fff;
  font-size: 0.94rem;
}

.hero-search-stats small {
  margin-top: 0.08rem;
  color: #cbd5e1;
  font-size: 0.65rem;
}

.market-strip--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.market-stat--winner {
  min-height: 124px;
}

.winner-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.winner-meta .badge {
  font-size: 0.64rem;
  padding: 0.24rem 0.42rem;
}

.hero__search {
  position: relative;
}

/* Search suggestions now work on both desktop and mobile. */
.mobile-search-results {
  display: block;
  top: calc(100% + 0.35rem);
}

.mobile-search-results[hidden] {
  display: none !important;
}

@media (min-width: 641px) {
  .mobile-search-results {
    display: block !important;
  }

  .mobile-search-results[hidden] {
    display: none !important;
  }
}

@media (max-width: 1100px) {
  .topbar-insight {
    display: none;
  }

  .market-strip--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .market-strip--three {
    grid-template-columns: 1fr;
  }

  .hero-search-stats {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .hero-search-stats {
    grid-template-columns: 1fr;
  }
}


/* v15: compact search-first experience */
.hero-leaders {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.48rem;
  margin-bottom: 0.65rem;
}

.hero-leader {
  min-width: 0;
  padding: 0.56rem 0.62rem;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  background: rgba(255,255,255,0.07);
  color: #fff;
  text-align: left;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition:
    background 140ms ease,
    border-color 140ms ease,
    transform 140ms ease;
}

.hero-leader:hover,
.hero-leader:focus-visible {
  background: rgba(255,255,255,0.12);
  border-color: rgba(167,243,208,0.45);
  transform: translateY(-1px);
  outline: none;
}

.hero-leader span,
.hero-leader strong,
.hero-leader small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-leader span {
  color: #a7f3d0;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hero-leader strong {
  margin-top: 0.12rem;
  font-size: 0.92rem;
}

.hero-leader small {
  margin-top: 0.08rem;
  color: #cbd5e1;
  font-size: 0.64rem;
}

/* Compact one-line autocomplete rows to show many matches. */
.mobile-search-results {
  max-height: min(62vh, 520px);
  border-radius: 12px;
}

.mobile-search-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.65rem;
  min-height: 42px;
  padding: 0.48rem 0.62rem;
}

.mobile-search-result__main {
  min-width: 0;
}

.mobile-search-result__main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.80rem;
}

.mobile-search-result__nav {
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.mobile-search-result__risk .badge {
  white-space: nowrap;
  font-size: 0.61rem;
  padding: 0.20rem 0.36rem;
}

.mobile-search-result--empty {
  display: block;
  min-height: auto;
  padding: 0.75rem 0.8rem;
}

.search-results-count {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

@media (max-width: 760px) {
  .hero-leaders {
    grid-template-columns: 1fr;
  }

  .hero-leader {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: center;
    gap: 0.5rem;
  }

  .hero-leader span,
  .hero-leader strong,
  .hero-leader small {
    margin: 0;
  }
}

@media (max-width: 480px) {
  .mobile-search-result {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .mobile-search-result__risk {
    grid-column: 1 / -1;
  }
}


/* v15.1: dropdown is anchored to the hero search area. */
.hero__search {
  position: relative;
  z-index: 70;
  overflow: visible;
}

.hero__search .mobile-search-results {
  position: absolute;
  z-index: 1000;
  top: calc(100% - 1.15rem);
  left: 0;
  right: 0;
  width: 100%;
  max-height: min(62vh, 520px);
  overflow-y: auto;
}

.hero,
.hero__inner,
.search-box {
  overflow: visible;
}


/* v16: mobile data summary and mutual-fund ticker */
.fund-ticker {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: stretch;
  min-height: 38px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  background: #0f172a;
  color: #e2e8f0;
  overflow: hidden;
}

.fund-ticker__label {
  position: relative;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 0 0.9rem;
  background: #0f766e;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.fund-ticker__viewport {
  min-width: 0;
  overflow: hidden;
}

.fund-ticker__track {
  display: flex;
  align-items: center;
  width: max-content;
  min-height: 38px;
  animation: paktracker-ticker 150s linear infinite;
  will-change: transform;
}

.fund-ticker:hover .fund-ticker__track,
.fund-ticker:focus-within .fund-ticker__track {
  animation-play-state: paused;
}

.fund-ticker__loading {
  padding: 0 1rem;
  color: #94a3b8;
  font-size: 0.75rem;
}

.fund-ticker__item {
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  min-height: 38px;
  padding: 0 0.85rem;
  border: 0;
  border-right: 1px solid rgba(148, 163, 184, 0.16);
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.fund-ticker__item:hover,
.fund-ticker__item:focus-visible {
  background: rgba(255, 255, 255, 0.07);
  outline: none;
}

.fund-ticker__name {
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
  font-size: 0.73rem;
  font-weight: 800;
}

.fund-ticker__metric {
  color: #cbd5e1;
  font-size: 0.69rem;
}

.fund-ticker__metric strong {
  color: #fff;
}

.fund-ticker__return {
  font-size: 0.69rem;
  font-weight: 800;
}

.fund-ticker__return.is-positive {
  color: #86efac;
}

.fund-ticker__return.is-negative {
  color: #fca5a5;
}

.fund-ticker__return.is-neutral {
  color: #fde68a;
}

.fund-ticker__trend {
  padding: 0.18rem 0.38rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.fund-ticker__trend.is-positive {
  background: rgba(34, 197, 94, 0.16);
  color: #86efac;
}

.fund-ticker__trend.is-mixed {
  background: rgba(245, 158, 11, 0.16);
  color: #fde68a;
}

.fund-ticker__trend.is-negative {
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
}

@keyframes paktracker-ticker {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

/* Keep the requested data summary visible on phones. */
@media (max-width: 1100px) {
  .topbar__inner {
    grid-template-columns: auto 1fr auto;
  }

  .topbar-insight {
    display: flex !important;
    justify-content: center;
    min-width: 0;
    overflow: hidden;
  }
}

@media (max-width: 700px) {
  .topbar {
    min-height: auto;
  }

  .topbar__inner {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand status"
      "summary summary";
    row-gap: 0.45rem;
    padding-top: 0.6rem;
    padding-bottom: 0.55rem;
  }

  .brand {
    grid-area: brand;
  }

  .data-status {
    grid-area: status;
  }

  .topbar-insight {
    grid-area: summary;
    justify-content: flex-start;
    gap: 0.38rem;
    width: 100%;
    overflow-x: auto;
    padding-top: 0.4rem;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
    scrollbar-width: none;
    font-size: 0.68rem;
  }

  .topbar-insight::-webkit-scrollbar {
    display: none;
  }

  .fund-ticker {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .fund-ticker__label {
    padding: 0 0.58rem;
    font-size: 0.6rem;
  }

  .fund-ticker__track {
    animation-duration: 210s;
  }

  .fund-ticker__name {
    max-width: 160px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fund-ticker__track {
    animation: none;
    transform: none;
  }

  .fund-ticker__viewport {
    overflow-x: auto;
  }
}


.badge--rating {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #4338ca;
}

.result-card__badges .badge--rating {
  font-weight: 800;
}


/* v16.2: asset-class metadata card */
.info-card #detail-asset-class {
  line-height: 1.25;
}


/* v17 frontend finish pack */
.topbar__actions { display:flex; align-items:center; gap:.65rem; }
.theme-toggle {
  width:34px;height:34px;border:1px solid rgba(148,163,184,.22);border-radius:999px;
  background:rgba(255,255,255,.06);color:#e2e8f0;cursor:pointer;font-size:1rem;
}
.theme-toggle:hover,.theme-toggle:focus-visible{background:rgba(255,255,255,.12);outline:none}

.brand-mark img,.result-card__logo img{width:100%;height:100%;object-fit:contain;display:block}
.brand-mark img[hidden],.result-card__logo img[hidden]{display:none}
.brand-mark span[hidden]{display:none}
.result-card::before{content:none!important}
.result-card__logo{
  position:absolute;left:.9rem;top:.95rem;width:46px;height:46px;border-radius:14px;
  overflow:hidden;box-shadow:0 8px 18px rgba(15,23,42,.16);background:#fff;
}
.result-card__logo-fallback{
  display:grid;place-items:center;width:100%;height:100%;
  background:linear-gradient(145deg,#0f766e,#0f172a);color:#fff;font-size:.78rem;font-weight:900;
}

.result-card__sparkline {
  margin-top:.62rem;height:38px;border-radius:10px;background:rgba(241,245,249,.72);
  overflow:hidden;position:relative;
}
.result-card__sparkline svg{display:block;width:100%;height:100%}
.result-card__sparkline .sparkline-placeholder{
  position:absolute;inset:0;background:linear-gradient(90deg,transparent,rgba(255,255,255,.7),transparent);
  animation:sparkline-shimmer 1.4s infinite;
}
@keyframes sparkline-shimmer{from{transform:translateX(-100%)}to{transform:translateX(100%)}}

.peer-panel{margin-top:1.2rem;padding-top:1rem;border-top:1px solid var(--border)}
.peer-comparison{display:grid;gap:.7rem}
.peer-row{
  display:grid;grid-template-columns:110px minmax(0,1fr) 110px;gap:.75rem;align-items:center;
  padding:.8rem;border:1px solid var(--border);border-radius:14px;background:var(--surface-soft);
}
.peer-row__label strong,.peer-row__label span{display:block}
.peer-row__label span{font-size:.68rem;color:var(--muted)}
.peer-bars{display:grid;gap:.35rem}
.peer-bar{display:grid;grid-template-columns:64px minmax(0,1fr) 64px;gap:.45rem;align-items:center;font-size:.7rem}
.peer-bar__track{height:8px;border-radius:999px;background:#e2e8f0;overflow:hidden}
.peer-bar__fill{height:100%;border-radius:inherit;background:var(--accent)}
.peer-bar--peer .peer-bar__fill{background:#94a3b8}
.peer-rank{text-align:right}
.peer-rank strong,.peer-rank span{display:block}
.peer-rank span{font-size:.68rem;color:var(--muted)}
.peer-loading{padding:1rem;border:1px dashed var(--border);border-radius:12px;color:var(--muted)}

.empty-state{
  min-height:220px;display:grid;place-items:center;align-content:center;gap:.45rem;text-align:center;
  padding:1.2rem;border:1px dashed var(--border);border-radius:16px;background:var(--surface-soft)
}
.empty-state__icon{display:grid;place-items:center;width:48px;height:48px;border-radius:16px;background:#e2e8f0;font-size:1.4rem}
.empty-state .button{margin-top:.4rem}
.app-error-banner{
  position:fixed;left:50%;bottom:1rem;transform:translateX(-50%);z-index:10000;
  max-width:min(620px,calc(100vw - 2rem));padding:.75rem 1rem;border-radius:12px;
  background:#7f1d1d;color:#fff;box-shadow:0 18px 42px rgba(15,23,42,.25)
}

/* Dark mode */
html[data-theme="dark"]{
  --background:#08111f;--surface:#101a2b;--surface-soft:#152238;--text:#e5edf7;
  --muted:#9fb0c7;--border:#28374d;--accent:#2dd4bf;--accent-dark:#14b8a6;
  --shadow:0 12px 30px rgba(0,0,0,.26);
}
html[data-theme="dark"] body{background:var(--background);color:var(--text)}
html[data-theme="dark"] .panel,
html[data-theme="dark"] .metric,
html[data-theme="dark"] .info-card,
html[data-theme="dark"] .fund-hero,
html[data-theme="dark"] .fund-hero-metrics article,
html[data-theme="dark"] .result-card,
html[data-theme="dark"] .chart-card,
html[data-theme="dark"] .market-stat{background:#101a2b;color:var(--text);border-color:var(--border)}
html[data-theme="dark"] .result-card__metric,
html[data-theme="dark"] .result-card__sparkline,
html[data-theme="dark"] .peer-row{background:#152238}
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] .search-box,
html[data-theme="dark"] .mobile-search-results,
html[data-theme="dark"] .mobile-search-result{background:#101a2b;color:var(--text);border-color:var(--border)}
html[data-theme="dark"] .mobile-search-result:hover{background:#152238}
html[data-theme="dark"] .button--ghost,
html[data-theme="dark"] .detail-tabs button,
html[data-theme="dark"] .range-pills button{background:#101a2b;color:var(--text);border-color:var(--border)}
html[data-theme="dark"] .peer-bar__track{background:#334155}
html[data-theme="dark"] .empty-state__icon{background:#243349}

@media(max-width:700px){
  .peer-row{grid-template-columns:1fr}
  .peer-rank{text-align:left;display:flex;gap:.45rem;align-items:baseline}
}
