/* ============================================
   FUNDULATOR - MUTUAL FUNDS CSS
   Optimized Single File
   ============================================ */

/* ============================================
   THEME VARIABLES
   ============================================ */
:root {
  --primary-color: #e65c00;
  --secondary-color: #00cc6a;
  --primary-hover: #2563eb;
  --success-color: #e65c00;
  --error-color: #df0e0e;
  
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-hover: #f8fafc;
  
  --text-primary: #0f172a;
  --text-secondary: #d9dadc;
  --text-muted-mf: #110f0f;
  
  --border-subtle: rgba(0, 0, 0, 0.06);
  --border-medium: rgba(0, 0, 0, 0.1);
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 0.75rem;
  --space-lg: 1rem;
  --space-xl: 1.5rem;
  
  /* Typography */
  --font-xs: 0.6875rem;
  --font-sm: 0.8125rem;
  --font-base: 0.9375rem;
  --font-lg: 1.125rem;
  --font-xl: 1.5rem;
  
  --font-primary: 'DM Sans', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

body {
  padding-top: 100px;
}

.theme-dark {
  --primary-color: #00ff85;
  --secondary-color: #e65c00;
  --success-color: #00ff85;
  --bg-primary: #0a0e14;
  --bg-secondary: #131821;
  --bg-card: #0d0f16;
  --bg-hover: #1f2635;
  
  --text-primary: #e4e6eb;
  --text-secondary: #ffffff;
  --text-muted-mf: #685656;
  
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-medium: rgba(71, 16, 16, 0.1);
}

/* ============================================
   FUND PAGE SPECIFIC - HEADER FIX
   ============================================ */
body.compact-layout {
  font-family: var(--font-primary);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  font-size: var(--font-base);
  padding: var(--space-lg);
  max-width: 1150px;
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
  padding-top: 100px !important; /* FIX: Account for fixed header */
}

/* ============================================
   LOADING & ERROR STATES
   ============================================ */
.compact-loading,
.compact-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  text-align: center;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-medium);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.compact-loading p,
.compact-error p {
  margin-top: var(--space-lg);
  color: var(--text-secondary);
  font-size: var(--font-sm);
}

.btn-back {
  margin-top: var(--space-lg);
  padding: var(--space-sm) var(--space-lg);
  background: var(--bg-card);
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 6px;
  font-size: var(--font-sm);
  border: 1px solid var(--border-medium);
  transition: all 0.2s;
}

.btn-back:hover {
  background: var(--bg-hover);
}

/* ============================================
   COMPACT CONTAINER
   ============================================ */
.compact-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

/* ============================================
   SUMMARY CARD - Compact (No Max Gain/Drawdown)
   ============================================ */
.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: var(--space-md);
  display: grid;
  flex-direction: column;
  gap: var(--space-md);
  align-items: center;
  margin-bottom: 5px;
  align-items: center;
  
}

.summary-left {
  min-width: 0;
}

.fund-title {
  font-size: var(--font-xl);
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
  line-height: 1.2;
}

.fund-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.fund-links {
  margin-top: 0.45rem;
}

.amc-factsheet-panel {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.8rem 0.95rem;
  margin-top: 0.7rem;
  margin-bottom: 0.7rem;
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--primary-color);
  border-radius: 12px;
}

.amc-factsheet-content {
  min-width: 0;
}

.amc-factsheet-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.amc-factsheet-reason {
  margin-top: 0.25rem;
  margin-bottom: 0;
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.fund-link {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--primary-color);
  text-decoration: none;
}

.fund-link:hover {
  text-decoration: underline;
}

.amc-factsheet-cta {
  white-space: nowrap;
  border: 1px solid var(--primary-color);
  border-radius: 999px;
  padding: 0.1rem 0.2rem;
  background: var(--bg-card);
  color: #ffffff;
  font-weight: 700;
  align-self: flex-end;
}

.amc-factsheet-cta:hover {
  border-color: var(--primary-color);
  color: #ffffff;
  opacity: 0.92;
  text-decoration: none;
}

@media (max-width: 768px) {
  .amc-factsheet-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .amc-factsheet-cta {
    align-self: flex-start;
  }
}

.compare-btn {
  margin-top: var(--space-md);
  border: 1px solid var(--border-medium);
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: var(--font-xs);
  font-weight: 700;
  cursor: pointer;
}

.compare-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.badge {
  padding: 0.25rem 0.625rem;
  border-radius: 4px;
  font-size: var(--font-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 0.55rem;
}

.badge-category { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.badge-subcategory { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.badge-plan { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-option { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-lockin { background: rgba(239, 68, 68, 0.15); color: #f87171; }

.summary-right {
  border-left: 1px solid var(--border-subtle);
  padding-left: var(--space-md);
  justify-items: center;
  text-align: center;
}

/* Updated: 3 columns instead of 5 */
.metric-grid {
  display: inline-grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 50px;
  min-width: 0;
  width: 100%;
}

.metric {
  text-align: center;
}

.metric-label {
  font-size: var(--font-xs);
  color: var(--text-muted-mf);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.metric-value {
  font-size: var(--font-md);
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--primary-color);
}

.metric-value.positive { color: var(--success-color); }
.metric-value.negative { color: var(--error-color); }

.metric-date {
  font-size: var(--font-xs);
  color: var(--text-muted-mf);
  margin-top: 0.125rem;
}

/* ============================================
   CHART SECTION - Optimized
   ============================================ */
.chart-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: var(--space-xl);
  margin-bottom: 5px;
}

.compare-page {
  max-width: 1150px;
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
  display: grid;
  gap: var(--space-lg);
}

.compare-header,
.compare-chart-card,
.compare-table-card {
  padding: var(--space-lg);
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}

.compare-title {
  margin-bottom: var(--space-md);
}

.compare-slots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-md);
}

/* ── Slot: shared ── */
.compare-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.cs-label {
  font-size: var(--font-xs);
  color: var(--text-muted-mf);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* ── Empty slot: + button ── */
.compare-slot-empty .cs-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.65rem 0.75rem;
  background: var(--bg-secondary);
  border: 1.5px dashed var(--border-medium);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: var(--font-sm);
  font-family: var(--font-primary);
  cursor: pointer;
  transition: all 0.2s;
}

.compare-slot-empty .cs-add-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: rgba(59,130,246,0.05);
}

.cs-plus {
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1;
}

.cs-add-text {
  font-weight: 500;
}

/* ── Filled slot: fund card ── */
.cs-fund-card {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.6rem 0.65rem;
  border: 1.5px solid;
  border-radius: 10px;
  cursor: pointer;
  transition: opacity 0.15s;
  min-width: 0;
}

.cs-fund-card:hover {
  opacity: 0.85;
}

.cs-color-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 0.25rem;
}

.cs-fund-name {
  flex: 1;
  min-width: 0;
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.35;
  word-break: break-word;
}

.cs-remove-btn {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: #3a0303;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.1rem 0.2rem;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
  margin-top: 0.1rem;
  font-weight: 800;
}

.cs-remove-btn:hover {
  color: var(--error-color);
  background: rgba(239,68,68,0.1);
}

/* ── Central search panel ── */
.compare-search-panel {
  margin-top: var(--space-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  overflow: hidden;
}

.csp-inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.csp-slot-hint {
  font-size: var(--font-xs);
  color: var(--text-muted-mf);
  padding: 0.3rem 0.75rem 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.csp-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: var(--font-base);
  font-family: var(--font-primary);
  padding: 0.2rem 0;
}

.csp-input::placeholder {
  color: var(--text-muted-mf);
}

.csp-close {
  background: transparent;
  border: none;
  color: var(--text-muted-mf);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.2rem 0.35rem;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}

.csp-close:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.csp-results {
  max-height: 260px;
  overflow-y: auto;
}

.csp-loading,
.csp-no-results {
  padding: 0.75rem 0.85rem;
  font-size: var(--font-sm);
  color: var(--text-secondary);
  text-align: center;
}

.csp-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.85rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s;
}

.csp-item:last-child {
  border-bottom: none;
}

.csp-item:hover:not(:disabled) {
  background: rgba(59,130,246,0.08);
}

.csp-item.csp-item-used {
  opacity: 0.4;
  cursor: not-allowed;
}

.csp-item-name {
  display: block;
  font-size: var(--font-sm);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

.csp-item-amc {
  display: block;
  font-size: var(--font-xs);
  color: var(--text-secondary);
  margin-top: 0.1rem;
}

.compare-line-results {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.8rem 0;
}

.compare-line-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  font-size: var(--font-sm);
  background: var(--bg-secondary);
}

.compare-line-item .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.compare-line-item .value {
  font-family: var(--font-mono);
}

.compare-line-item .value.abs-value {
  color: var(--secondary-color);
}

.compare-line-item .metrics {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
}

.compare-line-item .value.positive {
  color: var(--success-color);
}

.compare-line-item .value.negative {
  color: var(--error-color);
}

.compare-chart-wrap {
  height: 400px;
}

.compare-returns-table {
  width: 100%;
  table-layout: fixed;
}

.compare-returns-table th,
.compare-returns-table td {
  white-space: nowrap;
}

.compare-returns-table th {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.table-scroll {
  overflow-x: auto;
}

.compare-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.compare-table-head .card-title {
  margin-bottom: 0;
}

.compare-mode-toggle {
  display: inline-flex;
  gap: 0.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.2rem;
}

.compare-mode-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--font-xs);
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font-primary);
}

.compare-mode-btn.active {
  background: var(--primary-color);
  color: #fff;
}

.range-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: var(--space-sm);
  justify-items: center;
}

.range-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: var(--font-sm);
  font-weight: 500;
  padding: var(--space-sm) var(--space-md);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
  font-family: var(--font-primary);
}

.range-tab:hover {
  color: var(--text-primary);
  background: rgba(59, 130, 246, 0.1);
}

.range-tab.active {
  color: var(--primary-color);
  background: rgba(59, 130, 246, 0.15);
}

.range-tab:disabled,
.range-tab.disabled {
  color: var(--text-muted-mf);
  background: transparent;
  cursor: not-allowed;
  opacity: 0.5;
}

.range-tab:disabled:hover,
.range-tab.disabled:hover {
  color: var(--text-muted-mf);
  background: transparent;
}

/* ============================================
   CHART WITH LEFT-SIDE STATS LAYOUT
   ============================================ */

/* Container for stats + chart side-by-side */
.chart-with-stats {
  display: flex;
  gap: var(--space-xl);
  align-items: stretch;
}

/* Right: Stats in 2-column grid (30%) - appears on right due to HTML order */
.chart-stats-left {
  flex: 0 0 150px;
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: var(--space-md);
  align-content: start;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-sm);
  transition: all 0.2s;
}

.stat-card:hover {
  background: var(--bg-hover);
  border-color: var(--border-medium);
  transform: translateY(-1px);
}

.stat-label {
  font-size: var(--font-xs);
  color: var(--text-muted-mf);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
  line-height: 1.2;
}

.stat-value {
  font-size: var(--font-md);
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-primary);
  line-height: 1;
}

.stat-value.positive { color: var(--success-color); }
.stat-value.negative { color: var(--error-color); }

/* Left: Chart (70%) - appears first in HTML */
.chart-wrapper-right {
  flex: 1;
  height: 350px;
  position: relative;
  min-width: 0;
}

.chart-compare-btn {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  margin-top: 0;
  z-index: 2;
}

.chart-wrapper-right canvas {
  max-height: 100%;
}

/* ============================================
   COMPACT GRID - Returns & Calculator
   ============================================ */
.compact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: var(--space-xl);
}

.card-title {
  font-size: var(--font-base);
  font-weight: 600;
  margin-bottom: 0;
  color: var(--text-primary);
}

/* ============================================
   RETURNS TABLE
   ============================================ */
.returns-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-sm);
}

.returns-table thead th {
  text-align: center;
  padding: var(--space-sm) var(--space-md);
  color: var(--text-muted-mf);
  font-weight: 500;
  font-size: var(--font-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-subtle);
}

.returns-table tbody td {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: var(--font-sm);
      text-align: center;
}

.returns-table tbody td:first-child {
  color: var(--text-secondary);
  font-family: var(--font-primary);
}

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

.returns-table .positive { color: var(--success-color); }
.returns-table .negative { color: var(--error-color); }

.sip-day-card {
  margin-top: 0.7rem;
  padding: 0.75rem 0.8rem;
}

.sip-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  margin-bottom: 0;
  cursor: pointer;
}

.sip-day-head .card-title {
  font-size: 0.9rem;
}

.sip-day-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid var(--border-medium);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.24rem 0.48rem;
  cursor: pointer;
}

.sip-day-toggle-arrow {
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  transition: transform 0.2s ease;
}

.sip-day-card.expanded .sip-day-toggle-arrow {
  transform: rotate(225deg) translateY(-1px);
}

.sip-day-collapsible {
  margin-top: 0.35rem;
}

.sip-day-controls {
  display: flex;
  justify-content: center;
  margin-bottom: 0.35rem;
}

.sip-day-period-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  color: var(--text-secondary);
  font-size: 0.68rem;
}

.sip-day-period-select {
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  border-radius: 8px;
  font-size: 0.68rem;
  padding: 0.2rem 0.36rem;
}

.sip-day-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.sip-day-meta-card {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-secondary);
  padding: 0.3rem 0.42rem;
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
}

.sip-day-meta-label {
  font-size: 0.56rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted-mf);
  font-weight: 700;
}

.sip-day-meta-value {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-primary);
  font-weight: 700;
}

.sip-day-note {
  margin: 0.35rem 0 0;
  color: var(--text-muted-mf);
  font-size: 0.65rem;
  line-height: 1.35;
}

.sip-day-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}

.sip-day-summary-card {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-secondary);
  padding: 0.3rem 0.42rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.sip-day-summary-label {
  font-size: 0.56rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted-mf);
  font-weight: 700;
}

.sip-day-summary-value {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-primary);
  font-weight: 700;
}

.sip-day-summary-sub {
  font-size: 0.62rem;
  color: var(--text-secondary);
}

.sip-day-table-wrap {
  overflow-x: auto;
}

.sip-day-desktop-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.sip-day-table-col {
  min-width: 0;
}

.sip-day-mobile-wrap {
  display: none;
}

.sip-day-table {
  min-width: 300px;
  font-size: 0.72rem;
}

.sip-day-table thead th {
  padding: 0.3rem 0.4rem;
  font-size: 0.58rem;
}

.sip-day-table tbody td {
  padding: 0.34rem 0.4rem;
  font-size: 0.72rem;
}

.sip-day-table tbody td {
  white-space: nowrap;
}

.sip-day-table tbody td:first-child {
  font-weight: 700;
  color: var(--text-primary);
}

.sip-day-table tbody tr.best-sip-day-row td {
  background: rgba(16, 185, 129, 0.12);
  border-bottom-color: rgba(16, 185, 129, 0.45);
}

.sip-day-table tbody tr.best-sip-day-row td:first-child {
  color: var(--success-color);
}

@media (max-width: 640px) {
  .sip-day-card {
    padding: 0.62rem 0.65rem;
  }

  .sip-day-table-wrap {
    overflow-x: hidden;
  }

  .sip-day-desktop-grid {
    display: none;
  }

  .sip-day-mobile-wrap {
    display: block;
  }

  .sip-day-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }

  .sip-day-table thead th,
  .sip-day-table tbody td {
    padding: 0.28rem 0.28rem;
    font-size: 0.66rem;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .sip-day-table thead th:nth-child(1),
  .sip-day-table tbody td:nth-child(1) {
    width: 32%;
  }

  .sip-day-table thead th:nth-child(2),
  .sip-day-table tbody td:nth-child(2) {
    width: 68%;
  }

  .sip-day-head {
    align-items: center;
  }

  .sip-day-controls {
    justify-content: flex-start;
  }

  .sip-day-meta-grid,
  .sip-day-summary {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   CALCULATOR
   ============================================ */
.calc-toggle {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  background: var(--bg-secondary);
  padding: 0.25rem;
  border-radius: 6px;
}

.calc-toggle-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: var(--space-sm);
  color: var(--text-secondary);
  font-size: var(--font-sm);
  font-weight: 500;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
  font-family: var(--font-primary);
}

.calc-toggle-btn.active {
  background: var(--primary-color);
  color: white;
}

.calc-input-group {
  margin-bottom: var(--space-lg);
}

.calc-label {
  display: block;
  font-size: var(--font-xs);
  color: var(--text-muted-mf);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-sm);
}

.calc-input-wrapper {
  position: relative;
}

.currency {
  position: absolute;
  left: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted-mf);
  font-size: var(--font-sm);
}

.calc-input {
  width: 100%;
  padding: var(--space-md) var(--space-md) var(--space-md) 2rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: var(--font-sm);
  font-family: var(--font-mono);
  transition: all 0.2s;
}

.calc-input:focus {
  outline: none;
  border-color: var(--primary-color);
  background: var(--bg-primary);
}

.calc-select {
  width: 100%;
  padding: var(--space-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: var(--font-sm);
  cursor: pointer;
  font-family: var(--font-primary);
  transition: all 0.2s;
}

.calc-select:focus {
  outline: none;
  border-color: var(--primary-color);
  background: var(--bg-primary);
}

/* NEW: Inline result display */
.calc-inline-result {
  margin-top: var(--space-sm);
  padding: var(--space-md);
  background: rgba(59, 130, 246, 0.05);
  border-left: 3px solid var(--primary-color);
  border-radius: 4px;
  font-size: var(--font-sm);
  color: var(--text-secondary);
}

.calc-inline-result strong {
  color: var(--primary-color);
  font-family: var(--font-mono);
  font-size: var(--font-md);
}

.calc-results {
  display: grid;

  gap: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-subtle);
  margin-top: var(--space-lg);
}

.calc-result-item {
  text-align: center;
}

.calc-result-label {
  font-size: var(--font-xs);
  color: var(--text-muted-mf);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.calc-result-value {
  font-size: var(--font-md);
  font-weight: 600;
  font-family: var(--font-md);
  color: var(--text-primary);
}

.calc-result-value.highlight {
  color: var(--primary-color);
  font-size: 1.1rem;
}

.calc-result-value.positive { color: var(--success-color); }
.calc-result-value.negative { color: var(--error-color); }

.fund-calc-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  align-items: start;
}

.fund-calc-inputs,
.fund-calc-results-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: var(--space-lg);
}

.fund-calc-results-panel {
  min-height: 100%;
}

.fund-calc-results-panel .calc-inline-result {
  margin-top: 0;
  margin-bottom: var(--space-md);
}

.fund-calc-results-panel .calc-results {
  margin-top: 0;
  padding-top: var(--space-md);
}

/* ============================================
   SIMILAR FUNDS
   ============================================ */
.similar-funds-section {
  margin-top: var(--space-xl);
  padding: var(--space-xl);
}

.similar-funds-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.similar-funds-meta {
  margin: 0;
  font-size: var(--font-xs);
  color: var(--text-muted-mf);
}

.similar-funds-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-md);
}

.similar-fund-item {
  position: relative;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(59, 130, 246, 0.08), transparent 44%),
    linear-gradient(0deg, var(--bg-secondary), var(--bg-secondary));
  padding: 0.85rem 0.9rem;
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.14);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.similar-fund-item::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, #3b82f6, #10b981);
  opacity: 0.95;
}

.similar-fund-item:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(2, 6, 23, 0.2);
}

.compare-popular-item {
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-primary);
  background:
    linear-gradient(140deg, rgba(59, 130, 246, 0.14), rgba(59, 130, 246, 0.02) 58%),
    var(--bg-secondary);
  border: 1px solid rgba(59, 130, 246, 0.28);
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.14);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.compare-popular-item:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(2, 6, 23, 0.2);
}

.compare-popular-names {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0;
}

.compare-popular-fund {
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1.35;
  letter-spacing: 0.01em;
}

.compare-popular-vs {
  justify-self: start;
  font-size: 0.64rem;
  color: var(--primary-color);
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.28);
  border-radius: 999px;
  padding: 0.14rem 0.48rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
}

.theme-dark .compare-popular-item {
  border-color: rgba(96, 165, 250, 0.35);
  background:
    linear-gradient(150deg, rgba(30, 64, 175, 0.34), rgba(30, 64, 175, 0.04) 62%),
    var(--bg-secondary);
}

.theme-dark .compare-popular-fund,
.theme-dark .compare-popular-vs {
  color: #93c5fd;
}

.compare-popular-returns {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.similar-fund-name {
  display: inline-block;
  margin-bottom: 0.62rem;
  font-size: var(--font-sm);
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  text-decoration: none;
}

.similar-fund-name:hover {
  color: var(--primary-color);
}

.similar-fund-subcategory {
  font-size: var(--font-xs);
  color: var(--text-muted-mf);
  margin-bottom: 0.65rem;
}

.similar-fund-returns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  font-size: var(--font-xs);
  color: var(--text-secondary);
}

.similar-fund-returns span {
  font-family: var(--font-mono);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-medium);
  border-radius: 999px;
  padding: 0.28rem 0.36rem;
  background: rgba(148, 163, 184, 0.08);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.similar-fund-returns span.positive {
  color: var(--success-color);
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.12);
}

.similar-fund-returns span.negative {
  color: var(--error-color);
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.12);
}

.similar-fund-returns span.neutral {
  color: var(--text-muted-mf);
  border-style: dashed;
}

.similar-funds-state {
  color: var(--text-secondary);
  font-size: var(--font-sm);
}

/* ============================================
   FAQ SECTION
   ============================================ */
.mf-faq-section {
  padding: var(--space-lg);
}

.mf-faq-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.mf-faq-list {
  display: grid;
  gap: 0.6rem;
}

.mf-faq-item {
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-secondary);
  overflow: hidden;
}

.mf-faq-trigger {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-primary);
  color: var(--text-primary);
  padding: 0.75rem 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.mf-faq-trigger:hover {
  background: var(--bg-hover);
}

.mf-faq-q {
  font-size: var(--font-sm);
  font-weight: 600;
  line-height: 1.35;
}

.mf-faq-icon {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-color);
  flex-shrink: 0;
}

.mf-faq-answer {
  padding: 0 0.9rem 0.8rem;
}

.mf-faq-answer p {
  margin: 0;
  font-size: var(--font-sm);
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ============================================
   DISCLAIMER
   ============================================ */
.disclaimer {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 6px;
  padding: var(--space-lg);
  font-size: var(--font-xs);
  color: var(--text-secondary);
  line-height: 1.5;
}

.mf-panel {
  background: var(--bg-card);
  border: 1px solid var(--border, var(--border-medium));
  border-radius: 16px;
  box-shadow: var(--shadow, 0 8px 24px rgba(0, 0, 0, 0.12));
}

/* ============================================
   INDEX PAGE - SEARCH & BROWSE
   ============================================ */
.mf-hero {
  text-align: center;
  padding: 2rem 0.5rem 1rem;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 20;
  overflow: visible;
}

.hero.mf-hero h1 {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mf-hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.mf-hero p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.mf-search-container {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
  z-index: 30;
}

.mf-search-input {
  width: 100%;
  padding: 0.7rem 2rem 0.7rem 1rem;
  font-size: 1rem;
  border: 2px solid var(--border-medium);
  border-radius: 12px;
  background: var(--bg-card);
  color: var(--text-primary);
  transition: all 0.2s;
}

.mf-search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.mf-search-loader {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

.loading-small {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-medium);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.mf-search-results {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  max-height: 320px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.mf-result-item {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}

.mf-result-item:hover {
  background: rgba(59, 130, 246, 0.12);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.2);
}

.mf-result-item.active {
  background: rgba(59, 130, 246, 0.16);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.35);
  border-left: 3px solid var(--primary-color);
  padding-left: calc(0.85rem - 3px);
}

.mf-result-item:last-child {
  border-bottom: none;
}

.mf-result-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.25;
  margin: 0;
  display: -webkit-box;
  line-clamp: 1;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mf-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.mf-result-return {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--success-color);
  background: rgba(82, 84, 222, 0.1);
  border: 1px solid rgba(82, 84, 222, 0.2);
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
  white-space: nowrap;
}

.mf-result-return.mf-return-na {
  color: var(--text-muted-mf);
  background: transparent;
  border-color: var(--border-subtle);
}

.mf-search-empty,
.mf-search-error {
  padding: 0.85rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: var(--font-sm);
}

.mf-search-hint {
  margin-top: 0.35rem;
  font-size: var(--font-xs);
  color: var(--text-muted-mf);
}

.mf-search-view-all {
  width: 100%;
  border: none;
  border-top: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--primary-color);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.6rem 0.85rem;
  cursor: pointer;
  text-align: center;
}

.mf-search-view-all:hover {
  background: var(--bg-hover);
}

.mf-search-view-all.active {
  background: rgba(59, 130, 246, 0.16);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.35);
}

.mf-section {
  max-width: 1150px;
  margin: 3rem auto;
  padding: 0 1rem;
}

.mf-section.mf-panel {
  padding: 1rem;
  margin: 1rem auto;
}

.mf-browse-results {
  max-width: 1150px;
  margin: 0 auto;
  padding: 0 1rem;
}

.mf-browse-results.mf-panel {
  padding: 1rem;
  margin: 1rem auto;
}

.mf-section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.mf-amc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.55rem;
}

.mf-amc-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.35rem 0.3rem;
  min-height: 76px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
  position: relative;
}

.mf-amc-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}


.mf-amc-name {
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  text-align: center;
}

.mf-amc-brand {
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mf-amc-suffix {
  font-size: 0.56rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.8;
  line-height: 1;
}

.mf-amc-toggle-btn {
  margin: 0.75rem auto 0;
  display: block;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border-medium);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mf-amc-toggle-btn:hover {
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.mf-category-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.mf-category-card {
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1rem 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.mf-category-card:hover {
  border-color: var(--primary-color);
  transform: scale(1.05);
}

.mf-table-wrapper {
  overflow-x: auto;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.mf-funds-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.mf-funds-table thead {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.14), rgba(59, 130, 246, 0.06));
  position: sticky;
  top: 0;
  z-index: 1;
}

.mf-funds-table th {
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted-mf);
  font-size: var(--font-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-medium);
  white-space: nowrap;
}

.mf-funds-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.mf-funds-table th:nth-child(1),
.mf-funds-table td:nth-child(1) {
  width: 52%;
}

.mf-funds-table td:first-child {
  line-height: 1.25;
}

.mf-funds-table td:first-child .fund-link {
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mf-funds-table th:nth-child(2),
.mf-funds-table th:nth-child(3),
.mf-funds-table th:nth-child(4),
.mf-funds-table td:nth-child(2),
.mf-funds-table td:nth-child(3),
.mf-funds-table td:nth-child(4) {
  text-align: right;
}

.mf-funds-table tbody tr {
  transition: background 0.15s ease;
}

.mf-funds-table tbody tr:hover {
  background: var(--bg-hover);
}

.mf-funds-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
}

.mf-funds-table th.sortable:hover {
  color: var(--primary-color);
}

.mf-funds-table th.sortable.active {
  color: var(--primary-color);
}

.mf-funds-table th .sort-indicator {
  display: inline-block;
  width: 10px;
  margin-left: 0.35rem;
  color: var(--text-muted-mf);
  font-weight: 700;
}

.mf-funds-table th.sortable.active .sort-indicator {
  color: var(--primary-color);
}

.mf-table-return {
  font-family: var(--font-mono);
  font-weight: 600;
  display: inline-block;
  min-width: 62px;
  text-align: right;
}

.mf-return-positive { color: var(--success-color); }
.mf-return-negative { color: var(--error-color); }
.mf-return-na { color: var(--text-muted-mf); }

.fund-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.fund-link:hover {
  color: var(--primary-color);
}

.lock-badge {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  font-size: var(--font-xs);
  color: var(--text-secondary);
}

.mf-show-more-btn {
  display: block;
  margin: 1.25rem auto 0;
  padding: 0.65rem 1.25rem;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
  border-radius: 10px;
  font-size: var(--font-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.mf-show-more-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-2px);
}

.mf-disclaimer {
  max-width: 1150px;
  margin: 3rem auto;
  padding: 1rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 8px;
  font-size: var(--font-sm);
  color: var(--text-secondary);
  text-align: center;
}

.mf-disclaimer.mf-panel {
  margin: 1rem auto 3rem;
}

.mf-hidden {
  display: none !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .summary-card {
    grid-template-columns: 1fr;
  }
  
  .summary-right {
    border-left: none;
    border-top: 1px solid var(--border-subtle);
    padding-left: 0;
    padding-top: var(--space-xs);
  }
  
  .metric-grid {
    grid-template-columns: repeat(3, 1fr);
    min-width: auto;
  }
  
  .compact-grid {
    grid-template-columns: 1fr;
  }

  .mf-funds-table {
    font-size: 0.84rem;
  }

  .mf-funds-table th,
  .mf-funds-table td {
    padding: 0.6rem 0.5rem;
  }

  .fund-link {
    font-size: 0.84rem;
  }
  
  /* Stack chart stats above chart on tablets */
  .chart-with-stats {
    flex-direction: column;
  }
  
  .chart-stats-left {
    flex: 1;
    grid-template-columns: repeat(4, 1fr);
  }
  
}


@media (max-width: 640px) {

  body {
    padding-top: 90px;
  }

  body.compact-layout {
    padding: var(--space-md);
    padding-top: 90px !important;
  }

    .chart-wrapper-right canvas{
    min-height: 350px;
  }

  .summary-card,
  .chart-section,
  .card,
  .similar-funds-section {
    padding: var(--space-lg);
  }

  .fund-title {
    font-size: var(--font-lg);
  }

  .metric-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 50px;
  }

  .range-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 🔥 IMPORTANT: Stack chart + stats vertically */
  .chart-with-stats {
    flex-direction: column;
    gap: var(--space-lg);
  }

  /* Stats full width below chart */
  .chart-stats-left {
    flex: 1;
    width: 100%;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }

  .chart-stats-right {
    width: 100%;
    min-height: 350px;
  }

  .stat-card {
    padding: var(--space-md);
  }

  /* Chart full width + taller height */
  .chart-wrapper-right {
    width: 100%;
    height: 450px;
    min-width: unset;
  }

  .mf-hero h1 {
    font-size: 2rem;
  }

  .mf-browse-results,
  .mf-section,
  .mf-disclaimer {
    padding-left: 0.6rem;
    padding-right: 0.6rem;
  }

  .mf-amc-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.45rem;
  }

  .mf-amc-card {
    min-height: 68px;
    padding: 0.42rem 0.32rem;
    border-radius: 9px;
  }

  .mf-amc-name {
    font-size: 0.9rem;
  }

  .mf-amc-suffix {
    font-size: 0.5rem;
  }

  .mf-amc-toggle-btn {
    font-size: 0.66rem;
    padding: 0.42rem 0.72rem;
  }

  .mf-funds-table {
    width: 100%;
    table-layout: fixed;
    font-size: 0.72rem;
  }

  .mf-funds-table th:nth-child(1),
  .mf-funds-table td:nth-child(1) {
    width: 50%;
  }

  .mf-funds-table th:nth-child(2),
  .mf-funds-table td:nth-child(2),
  .mf-funds-table th:nth-child(3),
  .mf-funds-table td:nth-child(3),
  .mf-funds-table th:nth-child(4),
  .mf-funds-table td:nth-child(4) {
    width: 17%;
  }

  .mf-funds-table th,
  .mf-funds-table td {
    padding: 0.4rem 0.28rem;
  }

  .mf-funds-table th {
    white-space: normal;
    line-height: 1.15;
    font-size: 0.58rem;
    letter-spacing: 0.03em;
  }

  .mf-funds-table td:nth-child(2),
  .mf-funds-table td:nth-child(3),
  .mf-funds-table td:nth-child(4),
  .mf-funds-table th:nth-child(2),
  .mf-funds-table th:nth-child(3),
  .mf-funds-table th:nth-child(4) {
    white-space: nowrap;
  }

  .fund-link {
    font-size: 0.72rem;
  }

  .mf-table-return {
    min-width: 0;
    font-size: 0.7rem;
  }

  .mf-funds-table th .sort-indicator {
    width: 7px;
    margin-left: 0.15rem;
    font-size: 0.6rem;
  }

  .lock-badge {
    display: none;
  }
}

@media (max-width: 520px) {
  .mf-amc-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mf-amc-card {
    min-height: 64px;
  }

  .mf-amc-name {
    font-size: 0.8rem;
  }

  .mf-amc-suffix {
    font-size: 0.46rem;
  }

  .mf-funds-table {
    min-width: 0;
    font-size: 0.69rem;
  }

  .fund-calc-layout {
    grid-template-columns: 1fr;
  }

  .mf-funds-table th,
  .mf-funds-table td {
    padding: 0.36rem 0.22rem;
  }

  .fund-link,
  .mf-table-return {
    font-size: 0.65rem;
  }

  .similar-funds-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .similar-funds-list {
    grid-template-columns: 1fr;
  }

  .mf-faq-trigger {
    padding: 0.68rem 0.75rem;
  }

  .mf-faq-answer {
    padding: 0 0.75rem 0.7rem;
  }
}


/* Light theme overrides */
.theme-light .badge-category { background: rgba(59, 130, 246, 0.1); color: #2563eb; }
.theme-light .badge-subcategory { background: rgba(139, 92, 246, 0.1); color: #7c3aed; }
.theme-light .badge-plan { background: rgba(16, 185, 129, 0.1); color: #059669; }
.theme-light .badge-option { background: rgba(245, 158, 11, 0.1); color: #d97706; }
.theme-light .badge-lockin { background: rgba(239, 68, 68, 0.1); color: #dc2626; }


.mf-main-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.mf-main-tab {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.08), rgba(59, 130, 246, 0.02));
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  border-radius: 12px;
  padding: 0.55rem 0.8rem;
  font-size: var(--font-sm);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 165px;
}

.mf-main-tab strong {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.7rem;
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 999px;
  padding: 0.14rem 0.45rem;
  min-width: 30px;
  text-align: center;
}

.mf-main-tab:hover {
  border-color: var(--primary-color);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.14);
}

.mf-main-tab.active {
  border-color: var(--primary-color);
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.08));
}

.mf-subtabs-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0.85rem;
}

.mf-subtabs-panel.collapsed {
  display: none;
}

.mf-subtabs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.6rem;
}

.mf-subcategory-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  padding: 0.7rem 0.85rem;
  border-radius: 9px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-secondary);
  font-size: var(--font-sm);
  font-weight: 600;
  transition: all 0.2s ease;
}

.mf-subcategory-card:hover {
  border-color: var(--primary-color);
  color: var(--text-primary);
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  .mf-main-tabs {
    gap: 0.45rem;
  }

  .mf-main-tab {
    font-size: var(--font-xs);
    padding: 0.45rem 0.7rem;
    min-width: 140px;
  }

  .mf-subtabs-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    grid-template-columns: none;
  }

  .mf-subcategory-card {
    width: auto;
    display: inline-flex;
    justify-content: flex-start;
    gap: 0.35rem;
    border-radius: 999px;
    padding: 0.45rem 0.75rem;
    font-size: var(--font-xs);
  }

  .mf-subcategory-card span:last-child {
    color: var(--text-muted-mf);
    font-weight: 700;
  }

}

/* ============================================
   COMPARE PAGE – RESPONSIVE (all breakpoints)
   ============================================ */

/* Base fluid fixes */
.compare-slots { box-sizing: border-box; }
.compare-slot { min-width: 0; }
.compare-search-results { box-sizing: border-box; }
.compare-header,
.compare-chart-card,
.compare-table-card {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}

/* ---- Tablet ≤ 900px ---- */
@media (max-width: 900px) {
  .compare-slots {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .compare-chart-wrap {
    height: 380px;
  }
  .compare-line-results {
    flex-direction: column;
    gap: 0.4rem;
  }
  .compare-line-item {
    width: 100%;
    justify-content: space-between;
  }
  .cs-add-text { font-size: 0.72rem; }
  .cs-fund-name { font-size: 0.72rem; }
  .cs-add-btn { padding: 0.55rem 0.4rem; }
  .cs-fund-card { padding: 0.5rem 0.45rem; }
}

/* ---- Mobile ≤ 640px ---- */
@media (max-width: 640px) {
  .compare-header,
  .compare-chart-card,
  .compare-table-card {
    padding: var(--space-md);
    border-radius: 12px;
  }
  .compare-title {
    font-size: var(--font-lg);
    margin-bottom: var(--space-sm);
  }

  .compare-table-head {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Slot cards on mobile */
  .compare-slots {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-sm);
  }
  .cs-add-btn {
    padding: 0.5rem 0.3rem;
    border-radius: 8px;
    font-size: 0.68rem;
    flex-direction: column;
    gap: 0.2rem;
  }
  .cs-plus { font-size: 1.2rem; }
  .cs-add-text { font-size: 0.62rem; }
  .cs-fund-card {
    padding: 0.45rem 0.4rem;
    border-radius: 8px;
    gap: 0.35rem;
  }
  .cs-fund-name {
    font-size: 0.7rem;
    line-height: 1.3;
  }
  .cs-color-dot { width: 7px; height: 7px; }
  .cs-remove-btn { font-size: 0.65rem; }

  /* Search panel full width */
  .csp-input { font-size: var(--font-sm); }

  /* Range tabs: scroll, don't wrap */
  .compare-chart-card .range-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }
  .compare-chart-card .range-tabs::-webkit-scrollbar { display: none; }

  .compare-chart-wrap { height: 300px; }

  /* CAGR pills: vertical stack */
  .compare-line-results {
    flex-direction: column;
    gap: 0.35rem;
    margin: 0.6rem 0;
  }
  .compare-line-item {
    width: 100%;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.5rem;
    border-radius: 8px;
  }
  .compare-line-item strong {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    word-break: break-word;
    line-height: 1.25;
  }
  .compare-line-item .metrics {
    display: inline-flex;

    align-items: flex-end;
    gap: 0.15rem;
  }

  /* ============================================
     MOBILE RETURNS TABLE
     - Fund names once at top as sticky header
     - Each row: period label + fund values side by side
     - Values wrap if needed (flex-wrap)
     ============================================ */

  /* Fund name header strip — shown once at the top */
  .crm-header {
    display: flex;
    align-items: stretch;
    gap: 0;
    width: 100%;
    min-width: 0;
    padding: 0.4rem 0.2rem 0.35rem;
    margin-bottom: 0;
  }

  .crm-header-spacer {
    flex: 0 0 72px;
    min-width: 72px;
  }

  .crm-header-fund {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    padding: 0.34rem 0.36rem;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-transform: none;
    letter-spacing: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
  }

  .crm-header-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 3px;
    vertical-align: middle;
    flex-shrink: 0;
  }

  /* Each period row */
  .crm-row {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--border-subtle);
    min-width: 0;
  }
  .crm-row:last-child { border-bottom: none; }

  /* Period label on the left */
  .crm-period {
    flex: 0 0 72px;
    display: flex;
    align-items: center;
    padding: 0.55rem 0.5rem 0.55rem 0;
    font-size: var(--font-xs);
    font-weight: 600;
    color: var(--text-secondary);
    border-right: 1px solid var(--border-subtle);
    line-height: 1.2;
  }

  /* Fund value cells — flex and wrap */
  .crm-values {
    display: flex;
    flex: 1;
    flex-wrap: wrap;
    min-width: 0;
  }

  .crm-cell {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    padding: 0.55rem 0.2rem;
    border-right: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .crm-cell:last-child { border-right: none; }

  .crm-val {
    font-family: var(--font-mono);
    font-size: var(--font-sm);
    font-weight: 600;
    line-height: 1;
  }
  .crm-val.positive { color: var(--success-color); }
  .crm-val.negative { color: var(--error-color); }
  .crm-val.text-val {
    font-family: var(--font-primary);
    font-size: var(--font-xs);
    color: var(--text-secondary);
    font-weight: 500;
  }
  .crm-val.neutral { color: var(--text-muted-mf); }
}

/* ---- Very small ≤ 400px ---- */
@media (max-width: 400px) {
  .compare-chart-wrap { height: 240px; }
  .range-tab { padding: 0.3rem 0.45rem; font-size: 0.68rem; }
  .crm-period { flex: 0 0 58px; font-size: 0.62rem; }
  .crm-val { font-size: var(--font-xs); }
  .cs-fund-name { font-size: 0.65rem; }
}

/* ============================================
   CHART + CALCULATOR MERGED PANEL (CCP)
   ============================================ */

.chart-calc-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* ── Top bar: type toggle + range tabs + compare ── */
.ccp-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-md);
  padding: 0.85rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

/* Type toggle (Lump Sum / SIP) */
.ccp-type-toggle {
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
  flex-shrink: 0;
  justify-self: start;
}

.ccp-type-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: var(--font-sm);
  font-weight: 600;
  font-family: var(--font-primary);
  padding: 0.35rem 0.85rem;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.ccp-type-btn.active {
  background: var(--primary-color);
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12), 0 0 0 1px var(--border-medium);
}

.theme-dark .ccp-type-btn.active {
  background: var(--primary-color);
  color: #0a0e14;
  box-shadow: 0 1px 6px rgba(0,0,0,0.4), 0 0 0 1px var(--border-medium);
}

.ccp-type-btn {
  border: 1px solid transparent;
}
/* Range tabs */
.ccp-type-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}
.ccp-range-tabs {
  display: flex;
  gap: 0.35rem;
  flex: 0 1 auto;
  justify-content: center;
  width: auto;
  min-width: 0;
}

.ccp-range-tabs .range-tab {
  flex: 0 0 auto;
  text-align: center;
  padding: 0.32rem 0.62rem;
  min-width: 2.6rem;
  font-size: var(--font-xs);
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--border-medium);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: none;
  font-family: var(--font-primary);
}

.ccp-range-tabs .range-tab:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
  border-color: var(--primary-color);
}

.ccp-range-tabs .range-tab.active {
  background: var(--primary-color);
  color: #ffffff;
  border-color: transparent;
}

.theme-dark .ccp-range-tabs .range-tab.active {
  background: var(--primary-color);
  color: #0a0e14;
}

/* Compare button */
.ccp-compare-btn {
  flex-shrink: 0;
  justify-self: end;
  margin-top: 0;
  border: 1px solid var(--border-medium);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  padding: 0.35rem 0.8rem;
  border-radius: 8px;
  font-size: var(--font-xs);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-primary);
  white-space: nowrap;
}

.ccp-compare-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* ── Topbar amount controls ── */
.ccp-topbar-amount {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-self: center;
  min-width: 0;
}

.ccp-amount-label {
  font-size: var(--font-xs);
  color: var(--text-muted-mf);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.ccp-amount-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  padding: 0.35rem 0.75rem;
  min-width: 0;
  transition: border-color 0.2s;
}

.ccp-amount-input-wrap:focus-within {
  border-color: var(--primary-color);
}

.ccp-currency {
  color: var(--text-muted-mf);
  font-size: var(--font-sm);
  font-weight: 600;
  flex-shrink: 0;
}

.ccp-amount-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: var(--font-base);
  font-weight: 600;
  width: 130px;
  min-width: 0;
}

/* ── Period row ── */
.ccp-period-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 0.65rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
}

.ccp-period-label {
  font-size: var(--font-xs);
  color: var(--text-muted-mf);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.ccp-period-row .ccp-range-tabs {
  margin-inline: auto;
  max-width: 100%;
}

.ccp-range-start-date {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.2rem 0.5rem;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Results strip ── */
.ccp-results-strip {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
}

.ccp-result-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.75rem 1rem;
}

.ccp-result-divider {
  width: 1px;
  background: var(--border-subtle);
  flex-shrink: 0;
}

.ccp-result-label {
  font-size: var(--font-xs);
  color: var(--text-muted-mf);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
  white-space: nowrap;
}

.ccp-result-value {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.ccp-result-value.highlight {
  color: #1d4ed8;
}

.theme-dark .ccp-result-value.highlight {
  color: var(--primary-color);
}

.ccp-result-value.positive { color: #16a34a; }
.ccp-result-value.negative { color: var(--error-color); }
.theme-dark .ccp-result-value.positive { color: var(--success-color); }

/* ── Chart area ── */
.ccp-chart-area {
  height: 360px;
  padding: 0.5rem 0.5rem 0;
}

.ccp-chart-body {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 0.65rem;
}

/* ccp-canvas-wrap: Chart.js measures this div (not the grid parent) for its
   canvas pixel-buffer size. Without this wrapper, Chart.js sees the full grid
   container width (canvas col + stats col), sets canvas.width too wide, and
   mouse X → data-index mapping lands on the wrong (earlier) date. */
.ccp-canvas-wrap {
  position: relative;
  min-width: 0;
  height: 100%;
}

.ccp-canvas-wrap canvas {
  display: block;
}

/* ── Chart stats panel (right side) ── */
.ccp-chart-overlay {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  justify-content: center;
}

.ccp-overlay-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  backdrop-filter: blur(8px);
  min-width: 0;
}

.theme-dark .ccp-overlay-item {
  background: rgba(13, 15, 22, 0.82);
}

.ccp-ov-label {
  font-size: 0.6rem;
  color: var(--text-muted-mf);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  white-space: nowrap;
}

.ccp-ov-value {
  font-family: var(--font-mono);
  font-size: var(--font-base);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

/* Stat value classes still used by JS for overlay */
.ccp-ov-value.positive,
.ccp-ov-value.stat-value.positive { color: #16a34a; }
.ccp-ov-value.negative,
.ccp-ov-value.stat-value.negative { color: var(--error-color); }
.theme-dark .ccp-ov-value.positive,
.theme-dark .ccp-ov-value.stat-value.positive { color: var(--success-color); }

/* JS sets stat-value class on these elements — remap */
#chartPeriodReturn.stat-value,
#chartCAGR.stat-value,
#chartMaxGain.stat-value,
#chartDrawdown.stat-value,
#chartDrawdown.stat-value {
  font-family: var(--font-mono);
  font-size: var(--font-base);
  font-weight: 700;
  line-height: 1.2;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .ccp-topbar {
    gap: var(--space-sm);
    padding: 0.7rem 1rem 0.65rem;
  }
  .ccp-period-row {
    padding: 0.6rem 1rem;
  }
  .ccp-range-tabs .range-tab {
    padding: 0.3rem 0.3rem;
  }
  .ccp-chart-area {
    height: 300px;
  }
  .ccp-chart-body {
    grid-template-columns: minmax(0, 1fr) 160px;
  }
  .ccp-overlay-item {
    padding: 0.35rem 0.5rem;
  }

  .ccp-results-strip {
    display: flex;
    flex-wrap: wrap;
  }
  .ccp-result-divider {
    display: none;
  }
  .ccp-result-item {
    flex: 0 0 50%;
    max-width: 50%;
    border-right: none;
    border-bottom: none;
  }
  .ccp-result-item:nth-of-type(1),
  .ccp-result-item:nth-of-type(3) {
    border-right: 1px solid var(--border-subtle);
  }
  .ccp-result-item:nth-of-type(1),
  .ccp-result-item:nth-of-type(2) {
    border-bottom: 1px solid var(--border-subtle);
  }
}

@media (max-width: 640px) {
  .ccp-topbar {
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem 0.6rem;
  }
  .ccp-type-toggle {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
  }
  .ccp-compare-btn {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }
  .ccp-topbar-amount {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: center;
  }
  .ccp-period-row {
    flex-wrap: wrap;
    padding: 0.55rem 0.85rem;
    align-items: flex-start;
  }
  .ccp-period-row .ccp-range-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
    justify-content: flex-start;
    margin-inline: 0;
    width: 100%;
  }

  .ccp-range-start-date {
    width: 100%;
    font-size: 0.62rem;
    padding: 0.15rem 0;
    border: none;
    border-radius: 0;
    background: transparent;
  }
  .ccp-period-row .ccp-range-tabs::-webkit-scrollbar { display: none; }

  .ccp-results-strip {
    display: flex !important;
    flex-wrap: wrap;
    gap: 0;
  }
  .ccp-result-divider {
    display: none;
  }
  .ccp-result-item {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0.52rem 0.45rem;
    gap: 0.16rem;
    min-width: 0;
    border-right: none;
    border-bottom: none;
  }
  .ccp-result-item:nth-of-type(1),
  .ccp-result-item:nth-of-type(3) {
    border-right: 1px solid var(--border-subtle);
  }
  .ccp-result-item:nth-of-type(1),
  .ccp-result-item:nth-of-type(2) {
    border-bottom: 1px solid var(--border-subtle);
  }
  .ccp-result-label {
    font-size: 0.56rem;
    letter-spacing: 0.04em;
  }
  .ccp-result-value {
    font-size: 0.9rem;
  }

  .ccp-chart-area {
    height: auto;
    padding: 0.4rem 0.25rem 0.35rem;
    overflow: hidden;
  }
  .ccp-chart-body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(245px, 275px) auto;
    gap: 0.45rem;
  }
  .ccp-canvas-wrap {
    min-height: 245px;
  }
  .ccp-chart-overlay {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.32rem;
    overflow: visible;
  }
  .ccp-overlay-item {
    padding: 0.34rem 0.3rem;
    align-items: center;
    text-align: center;
  }
  .ccp-ov-label {
    font-size: 0.52rem;
    letter-spacing: 0.03em;
  }
  .ccp-ov-value,
  #chartPeriodReturn.stat-value,
  #chartCAGR.stat-value,
  #chartMaxGain.stat-value,
  #chartDrawdown.stat-value,
  #chartDrawdown.stat-value { font-size: 0.74rem; }
}

/* ============================================================
   RISK EXPLAINER — Homepage section (mf-risk-explainer.js)
   ============================================================ */

[data-mf-risk-explainer] {
  display: none; /* shown by JS */
}

.re-header {
  margin-bottom: 1.25rem;
}

.re-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.re-subtitle {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  margin: 0;
  max-width: 680px;
  line-height: 1.55;
}

.re-section-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary-color);
  margin: 1.5rem 0 0.4rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-subtle);
}

.re-section-label--nav {
  margin-top: 1.75rem;
}

/* ── Category cards grid ── */
.re-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
}

.re-cat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  transition: border-color 0.18s;
}

.re-cat-card:hover {
  border-color: var(--primary-color);
}

.re-cat-top {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.re-cat-icon {
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.re-cat-label {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--text-primary);
  line-height: 1.2;
}

.re-cat-tagline {
  font-size: 0.74rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

/* ── Risk bar (shared between both components) ── */
/* NOTE: Intentionally distinct from SEBI Riskometer — pill shape, spaced segments */
.risk-bar {
  display: flex;
  gap: 5px;           /* wider gap than SEBI's style */
  align-items: center;
}

.risk-seg {
  display: inline-block;
  width: 18px;        /* 6 segments fit comfortably in card width */
  height: 8px;
  border-radius: 99px; /* full pill — SEBI uses trapezoid shapes, we don't */
  border: 1px solid transparent;
  transition: opacity 0.15s;
  filter: saturate(0.82); /* slightly desaturated vs official riskometer */
}

.risk-seg.active {
  opacity: 1;
}

.risk-seg:not(.active) {
  opacity: 0.25;
}

/* ── Estimate label (above risk bar) ── */
.re-cat-estimate-label {
  display: block;
  font-size: 0.63rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
  opacity: 0.5;
  margin-bottom: 0.25rem;
  user-select: none;
}

/* ── Risk block grouping (homepage card) ── */
.re-cat-risk-block {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

/* ── Section sublabel ── */
.re-section-sublabel {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin: -0.5rem 0 0.9rem;
  line-height: 1.5;
  opacity: 0.75;
}

/* ── Card expand/collapse button ── */
.re-cat-expand-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: none;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  align-self: flex-start;
  transition: border-color 0.15s, color 0.15s;
  margin-top: 0.1rem;
}

.re-cat-expand-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.re-cat-expand-lbl {
  /* inline label that toggles text via JS */
}

.re-cat-expand-icon {
  font-size: 0.85rem;
  line-height: 1;
  color: var(--primary-color);
}

/* ── Expandable detail section ── */
.re-cat-detail {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: 0.1rem;
  animation: reDetailIn 0.15s ease;
}

@keyframes reDetailIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Concept section headings — kept for homepage explainer if needed ── */

@media (max-width: 600px) {
  .re-cat-grid {
    grid-template-columns: 1fr;
  }
}

.re-cat-risk-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

.re-cat-risk-label strong {
  color: var(--text-primary);
}

.re-cat-row {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.re-cat-meta-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  opacity: 0.65;
}

.re-cat-meta-val {
  font-size: 0.78rem;
  color: var(--text-primary);
  line-height: 1.4;
}

.re-horizon {
  font-weight: 600;
  color: var(--primary-color) !important;
}

.re-cat-examples {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.45;
  padding-top: 0.3rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: 0.15rem;
}

/* ── Disclaimer ── */
.re-disclaimer {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  background: rgba(250, 204, 21, 0.07);
  border: 1px solid rgba(250, 204, 21, 0.25);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  margin-top: 1rem;
}

.re-disc-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 0.05rem;
}

.re-disclaimer p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--text-primary);
}

/* ── Accordion ── */
.re-accordion {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
}

.re-acc-item + .re-acc-item {
  border-top: 1px solid var(--border-subtle);
}

.re-acc-trigger {
  width: 100%;
  background: none;
  border: none;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  text-align: left;
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-primary);
  transition: background 0.15s;
}

.re-acc-trigger:hover {
  background: var(--bg-hover);
}

.re-acc-icon {
  font-size: 1.1rem;
  color: var(--primary-color);
  flex-shrink: 0;
  line-height: 1;
}

.re-acc-panel {
  padding: 0 1rem 0.85rem 1rem;
}

.re-acc-panel p {
  margin: 0;
  font-size: 0.825rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

/* ============================================================
   FUND BEHAVIOUR & NAV INSIGHTS — fund.html (mf-fund-risk.js)
   All risk-classification elements removed.
   Section is purely data-driven.
   ============================================================ */

.fr-risk-section {
  /* mount wrapper — no change needed */
}

/* ── Section header ── */
.fr-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.3rem;
}

.fr-header-sub {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  margin: 0 0 0.9rem;
  line-height: 1.45;
  opacity: 0.78;
}

/* ── Volatility highlight strip ── */
.fb-vol-strip {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--primary-color);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  margin-bottom: 1rem;
}

.fb-vol-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono, monospace);
  line-height: 1;
}

.fb-vol-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.fb-vol-period {
  font-size: 0.72rem;
  opacity: 0.65;
}

/* ── Category explainer ── */
.fr-cat-explainer {
  background:
    linear-gradient(135deg, rgba(59, 130, 246, 0.06), rgba(59, 130, 246, 0.015) 55%),
    var(--bg-secondary);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.fr-cat-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary-color);
  background: rgba(0, 255, 133, 0.08);
  border: 1px solid rgba(0, 255, 133, 0.18);
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
  align-self: flex-start;
}

.theme-light .fr-cat-badge {
  color: #e65c00;
  background: rgba(230, 92, 0, 0.08);
  border-color: rgba(230, 92, 0, 0.18);
}

.fr-cat-blurb {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-primary);
}

/* ── Sub-headings ── */
.fr-subhead {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary-color);
  margin: 1rem 0 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border-subtle);
}

/* ── NAV stat grid ── */
.fr-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.25rem;
}

.fr-stat-item {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.02), transparent), var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  padding: 0.62rem 0.75rem;
}

.fr-stat-label {
  font-size: 0.67rem;
  color: var(--text-secondary);
  opacity: 0.65;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}

.fr-stat-val {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono, monospace);
}

.fr-stat-neg { color: #ef4444; }

.fr-stat-sub {
  font-size: 0.62rem;
  color: var(--text-secondary);
  opacity: 0.6;
  margin-top: 0.12rem;
  line-height: 1.3;
}

.fr-no-data {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  opacity: 0.6;
  margin: 0;
}

/* ── NAV factors list ── */
.fr-factors-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.fr-factors-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.79rem;
  color: var(--text-primary);
  line-height: 1.42;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.56rem 0.62rem;
}

.fr-factor-icon {
  flex-shrink: 0;
  font-size: 0.95rem;
  margin-top: 0.05rem;
}

/* ── Disclaimer ── */
.fr-disclaimer {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 8px;
  padding: 0.65rem 0.82rem;
  margin-top: 1rem;
}

.fr-disc-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 0.05rem;
}

.fr-disclaimer p {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

/* ── Mobile ── */
@media (max-width: 600px) {
  .fr-stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .fr-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .fb-vol-strip {
    flex-direction: column;
    gap: 0.25rem;
  }

  .fr-factors-list {
    grid-template-columns: 1fr;
  }
}

/* ── mfdata.in enrichment (fund detail) ── */
.mf-enrichment-card {
  margin-bottom: var(--space-lg);
}

/* ── Fund section navigation (clean UX) ── */
.fund-section-nav {
  margin-top: var(--space-lg);
  background: linear-gradient(180deg, rgba(59,130,246,0.10), rgba(0,0,0,0));
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0;
  position: sticky;
  top: 90px;
  z-index: 20;
  overflow: hidden;
}

.fund-section-nav-inner {
  display: flex;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.fund-section-tab {
  border: 1px solid var(--border-medium);
  background: var(--bg-card);
  color: var(--text-secondary);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: var(--font-xs);
  font-weight: 700;
  transition: all 0.15s ease;
  font-family: var(--font-primary);
}

.fund-section-tab:hover {
  border-color: var(--primary-color);
  color: var(--text-primary);
}

.fund-section-tab.active {
  background: var(--primary-color);
  border-color: transparent;
  color: #ffffff;
}

@media (max-width: 640px) {
  .fund-section-nav {
    top: 82px;
  }

  .fund-section-nav-inner {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
}

.mf-enrichment-source {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0 0 0.75rem;
  line-height: 1.45;
}

.mf-enrichment-source a {
  color: var(--primary-hover);
  text-decoration: none;
}

.mf-enrichment-source a:hover {
  text-decoration: underline;
}

.mf-enrichment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.6rem;
}

.mf-enrichment-item {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding: 0.65rem 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}

.mf-enrichment-label {
  font-size: var(--font-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  opacity: 0.85;
}

.mf-enrichment-value {
  font-size: var(--font-base);
  font-weight: 700;
  color: var(--text-primary);
  word-break: break-word;
}

.mf-enrichment-subtitle {
  font-size: var(--font-lg);
  margin: var(--space-lg) 0 var(--space-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.mf-enrichment-month {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  margin: 0 0 var(--space-md);
}

.mf-holdings-wrap {
  margin-top: var(--space-md);
}

.mf-holdings-table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.mf-holdings-table th,
.mf-holdings-table td {
  font-size: var(--font-sm);
}

@media (max-width: 600px) {
  .mf-enrichment-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   FUND DETAIL PAGE — clarity, padding, visual hierarchy
   (scoped to #fundDetails so browse/compare stay unchanged)
   ============================================================ */

body.compact-layout {
  padding-left: clamp(1rem, 4vw, 2.25rem);
  padding-right: clamp(1rem, 4vw, 2.25rem);
  padding-bottom: 3rem;
}

body.compact-layout nav.breadcrumb {
  margin-bottom: 1rem;
  padding: 0.4rem 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

body.compact-layout nav.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
}

body.compact-layout nav.breadcrumb a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

body.compact-layout .mf-search-container {
  margin-bottom: 1.35rem;
}

#fundDetails.compact-container {
  gap: clamp(1.35rem, 2.2vw, 2rem);
}

#fundDetails .summary-card.mf-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: start;
  gap: 1.25rem 2rem;
  padding: clamp(1.35rem, 3vw, 2rem);
  border-radius: 16px;
  margin-bottom: 0;
  box-shadow: 0 14px 44px rgba(15, 23, 42, 0.08);
}

.theme-dark #fundDetails .summary-card.mf-panel {
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.45);
}

#fundDetails .fund-title {
  margin-bottom: 0.35rem;
  letter-spacing: -0.02em;
}

#fundDetails .fund-meta {
  margin-top: 0.85rem;
}

#fundDetails .badge {
  font-size: 0.65rem;
  padding: 0.32rem 0.65rem;
  border-radius: 6px;
}

#fundDetails .metric-grid {
  gap: 1rem 1.5rem;
  max-width: 100%;
}

#fundDetails .metric {
  padding: 0.35rem 0.25rem;
}

#fundDetails .metric-label {
  margin-bottom: 0.35rem;
}

#fundDetails .metric-value {
  font-size: clamp(1rem, 2.4vw, 1.2rem);
}

#fundDetails .fund-section-nav.mf-panel {
  padding: 0.65rem 1rem;
  border-radius: 14px;
  margin-top: 0;
}

#fundDetails .fund-section-nav-inner {
  padding: 0.4rem 0.15rem;
  gap: 0.55rem;
}

#fundDetails .fund-section-tab {
  padding: 0.45rem 0.95rem;
  font-size: 0.72rem;
}

#fundDetails .chart-calc-panel.mf-panel {
  border-radius: 16px;
  box-shadow: 0 14px 44px rgba(15, 23, 42, 0.06);
}

.theme-dark #fundDetails .chart-calc-panel.mf-panel {
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.4);
}

#fundDetails .ccp-topbar {
  padding: 1rem 1.35rem 0.85rem;
}

#fundDetails .ccp-period-row {
  padding-left: 1.35rem;
  padding-right: 1.35rem;
}

#fundDetails .ccp-results-strip {
  margin-left: 1.35rem;
  margin-right: 1.35rem;
}

#fundDetails .ccp-chart-area {
  padding: 0 1.35rem 1.35rem;
}

#fundDetails .returns-card.mf-panel,
#fundDetails .sip-day-card.mf-panel {
  border-radius: 16px;
  padding: clamp(1.25rem, 3vw, 1.75rem);
}

#fundDetails .returns-card .card-title {
  margin-bottom: 1rem;
  font-size: 1.05rem;
}

#fundDetails .returns-table thead th {
  padding: 0.65rem 1rem;
}

#fundDetails .returns-table tbody td {
  padding: 0.85rem 1rem;
}

#fundDetails .mf-enrichment-card.mf-panel {
  padding: clamp(1.25rem, 3vw, 1.85rem);
  border-radius: 16px;
}

#fundDetails .mf-enrichment-card .card-title {
  margin-bottom: 0.5rem;
}

#fundDetails .similar-funds-section.mf-panel {
  border-radius: 16px;
  padding: clamp(1.25rem, 3vw, 1.75rem);
}

#fundDetails .disclaimer.mf-panel {
  border-radius: 12px;
  padding: 1.1rem 1.35rem;
  margin-top: 0.5rem;
}

#fundDetails #fundRiskSection.mf-panel {
  padding: clamp(1.15rem, 2.8vw, 1.65rem);
  border-radius: 16px;
}

@media (max-width: 1024px) {
  #fundDetails .summary-card.mf-panel {
    grid-template-columns: 1fr;
  }

  #fundDetails .summary-right {
    border-left: none;
    border-top: 1px solid var(--border-subtle);
    padding: 1.15rem 0 0;
    margin-top: 0.35rem;
    width: 100%;
  }
}

@media (max-width: 640px) {
  #fundDetails .metric-grid {
    gap: 0.65rem 0.85rem;
  }

  #fundDetails .ccp-topbar {
    padding: 0.85rem 1rem;
  }

  #fundDetails .ccp-period-row,
  #fundDetails .ccp-chart-area {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  #fundDetails .ccp-results-strip {
    margin-left: 1rem;
    margin-right: 1rem;
  }
}

/* ── Small fade-in for dynamically shown sections ── */
.fade-in {
  animation: mfFadeIn 0.25s ease both;
}

@keyframes mfFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}