/**
 * Premium single-asset calculator layout (stocks, crypto, forex, indexes).
 * Full width, 2-column grid, KPI + stats. Use on pages with body.calc-page.
 */

/* -------------------------------------------------------------------------
   A) GLOBAL LAYOUT (FULL WIDTH)
   ------------------------------------------------------------------------- */
.calc-page .page-content .container {
  max-width: 1280px;
}

@media (min-width: 768px) {
  .calc-page .page-content .container {
    padding-left: 24px;
    padding-right: 24px;
  }
}

@media (min-width: 1024px) {
  .calc-page .page-content .container {
    padding-left: 24px;
    padding-right: 24px;
  }
}

/* Reduce top padding above calculator block */
.calc-page .page-content .container > .breadcrumb,
.calc-page .page-content .container > .calculator-hero,
.calc-page .page-content .container > h1,
.calc-page .page-content .container > .container > p:first-of-type {
  margin-top: 0;
}

.calc-page .calc-shell {
  margin-top: var(--space-lg, 1.5rem);
  margin-bottom: var(--space-xl, 2rem);
}

/* Prose below calculator: readable width; calculator block full width */
.calc-page .prose {
  max-width: 72ch;
  margin-left: auto;
  margin-right: auto;
}

.calc-page .calc-shell {
  max-width: none;
}

/* -------------------------------------------------------------------------
   B) CALCULATOR SHELL & GRID
   ------------------------------------------------------------------------- */
.calc-shell {
  width: 100%;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius-lg, 12px);
  box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04));
  background: var(--color-bg, #fff);
  overflow: hidden;
}

.calc-grid {
  display: grid;
  gap: 24px;
}

@media (min-width: 1024px) {
  .calc-grid {
    grid-template-columns: 420px 1fr;
  }
}

.calc-panel {
  padding: 20px 24px;
  border: 0;
  background: var(--color-bg, #fff);
}

@media (min-width: 1024px) {
  .calc-panel--inputs {
    border-right: 1px solid var(--color-border, #e5e7eb);
    position: sticky;
    top: 24px;
    align-self: start;
  }
  .calc-panel--results {
    min-width: 0;
  }
}

.calc-panel--results {
  background: var(--color-bg-subtle, #f9fafb);
}

.calc-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 var(--space-md, 1rem);
  flex-wrap: wrap;
}
.calc-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
}
.calc-title__asset {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-bg-subtle, #f1f5f9);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 999px;
  padding: 3px 10px 3px 4px;
  font-size: 0.8125rem;
  line-height: 1;
  white-space: nowrap;
}
.calc-title__logo {
  display: inline-flex;
  align-items: center;
}
.calc-title__logo .instrument-logo-wrap {
  width: 22px;
  height: 22px;
}
.calc-title__logo .instrument-logo {
  width: 22px;
  height: 22px;
  border-radius: 50%;
}
.calc-title__logo .instrument-logo-placeholder {
  width: 22px;
  height: 22px;
  font-size: 0.5625rem;
  border-radius: 50%;
}
.calc-title__logo .instrument-logo-forex {
  transform: scale(0.55);
  transform-origin: left center;
  margin-right: -12px;
}
.calc-title__name {
  font-weight: 600;
  color: var(--color-text, #0f172a);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.calc-title__ticker {
  font-weight: 500;
  color: var(--color-text-muted, #64748b);
}

/* Lump sum vs SIP mode toggle */
.calc-mode-toggle {
  display: flex;
  gap: 12px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.calc-mode-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text-muted, #64748b);
}
.calc-mode-option input { accent-color: var(--color-primary, #2563eb); }
.calc-mode-option input:checked + span { color: var(--color-text, #0f172a); font-weight: 600; }
.calc-lump-fields,
.calc-sip-fields { margin-bottom: 0; }

.stat.stat--hidden {
  visibility: hidden;
}

/* Performance summary strip (Period, CAGR, Max DD, Buy→Sell) */
.perf-summary {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 12px;
  background: #f8fafc;
}

@media (min-width: 640px) {
  .perf-summary {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .perf-summary {
    grid-template-columns: repeat(4, 1fr);
  }
}

.perf-summary__label {
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 2px;
}

.perf-summary__value {
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
}

.perf-summary__value.pos {
  color: #0f766e;
}

.perf-summary__value.neg {
  color: #b91c1c;
}

.perf-summary__value.neutral {
  color: #64748b;
}

/* Share toast */
.share-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 16px;
  background: #0f172a;
  color: #fff;
  font-size: 0.875rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.share-toast.is-visible {
  opacity: 1;
}

/* -------------------------------------------------------------------------
   FIELDS & ACTIONS
   ------------------------------------------------------------------------- */
.calc-shell .field,
.calc-shell .form-group {
  margin-bottom: var(--space-md, 1rem);
}

.calc-shell .field:last-child,
.calc-shell .form-group:last-of-type {
  margin-bottom: 0;
}

.calc-shell label {
  display: block;
  font-weight: 500;
  margin-bottom: var(--space-xs, 0.25rem);
  font-size: 0.9375rem;
}

.calc-shell input[type="number"],
.calc-shell input[type="text"],
.calc-shell input[type="date"] {
  width: 100%;
  padding: var(--space-sm, 0.5rem) var(--space-md, 1rem);
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius, 8px);
  background: var(--color-bg, #fff);
}

.calc-shell input:focus {
  outline: none;
  border-color: var(--color-link, #2563eb);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm, 0.5rem);
}

.field-with-action {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.field-with-action input {
  flex: 1 1 auto;
  min-width: 10rem; /* keep date input readable and date picker usable */
  width: 0; /* allow flex to shrink when space is tight */
}

.field-with-action input[type="date"] {
  min-width: 10rem;
}

.field-with-action .btn {
  flex-shrink: 0;
}

/* Inline date navigation: [Month] [Day] [Year] */
.date-inline-nav {
  display: flex;
  gap: 4px;
  align-items: center;
}
.date-inline-nav select,
.date-inline-nav .date-nav-day {
  font-family: inherit;
  font-size: 0.8125rem;
  color: #1e293b;
  background: #fff;
  border: 1px solid var(--color-border, #d1d5db);
  border-radius: 8px;
  padding: 7px 8px;
  outline: none;
  transition: border-color .15s;
}
.date-inline-nav select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 5 5-5z' fill='%2394a3b8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 8px 5px;
  padding-right: 22px;
}
.date-inline-nav .date-nav-month {
  flex: 0 1 auto;
  min-width: 0;
}
.date-inline-nav .date-nav-day {
  width: 58px;
  flex: 0 0 58px;
  text-align: center;
  padding-left: 4px;
  padding-right: 4px;
  -moz-appearance: textfield;
}
.date-inline-nav .date-nav-day::-webkit-inner-spin-button,
.date-inline-nav .date-nav-day::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.date-inline-nav .date-nav-year {
  flex: 0 0 auto;
  min-width: 62px;
}
.date-inline-nav select:hover,
.date-inline-nav .date-nav-day:hover {
  border-color: #94a3b8;
}
.date-inline-nav select:focus,
.date-inline-nav .date-nav-day:focus {
  border-color: var(--color-primary, #2563eb);
  box-shadow: 0 0 0 2px rgba(37,99,235,.12);
}

.btn--small {
  padding: 6px 10px;
  font-size: 0.8125rem;
  white-space: nowrap;
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  flex-wrap: wrap;
}

.actions--row {
  flex-wrap: wrap;
}

.actions__spacer {
  flex: 1;
  min-width: 12px;
}

@media (min-width: 640px) {
  .actions__spacer {
    display: block;
  }
}

.calc-note {
  font-size: 0.8125rem;
  color: var(--color-text-muted, #555);
  margin: var(--space-sm, 0.5rem) 0 0;
}

.calc-shell .btn-primary,
.calc-shell .btn--primary {
  margin: 0;
}

.calc-shell .btn-ghost,
.calc-shell .btn--ghost {
  background: transparent;
  border: 1px solid var(--color-border, #e5e7eb);
  color: var(--color-text-muted, #555);
  padding: var(--space-sm, 0.5rem) var(--space-md, 1rem);
  border-radius: var(--radius, 8px);
  font-size: 0.9375rem;
  cursor: pointer;
}

.calc-shell .btn-ghost:hover,
.calc-shell .btn--ghost:hover {
  background: var(--color-bg-subtle, #f9fafb);
  color: var(--color-text, #1a1a1a);
}

/* Custom prices details */
.calc-shell .custom-prices,
.calc-shell .date-calculator-manual {
  margin-top: var(--space-md, 1rem);
}

.calc-shell .custom-prices summary,
.calc-shell .date-calculator-manual summary {
  cursor: pointer;
  font-weight: 500;
  padding: var(--space-sm, 0.5rem) 0;
}

.calc-shell .custom-prices .field-row .field,
.calc-shell .date-calculator-manual .form-group {
  margin-top: var(--space-md, 1rem);
}

/* -------------------------------------------------------------------------
   KPI & RESULTS
   ------------------------------------------------------------------------- */
.kpi {
  padding: 18px;
  border-radius: 14px;
  border: 1px solid #e6e9ef;
  background: #f8fafc;
}

.kpi-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-muted, #555);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}

.kpi-value {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 4px;
}

.kpi-value.pos {
  color: #0f766e;
}

.kpi-value.neg {
  color: #b91c1c;
}

.kpi-value.neutral {
  color: #64748b;
}

.kpi-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  margin-top: 6px;
}

.kpi-sub-label {
  font-size: 0.8125rem;
  color: var(--color-text-muted, #555);
}

.kpi-sub-value {
  font-size: 1.25rem;
  font-weight: 700;
}

.kpi-sub-value.pos {
  color: #0f766e;
}

.kpi-sub-value.neg {
  color: #b91c1c;
}

.kpi-sub-value.neutral {
  color: #64748b;
}

/* Stats row */
.stats {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

@media (min-width: 640px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .stats {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat {
  padding: 14px;
  border: 1px solid #e6e9ef;
  border-radius: 12px;
  background: #fff;
  min-height: 68px;
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted, #555);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-value.pos {
  color: #0f766e;
  font-weight: 700;
}

.stat-value.neg {
  color: #b91c1c;
  font-weight: 700;
}

.stat-value.neutral {
  color: #64748b;
}

/* Source & error lines (hidden when empty) */
.source-line,
.error-line {
  font-size: 0.8125rem;
  margin-top: 12px;
}

.source-line {
  color: var(--color-text-muted, #555);
}

.source-line:empty,
.error-line:empty {
  display: none;
}

.error-line,
.fetch-message--error {
  color: #b91c1c;
}

.calc-shell .fetch-message {
  font-size: 0.875rem;
  margin-top: var(--space-sm, 0.5rem);
  min-height: 1.25em;
}

/* Legacy result-row compatibility (if still in DOM) */
.calc-shell .calculator-results {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.calc-shell .result-row {
  display: none;
}

/* Tablet: stack cleanly */
@media (max-width: 1023px) {
  .calc-shell {
    margin-left: 0;
    margin-right: 0;
  }

  .calc-panel {
    padding: 16px 20px;
  }

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

/* -------------------------------------------------------------------------
   MOBILE (<640px): compact, touch-friendly layout
   ------------------------------------------------------------------------- */
@media (max-width: 639px) {
  /* Hero + breadcrumb */
  .calc-page .breadcrumb {
    font-size: 0.75rem;
    margin-bottom: 6px;
  }
  .calc-page .calculator-hero {
    gap: 10px;
    margin-bottom: 6px;
  }
  .calc-page .calculator-hero .instrument-logo-wrap {
    width: 36px;
    height: 36px;
  }
  .calc-page .calculator-hero h1 {
    font-size: 1.125rem;
    line-height: 1.3;
  }
  .calc-page .page-content .container > p {
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 0.75rem;
  }

  /* Calculator shell */
  .calc-page .calc-shell {
    margin-top: 0.75rem;
    border-radius: 10px;
  }
  .calc-panel {
    padding: 14px 16px;
  }

  /* Title row with asset badge */
  .calc-title-row {
    gap: 8px;
    margin-bottom: 0.75rem;
  }
  .calc-title {
    font-size: 1rem;
  }
  .calc-title__asset {
    padding: 2px 8px 2px 3px;
    font-size: 0.75rem;
  }

  /* Mode toggle */
  .calc-mode-toggle {
    gap: 10px;
    margin-bottom: 0.75rem;
  }
  .calc-mode-option {
    font-size: 0.875rem;
  }

  .field-with-action input,
  .field-with-action input[type="date"] {
    min-width: 0;
  }
  .calc-shell label {
    font-size: 0.8125rem;
  }
  .calc-shell input[type="number"],
  .calc-shell input[type="text"],
  .calc-shell input[type="date"] {
    padding: 8px 10px;
    font-size: 0.9375rem;
  }
  .calc-shell .field,
  .calc-shell .form-group {
    margin-bottom: 0.75rem;
  }

  /* Actions row */
  .actions {
    margin-top: 10px;
    gap: 8px;
  }
  .calc-shell .btn--primary,
  .calc-shell .btn--secondary,
  .calc-shell .btn--ghost {
    padding: 8px 14px;
    font-size: 0.875rem;
  }

  /* Custom prices details */
  .calc-shell .custom-prices summary,
  .calc-shell .date-calculator-manual summary {
    font-size: 0.875rem;
    padding: 6px 0;
  }

  /* Results panel */
  .perf-summary {
    padding: 12px;
    gap: 10px;
    margin-bottom: 12px;
  }
  .perf-summary__label {
    font-size: 0.6875rem;
  }
  .perf-summary__value {
    font-size: 0.875rem;
  }

  /* KPI */
  .kpi {
    padding: 14px;
    border-radius: 12px;
  }
  .kpi-value {
    font-size: 2rem;
  }
  .kpi-sub-value {
    font-size: 1.1rem;
  }
  .kpi-label {
    font-size: 0.75rem;
  }

  /* Stats */
  .stats {
    gap: 8px;
    margin-top: 12px;
  }
  .stat {
    padding: 10px 12px;
    border-radius: 10px;
  }
  .stat-label {
    font-size: 0.6875rem;
    margin-bottom: 2px;
  }
  .stat-value {
    font-size: 0.875rem;
  }

  /* Data note */
  .data-note {
    font-size: 0.75rem;
    margin-top: 10px;
  }

  /* ROI chart card */
  .roi-chart-card {
    padding: 14px;
    border-radius: 12px;
  }
  .roi-chart-card__title {
    font-size: 1.05rem;
  }
  .roi-chart-card__subtitle {
    font-size: 0.8125rem;
  }
  .roi-chart-card__controls {
    gap: 8px;
  }
  .seg {
    padding: 2px;
  }
  .seg__btn {
    padding: 5px 7px;
    font-size: 11px;
  }

  /* Chart key summary */
  .chart-key-summary {
    gap: 8px;
    margin-top: 1rem;
    padding-top: 1rem;
  }
  .chart-key-summary__item {
    padding: 6px 10px;
  }
  .chart-key-summary__label {
    font-size: 0.6875rem;
  }
  .chart-key-summary__value {
    font-size: 0.875rem;
  }

  /* Calc-below section */
  .calc-below {
    padding: 1.25rem 1rem;
    margin-top: 1.5rem;
    border-radius: 10px;
    overflow: hidden;
  }
  .calc-below__heading {
    font-size: 1rem;
  }
  .calc-below__faq details {
    padding: 0.75rem 1rem;
    border-radius: 10px;
  }
  .calc-below__faq summary {
    font-size: 0.9375rem;
  }
  .calc-below__faq .faq-answer {
    font-size: 0.875rem;
  }

  /* Compare benchmark */
  .premium-card,
  .compare-benchmark {
    padding: 1rem;
    border-radius: 12px;
  }
  .compare-benchmark__title {
    font-size: 1.05rem;
  }

  /* Performance snapshot */
  .performance-snapshot {
    padding: 0.75rem 0;
    overflow: hidden;
  }
  .performance-snapshot__title {
    font-size: 1.05rem;
  }
  .performance-snapshot__grid {
    gap: 8px;
  }
  .performance-snapshot-card {
    padding: 10px;
    border-radius: 10px;
    min-width: 0;
  }
  .performance-snapshot-card__return {
    font-size: 1rem;
  }
  .performance-snapshot-card__invested {
    font-size: 0.8125rem;
    word-break: break-word;
  }
  .performance-snapshot-card__label {
    font-size: 0.6875rem;
  }
  .performance-snapshot-card__dates {
    font-size: 0.6875rem;
  }

  /* SEO chart: taller ratio so chart isn't tiny on narrow screens */
  .seo-chart-svg {
    aspect-ratio: 2 / 1;
  }
  .roi-chart__wrap {
    min-height: auto;
    padding: 6px;
  }

  /* Chart minibar: stack vertically */
  .seo-chart-minibar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    font-size: 0.8125rem;
  }
  .seo-chart-minibar__arrow {
    display: none;
  }

  /* Performance insights */
  .seo-performance-insights {
    padding: 0.75rem 1rem;
  }
  .seo-performance-insights__list {
    font-size: 0.875rem;
    padding-left: 1rem;
  }

  .calc-below__aside {
    margin: 0.75rem 0;
  }
  .related-card {
    padding: 0.625rem 1rem;
    min-height: 40px;
  }

  /* Quick scenarios */
  .quick-scenarios {
    margin-top: 0.75rem;
  }
  .quick-scenarios__heading {
    font-size: 0.9375rem;
    margin-bottom: 8px;
  }
  .quick-scenarios__btn {
    font-size: 0.75rem;
    padding: 4px 10px;
  }
  .quick-scenarios__label {
    font-size: 0.6875rem;
  }

  /* Fetch message */
  .calc-shell .fetch-message {
    font-size: 0.8125rem;
  }

  /* Related calculators */
  .related-calculators-grid {
    gap: 8px;
  }
}

/* -------------------------------------------------------------------------
   Below-results section (full width band)
   ------------------------------------------------------------------------- */
.calc-below {
  width: 100%;
  margin-top: var(--space-2xl, 3rem);
  padding: var(--space-2xl, 3rem) var(--space-lg, 1.5rem);
  background: #f8fafc;
  border-radius: var(--radius-lg, 12px);
}

.calc-below__manual-link {
  font-size: 0.9375rem;
  color: #64748b;
  margin: var(--space-md, 1rem) 0 var(--space-xl, 2rem);
}

.calc-below__manual-link a {
  color: var(--color-link, #2563eb);
}

.calc-below__grid {
  display: grid;
  gap: var(--space-xl, 2rem);
  margin-top: var(--space-xl, 2rem);
}

@media (min-width: 1024px) {
  .calc-below__grid {
    grid-template-columns: 1fr 340px;
    gap: var(--space-2xl, 3rem);
    align-items: start;
  }
}

.calc-below__heading {
  font-size: 1.125rem;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 0.625rem;
}

.calc-below__block + .faq-accordion,
.calc-below__block + .calc-below__block {
  margin-top: 1.25rem;
}

.calc-below__steps {
  margin: 0;
  padding-left: 1.25rem;
  color: #475569;
  line-height: 1.65;
}

.calc-below__steps li {
  margin-bottom: var(--space-sm, 0.5rem);
}

.calc-below__faq {
  margin-top: 1.25rem;
}

.calc-below__faq details {
  margin-bottom: 0.625rem;
  padding: 0.75rem 1.25rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.calc-below__faq details[open] {
  padding-bottom: var(--space-lg, 1.5rem);
}

.calc-below__faq summary {
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
  list-style: none;
}

.calc-below__faq summary::-webkit-details-marker {
  display: none;
}

.calc-below__faq .faq-answer {
  margin: var(--space-sm, 0.5rem) 0 0;
  color: #475569;
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* Related calculators grid — one card per row */
.related-calculators-grid {
  display: grid;
  gap: var(--space-sm, 0.5rem);
  grid-template-columns: 1fr;
}

/* Two-column related grids (tools/scenarios) on tablet/desktop */
.related-grid--two-col {
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .related-grid--two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Explicit single-column variant (explore more tools) */
.related-grid--single {
  grid-template-columns: 1fr;
}

.calc-below__aside {
  margin: 0.875rem 0;
}

.section-helper-text {
  margin: 0.125rem 0 0.5rem;
  font-size: 0.8125rem;
  color: #64748b;
}

.related-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md, 1rem);
  padding: 0.75rem 1.25rem;
  min-height: 44px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  color: #0f172a;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.related-card:hover {
  border-color: var(--color-primary, #2563eb);
  background: #f8fafc;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  text-decoration: none;
  color: #0f172a;
}

.related-card__logo {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.related-card__logo .instrument-logo-wrap {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.related-card__logo .instrument-logo,
.related-card__logo .instrument-logo-placeholder,
.related-card__logo img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.related-card__logo .instrument-logo-forex .instrument-logo,
.related-card__logo .instrument-logo-forex .instrument-logo-placeholder {
  width: 18px;
  height: 18px;
}

.related-card__icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  margin-top: 2px;
}
.related-card__icon svg {
  width: 16px;
  height: 16px;
}

.related-card__text {
  flex: 1;
  min-width: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.related-card__arrow {
  flex-shrink: 0;
  margin-top: 2px;
  color: #94a3b8;
  font-size: 1.125rem;
}

/* -------------------------------------------------------------------------
   ROI over time chart (premium analytics card)
   ------------------------------------------------------------------------- */
.roi-chart-card {
  position: relative;
  margin-top: 0;
  margin-bottom: var(--space-lg, 1.5rem);
  padding: var(--space-xl, 2rem);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.card--result-summary {
  margin-top: var(--space-lg, 1.5rem);
}

.calc-below__block--primary {
  margin-top: var(--space-lg, 1.5rem);
}

.what-next-grid {
  display: grid;
  gap: var(--space-sm, 0.5rem);
}

/* Compact action cards (invest/dca): 2 cols desktop, 1 col mobile */
.what-next-grid {
  grid-template-columns: 1fr;
  gap: 0.5rem;
}
@media (min-width: 640px) {
  .what-next-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
}

.what-next-action-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: inherit;
  text-decoration: none;
  font-size: 0.875rem;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.what-next-action-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.what-next-action-card__icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: #64748b;
}
.what-next-action-card__icon svg {
  width: 20px;
  height: 20px;
}
.what-next-action-card__label {
  flex: 1;
  min-width: 0;
}

.what-next-group {
  display: grid;
  gap: 0.35rem;
}

.what-next-group__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.roi-chart-card--10y {
  margin-top: var(--space-lg, 1.5rem);
}

.roi-chart-card__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md, 1rem);
  margin-bottom: var(--space-md, 1rem);
}

.roi-chart-card__title-block {
  flex: 1;
  min-width: 0;
}

.roi-chart-card__title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.roi-chart-card__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
}

.roi-chart-card__instrument {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.roi-chart-card__instrument .instrument-logo-wrap {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
}

.roi-chart-card__instrument .instrument-logo-wrap .instrument-logo,
.roi-chart-card__instrument .instrument-logo-wrap .instrument-logo-placeholder {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 11px;
}

.roi-chart-card__instrument .instrument-logo-forex .instrument-logo,
.roi-chart-card__instrument .instrument-logo-forex .instrument-logo-placeholder {
  width: 18px;
  height: 18px;
  font-size: 9px;
}

.roi-chart-card__instrument-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #334155;
}

.roi-chart-card__subtitle {
  margin: var(--space-xs, 0.25rem) 0 0;
  font-size: 0.875rem;
  color: #64748b;
  line-height: 1.4;
}

.roi-chart-card__controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.roi-chart-card .roi-chart__wrap {
  margin-top: var(--space-md, 1rem);
}

.roi-chart-card .roi-chart__meta {
  font-size: 11px;
  color: #94a3b8;
}

/* Key summary row under chart */
.chart-key-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md, 1rem);
  margin-top: var(--space-lg, 1.5rem);
  padding-top: var(--space-lg, 1.5rem);
  border-top: 1px solid #e2e8f0;
}

@media (min-width: 640px) {
  .chart-key-summary {
    grid-template-columns: repeat(4, 1fr);
  }
}

.chart-key-summary__item {
  padding: var(--space-sm, 0.5rem) var(--space-md, 1rem);
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius, 8px);
}

.chart-key-summary__label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 2px;
}

.chart-key-summary__value {
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
}

.chart-key-summary__value.pos {
  color: #0f766e;
}

.chart-key-summary__value.neg {
  color: #b91c1c;
}

.chart-key-summary__value.neutral {
  color: #64748b;
}

.seg {
  display: inline-flex;
  background: #f1f5f9;
  border: 1px solid #e6e9ef;
  border-radius: 12px;
  padding: 3px;
}

.seg__btn {
  border: 0;
  background: transparent;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
  color: #334155;
  cursor: pointer;
}

.seg__btn.is-active {
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
  color: #0f172a;
}

.roi-chart__meta {
  font-size: 11px;
  color: #94a3b8;
  display: flex;
  gap: 8px;
  align-items: center;
}

.roi-chart__wrap {
  border: 1px solid #eef1f5;
  border-radius: 12px;
  padding: 10px;
  background: #f8fafc;
  overflow: hidden;
  min-height: 220px;
}
/* SEO result chart (Investment growth / Portfolio value): taller so full series is visible */
.roi-chart-card:not(.card--result-summary) .roi-chart__wrap {
  min-height: 300px;
}

/* mobile roi-chart__wrap rules consolidated into main @media (max-width: 639px) block */

.roi-chart-card canvas,
.roi-chart canvas {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
}

.roi-chart__footer {
  margin-top: 10px;
  font-size: 12px;
  color: #667085;
}

/* Yearly performance / value-over-time cards */
.timeline-grid {
  display: grid;
  gap: var(--space-sm, 0.5rem);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .timeline-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .timeline-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.timeline-card {
  border-radius: var(--radius-lg, 12px);
  border: 1px solid #e2e8f0;
  background: #fff;
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.timeline-card__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
}

.timeline-card__label {
  font-size: 0.75rem;
  color: #64748b;
}

.timeline-card__value {
  font-size: 0.875rem;
  font-weight: 500;
  color: #0f172a;
  text-align: right;
}

.timeline-card__year {
  font-size: 1rem;
  font-weight: 600;
}

.timeline-card__return {
  font-weight: 600;
}

.roi-chart__footer .muted {
  color: #667085;
}

.roi-chart-card .dot,
.roi-chart .dot {
  opacity: 0.7;
}

.calc-below .seo-summary {
  font-size: 1rem;
  line-height: 1.6;
  color: #475569;
  margin: var(--space-md, 1rem) 0;
  max-width: none;
}

/* -------------------------------------------------------------------------
   Quick Scenarios
   ------------------------------------------------------------------------- */
.quick-scenarios {
  margin-bottom: var(--space-lg, 1.5rem);
}

.quick-scenarios__heading {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
}

.quick-scenarios__group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.quick-scenarios__group + .quick-scenarios__group {
  margin-top: 8px;
}

.quick-scenarios__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  min-width: 72px;
}

.quick-scenarios__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quick-scenarios__btn {
  font-size: 0.8125rem;
  padding: 5px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

.quick-scenarios__hint {
  margin: var(--space-xs, 0.25rem) 0 0;
  font-size: 0.8125rem;
  color: #64748b;
}

.quick-scenarios__group {
  opacity: 0.45;
  transition: opacity 0.15s;
}

.quick-scenarios__group.is-active {
  opacity: 1;
}

.quick-scenarios__group:hover {
  opacity: 1;
}

@media (max-width: 639px) {
  .quick-scenarios__group {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .quick-scenarios__label {
    min-width: auto;
  }
}

/* -------------------------------------------------------------------------
   Compare vs Benchmark
   ------------------------------------------------------------------------- */
.premium-card,
.compare-benchmark {
  margin-top: var(--space-lg, 1.5rem);
  margin-bottom: var(--space-xl, 2rem);
  padding: var(--space-xl, 2rem);
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.compare-benchmark__header {
  margin-bottom: var(--space-lg, 1.5rem);
}

.compare-benchmark__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
}

.compare-benchmark__subtitle {
  margin: var(--space-xs, 0.25rem) 0 var(--space-md, 1rem);
  font-size: 0.9375rem;
  color: #64748b;
  line-height: 1.4;
}

.compare-benchmark__seg {
  margin-top: var(--space-sm, 0.5rem);
}

.compare-benchmark__seg .seg__btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.compare-benchmark__coming-soon {
  margin: 0;
  padding: var(--space-lg, 1.5rem);
  text-align: center;
  color: #64748b;
  font-size: 0.9375rem;
  background: #f8fafc;
  border-radius: 12px;
}

.compare-benchmark__table-wrap {
  overflow-x: auto;
}

.compare-benchmark__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.compare-benchmark__table th,
.compare-benchmark__table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

.compare-benchmark__table th {
  font-weight: 600;
  color: #475569;
  background: #f8fafc;
}

.compare-benchmark__table td.pos {
  color: #0f766e;
  font-weight: 600;
}

.compare-benchmark__table td.neg {
  color: #b91c1c;
  font-weight: 600;
}

.compare-benchmark__table td.neutral {
  color: #64748b;
}

.compare-benchmark__diff {
  font-weight: 600;
}

/* -------------------------------------------------------------------------
   How to interpret ROI (SEO / trust)
   ------------------------------------------------------------------------- */
.interpret-roi-block {
  margin-bottom: var(--space-xl, 2rem);
}

.interpret-roi-block p {
  margin: 0 0 var(--space-md, 1rem);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #475569;
}

.interpret-roi-block p:last-child {
  margin-bottom: 0;
}

/* -------------------------------------------------------------------------
   Performance Snapshot (period return cards)
   ------------------------------------------------------------------------- */
.performance-snapshot {
  margin-top: 0;
  margin-bottom: var(--space-2xl, 3rem);
}

.performance-snapshot__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-lg, 1.5rem);
  margin-bottom: var(--space-lg, 1.5rem);
}

.performance-snapshot__title-block {
  flex: 1;
  min-width: 0;
}

.performance-snapshot__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
}

.performance-snapshot__subtitle {
  margin: var(--space-xs, 0.25rem) 0 0;
  font-size: 0.9375rem;
  color: #64748b;
  line-height: 1.4;
}

.performance-snapshot__input-wrap {
  flex-shrink: 0;
}

.performance-snapshot__label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #64748b;
  margin-bottom: var(--space-xs, 0.25rem);
}

.performance-snapshot__input {
  width: 120px;
  padding: var(--space-sm, 0.5rem) var(--space-md, 1rem);
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius, 8px);
  background: #fff;
}

.performance-snapshot__input:focus {
  outline: none;
  border-color: var(--color-link, #2563eb);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.performance-snapshot__grid {
  display: grid;
  gap: var(--space-md, 1rem);
  grid-template-columns: repeat(2, 1fr);
}

.performance-snapshot__grid--empty .performance-snapshot__empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: var(--space-lg, 1.5rem);
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  color: #64748b;
  font-size: 0.9375rem;
  line-height: 1.5;
}

@media (min-width: 640px) {
  .performance-snapshot__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .performance-snapshot__grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.performance-snapshot-card {
  padding: var(--space-lg, 1.5rem);
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.performance-snapshot-card__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: var(--space-xs, 0.25rem);
}

.performance-snapshot-card__return {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-sm, 0.5rem);
}

.performance-snapshot-card__return.pos {
  color: #0f766e;
}

.performance-snapshot-card__return.neg {
  color: #b91c1c;
}

.performance-snapshot-card__return.neutral {
  color: #64748b;
}

@media (min-width: 768px) {
  .roi-chart-card .performance-snapshot-card {
    padding: 1.5rem 1.75rem;
  }
  .roi-chart-card .performance-snapshot-card__return {
    font-size: 1.625rem;
  }
}

.performance-snapshot-card__invested {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: var(--space-xs, 0.25rem);
}

.performance-snapshot-card__dates {
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.35;
}

.performance-snapshot__grid--metrics {
  margin-top: var(--space-md, 1rem);
}

/* SEO result page chart (server-rendered SVG) – same visual system as calculator .roi-chart-card */
.seo-chart-container {
  width: 100%;
  position: relative;
  flex-shrink: 0;
}
.seo-result-chart {
  margin: 0;
  position: relative;
}
.roi-chart-card .roi-chart__wrap .seo-result-chart {
  margin: 0;
}
.seo-result-chart .chart-tip.seo-chart-tooltip {
  left: 0;
  top: 0;
}
/* SEO chart tooltip: fixed to viewport so it’s never clipped at chart edges */
.chart-tip.seo-chart-tooltip {
  min-width: 200px;
}
.chart-tip.seo-chart-tooltip .chart-tip__row .v {
  white-space: nowrap;
  overflow: visible;
  min-width: 4em;
  text-align: right;
}
.seo-chart-svg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 400;
  min-height: 280px;
  vertical-align: top;
}
/* SVG chart: all styling done via inline attributes to match calculator canvas exactly.
   Only minimal overrides needed here. */
.seo-chart-caption {
  font-size: 0.875rem;
  color: #64748b;
  margin-top: 0.5rem;
}
.roi-chart-card .seo-result-chart .seo-chart-caption {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.seo-chart-scale-toggle {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
}
.seo-chart-scale-btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
.seo-chart-scale-btn:hover {
  background: #f8fafc;
}
.seo-chart-scale-btn.is-active {
  background: var(--color-primary, #0f766e);
  color: #fff;
  border-color: var(--color-primary, #0f766e);
}

.seo-timeline-table {
  margin-top: 0.5rem;
}
.seo-timeline-table th,
.seo-timeline-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}
.seo-timeline-table th {
  font-weight: 600;
  color: #64748b;
  font-size: 0.8125rem;
}
.seo-timeline-return.pos { color: var(--color-positive, #0f766e); font-weight: 600; }
.seo-timeline-return.neg { color: var(--color-negative, #b91c1c); font-weight: 600; }

.seo-metric-icon {
  opacity: 0.85;
  margin-right: 0.15em;
}

.seo-performance-insights {
  margin: var(--space-lg, 1.5rem) 0;
  padding: 1rem 1.25rem;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}
.seo-performance-insights__title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: #0f172a;
}
.seo-performance-insights__list {
  margin: 0;
  padding-left: 1.25rem;
  color: #334155;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.seo-chart-minibar {
  margin-top: 0.75rem;
  padding: 0.5rem 0;
  font-size: 0.875rem;
  color: #64748b;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.seo-chart-minibar__arrow {
  color: #94a3b8;
}
.seo-chart-minibar__start,
.seo-chart-minibar__end,
.seo-chart-minibar__mult {
  font-weight: 500;
  color: #334155;
}
/* Compare chips row */
.seo-compare-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0 1.5rem;
}
.seo-compare-chips__label {
  font-size: 0.875rem;
  color: #64748b;
  font-weight: 500;
}
.seo-compare-chip {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  font-size: 0.8125rem;
  color: #334155;
  background: #fff;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.seo-compare-chip:hover {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  text-decoration: none;
}

/* Calculator CTA block */
.calculator-cta-block {
  background: #f8fafc;
  border-radius: 10px;
  padding: 1rem;
  margin: 0 0 1.25rem;
}
.calculator-cta-block__prompt {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 0.25rem;
}
.calculator-cta-block__desc {
  font-size: 0.8125rem;
  color: #64748b;
  margin: 0 0 0.75rem;
  line-height: 1.5;
}
.calculator-cta-block__btn {
  font-size: 0.8125rem;
  padding: 0.5rem 1.25rem;
}
@media (max-width: 639px) {
  .calculator-cta-block {
    padding: 0.875rem;
  }
}

/* Asset ticker label */
.asset-ticker-label {
  font-size: 0.8125rem;
  color: #94a3b8;
  font-weight: 500;
  margin: 0.125rem 0 0;
  letter-spacing: 0.02em;
}

/* Quick scenario chips */
.seo-scenario-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  margin: 0 0 1rem;
}
.seo-scenario-chips__label {
  font-size: 0.8125rem;
  color: #64748b;
  font-weight: 500;
  margin-right: 0.125rem;
}
.seo-scenario-chip {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  font-size: 0.75rem;
  color: #334155;
  background: #fff;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.seo-scenario-chip:hover {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  text-decoration: none;
}

/* Key insight box */
.seo-key-insight {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  background: #f8fafc;
  border-left: 3px solid #60a5fa;
  border-radius: 6px;
  padding: 0.625rem 0.875rem;
  margin: 0.75rem 0 1rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: #334155;
}
.seo-key-insight__icon {
  flex-shrink: 0;
  font-size: 0.875rem;
  line-height: 1.55;
}
.seo-key-insight__text {
  flex: 1;
}
@media (max-width: 639px) {
  .seo-key-insight {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
  }
}

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

/* ROI chart tooltip: when shown, JS moves it to body and sets position:fixed so it is
   never clipped by .roi-chart__wrap (overflow:hidden) or any ancestor. */
.chart-tip {
  position: absolute;
  z-index: 9999;
  pointer-events: none;
  min-width: 180px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  padding: 12px 14px;
}

.chart-tip[hidden] {
  display: none !important;
}

.chart-tip__date {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 6px;
}

.chart-tip__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.chart-tip__row .k {
  color: #334155;
}

.chart-tip__row .v {
  font-weight: 700;
  color: #0f172a;
}

.chart-tip__row.muted .v {
  font-weight: 600;
  color: #334155;
}

.chart-tip__row .v.pos { color: var(--color-positive, #0f766e); }
.chart-tip__row .v.neg { color: var(--color-negative, #b91c1c); }

.chart-tip__row--maxdd {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #e6e9ef;
  font-size: 12px;
  color: #b91c1c;
  font-weight: 600;
}

.seo-summary {
  font-size: 1rem;
  line-height: 1.5;
  color: #334155;
  margin: 1rem 0;
  max-width: 72ch;
}

.seo-summary:empty,
.seo-summary[hidden] {
  display: none;
}

/* Data source footnote: minimal, professional */
.data-note {
  font-size: 13px;
  color: #6b7280;
  margin-top: 16px;
}

.data-info {
  cursor: help;
  margin-left: 6px;
  font-weight: 500;
}

/* ── Asset Switcher ─────────────────────────────────── */

.as-trigger {
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s;
}
.as-trigger:hover,
.as-trigger:focus-visible {
  border-color: var(--color-accent, #3b82f6);
  box-shadow: 0 0 0 2px rgba(59,130,246,.18);
}
.as-trigger::after {
  content: '⌄';
  font-size: .75em;
  margin-left: 2px;
  opacity: .5;
}

.as-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: min(18vh, 120px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
}
.as-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.as-panel {
  width: min(520px, 94vw);
  max-height: min(480px, 65vh);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: as-pop .18s ease-out;
}
@keyframes as-pop {
  from { transform: scale(.96) translateY(-8px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.as-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
}

.as-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  background: transparent;
  color: #1e293b;
  font-family: inherit;
}
.as-input::placeholder { color: #94a3b8; }

.as-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  line-height: 1;
}
.as-close:hover { color: #475569; background: #f1f5f9; }

.as-list {
  overflow-y: auto;
  flex: 1;
  padding: 6px 0;
}

.as-cat-label {
  padding: 8px 16px 4px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #94a3b8;
}

.as-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  text-decoration: none !important;
  color: #1e293b;
  transition: background .12s;
  border-left: 3px solid transparent;
}
.as-item:hover,
.as-item.is-focused {
  background: #f1f5f9;
  border-left-color: var(--color-accent, #3b82f6);
}
.as-item__logo {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.as-item__logo .instrument-logo-wrap,
.as-item__logo .instrument-logo {
  width: 28px;
  height: 28px;
}
.as-item__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.as-item__name {
  font-size: .875rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.as-item__name mark {
  background: rgba(59,130,246,.15);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}
.as-item__symbol {
  font-size: .75rem;
  color: #64748b;
}
.as-item__cat {
  flex-shrink: 0;
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #94a3b8;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 2px 7px;
}

.as-empty {
  padding: 24px 16px;
  text-align: center;
  color: #94a3b8;
  font-size: .875rem;
}

.instrument-logo-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e2e8f0;
  font-size: .6rem;
  font-weight: 700;
  color: #64748b;
}

@media (max-width: 639px) {
  .as-overlay {
    align-items: flex-start;
    padding-top: 0;
  }
  .as-panel {
    width: 100vw;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
  }
  .as-list {
    flex: 1;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
  }
  .as-header {
    padding: 12px 14px;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
  }
}

/* Calculator anchor nav (page sections) */
.calculator-anchor-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin: 1rem 0 1.5rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  font-size: 0.875rem;
}
.calculator-anchor-nav a {
  color: var(--color-primary, #2563eb);
  text-decoration: none;
}
.calculator-anchor-nav a:hover {
  text-decoration: underline;
}

/* Scroll targets: offset so sections are not hidden under sticky header */
#overview,
#roi-chart,
#performance-snapshot,
#benchmark-comparison,
#faq {
  scroll-margin-top: 5.5rem;
}

/* Result highlight block */
.result-highlight {
  background: #f8fafc;
  border-left: 4px solid #2563eb;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-top: 0.25rem;
  margin-bottom: 1.5rem;
}
.result-highlight__context {
  font-size: 1rem;
  color: #64748b;
  margin: 0 0 0.25rem;
}
.result-highlight__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
  font-weight: 600;
  margin: 0 0 0.125rem;
}
.result-highlight__value {
  font-size: 2.5rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.25rem;
  line-height: 1.2;
}
.result-highlight__return {
  font-size: 1.125rem;
  margin: 0;
}
.result-highlight__return.pos { color: #0f766e; }
.result-highlight__return.neg { color: #b91c1c; }
.result-highlight__return.neutral { color: #64748b; }
.result-highlight__takeaway {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0.5rem 0 0;
  line-height: 1.5;
}
@media (max-width: 640px) {
  .result-highlight {
    padding: 1rem;
  }
  .result-highlight__value {
    font-size: 1.875rem;
  }
}

/* Trust / data note below results */
.calc-trust-note {
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  color: #64748b;
}

/* Compare vs Benchmark intro line */
.compare-benchmark__intro {
  margin-bottom: 0.5rem;
  font-size: 0.9375rem;
  color: #475569;
}

/* Compare {Asset} with links block */
.calc-compare-with-heading {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}
.compare-with-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.compare-with-links a {
  color: var(--color-primary, #2563eb);
  text-decoration: none;
  font-size: 0.875rem;
}
.compare-with-links a:hover {
  text-decoration: underline;
}
