/* =============================================================================
   SATOSHIMACRO V22 ENHANCEMENTS
   Drop-in CSS patch — append to site.css (or link after main stylesheet).

   Fixes:
     0. Phase 2 container, breadcrumb, callout, card, table, section styles
     1. Rating bar fill math for /5 scale (Phase 2 pages)
     1b. V20 rating bar display:grid conflict fix
     2. Scroll progress indicator
     3. Back-to-top button
     4. Enhanced hover effects on cards, tables, and links
     5. Section entrance animations
   ============================================================================= */


/* ─────────────────────────────────────────────────────────────────────────────
   0a. PHASE 2 CONTAINER & LAYOUT
   ───────────────────────────────────────────────────────────────────────────── */

main.content-main {
  max-width: var(--content-width, 1200px);
  margin: 0 auto;
  padding: var(--space-8, 2rem) var(--content-padding, clamp(1rem, 3vw, 2rem));
}

.pillar-article,
.review-article {
  max-width: 900px;
  margin: 0 auto;
}

.article-header {
  padding: var(--space-6, 1.5rem) 0 var(--space-6, 1.5rem);
  border-bottom: 1px solid var(--border-subtle, #E5E7EB);
  margin-bottom: var(--space-6, 1.5rem);
}

.article-header .eyebrow {
  margin-bottom: var(--space-3, 0.75rem);
}

.article-header h1 {
  margin-bottom: var(--space-4, 1rem);
}

.article-header .lead {
  margin-bottom: var(--space-5, 1.25rem);
  max-width: 72ch;
}

.article-header .article-meta {
  flex-wrap: wrap;
  border-top: none;
  border-bottom: none;
  padding: 0;
  margin: 0;
}

.article-meta .author-link {
  color: var(--text-brand, #B8935A);
  font-weight: 600;
  text-decoration: none;
}

.article-meta .author-link:hover {
  color: var(--color-gold-600, #B8935A);
  text-decoration: underline;
}


/* ─────────────────────────────────────────────────────────────────────────────
   0b. PHASE 2 BREADCRUMB (singular)
   ───────────────────────────────────────────────────────────────────────────── */

nav.breadcrumb {
  font-size: var(--text-sm, 0.875rem);
  color: var(--text-tertiary, #6B7280);
  margin: 0 0 var(--space-4, 1rem) 0;
  padding: 0;
}

nav.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2, 0.5rem);
  list-style: none;
  padding: 0;
  margin: 0;
}

nav.breadcrumb li {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2, 0.5rem);
}

nav.breadcrumb li + li::before {
  content: '/';
  color: var(--text-tertiary, #6B7280);
  opacity: 0.5;
  margin-right: 2px;
}

nav.breadcrumb a {
  color: var(--text-tertiary, #6B7280);
  text-decoration: none;
  transition: color 120ms ease;
}

nav.breadcrumb a:hover {
  color: var(--color-gold-600, #B8935A);
}

nav.breadcrumb [aria-current="page"] {
  color: var(--text-primary, #0A1628);
  font-weight: 500;
}


/* ─────────────────────────────────────────────────────────────────────────────
   0c. PHASE 2 CALLOUT BOXES
   ───────────────────────────────────────────────────────────────────────────── */

.callout,
.callout-primary {
  background: linear-gradient(135deg, var(--bg-secondary, #F9FAFB) 0%, rgba(201, 169, 97, 0.04) 100%);
  border-left: 4px solid var(--color-gold-500, #C9A961);
  border-radius: 0 var(--radius-md, 0.5rem) var(--radius-md, 0.5rem) 0;
  padding: var(--space-5, 1.25rem) var(--space-6, 1.5rem);
  margin: var(--space-6, 1.5rem) 0;
  position: relative;
}

.callout-title {
  display: inline-block;
  position: absolute;
  top: -10px;
  left: var(--space-4, 1rem);
  background: var(--color-gold-500, #C9A961);
  color: var(--color-navy-950, #0A1628);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 var(--space-2, 0.5rem) 0;
  line-height: 1.4;
}

.callout p {
  font-size: var(--text-base, 1rem);
  line-height: 1.6;
  color: var(--text-primary, #0A1628);
  margin-bottom: var(--space-3, 0.75rem);
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout strong {
  color: var(--text-primary, #0A1628);
  font-weight: 700;
}

.callout .small-text {
  font-size: var(--text-sm, 0.875rem);
  color: var(--text-tertiary, #6B7280);
  margin-top: var(--space-3, 0.75rem);
}


/* ─────────────────────────────────────────────────────────────────────────────
   0d. DIRECT-ANSWER wrapper
   ───────────────────────────────────────────────────────────────────────────── */

.direct-answer {
  padding: 0;
  margin-bottom: var(--space-6, 1.5rem);
}


/* ─────────────────────────────────────────────────────────────────────────────
   0e. BROKER SUMMARY CARD
   ───────────────────────────────────────────────────────────────────────────── */

.broker-summary-card {
  background: var(--bg-card, #FFFFFF);
  border: 1px solid var(--border-subtle, #E5E7EB);
  border-left: 4px solid var(--color-gold-500, #C9A961);
  border-radius: var(--radius-lg, 0.75rem);
  padding: var(--space-5, 1.25rem) var(--space-6, 1.5rem);
  margin: var(--space-4, 1rem) 0 var(--space-6, 1.5rem);
  box-shadow: var(--shadow-sm, 0 1px 3px 0 rgba(10, 22, 40, 0.08));
}

.broker-summary-card .broker-rating {
  display: flex;
  align-items: center;
  gap: var(--space-5, 1.25rem);
}

.broker-summary-card .overall-rating {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: var(--text-3xl, 2.25rem);
  font-weight: 700;
  color: var(--color-gold-600, #B8935A);
  line-height: 1;
  flex-shrink: 0;
}

.broker-summary-card .overall-rating small {
  font-size: var(--text-lg, 1.125rem);
  color: var(--text-tertiary, #6B7280);
  font-weight: 400;
}

.broker-summary-card .broker-rating p {
  font-size: var(--text-base, 1rem);
  color: var(--text-secondary, #374151);
  line-height: 1.5;
  margin: 0;
}

.broker-summary-card .broker-rating p strong {
  color: var(--text-primary, #0A1628);
  font-weight: 700;
}

@media (max-width: 640px) {
  .broker-summary-card .broker-rating {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3, 0.75rem);
  }
}


/* ─────────────────────────────────────────────────────────────────────────────
   0f. COMPARISON TABLE WRAPPER
   ───────────────────────────────────────────────────────────────────────────── */

.comparison-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: var(--space-6, 1.5rem) 0;
  border-radius: var(--radius-lg, 0.75rem);
  border: 1px solid var(--border-subtle, #E5E7EB);
  box-shadow: var(--shadow-sm, 0 1px 3px 0 rgba(10, 22, 40, 0.08));
  background: var(--bg-card, #FFFFFF);
}

.comparison-table-wrap .comparison-table {
  margin: 0;
  border: none;
  box-shadow: none;
  border-radius: 0;
  width: 100%;           /* CHANGED: was min-width only; now fills container */
  min-width: 640px;
  font-size: var(--text-sm, 0.875rem);
}

.comparison-table-wrap .comparison-table thead th {
  white-space: nowrap;
  vertical-align: middle;
  padding: var(--space-3, 0.75rem) var(--space-4, 1rem);
  font-size: var(--text-xs, 0.75rem);
}

.comparison-table-wrap .comparison-table tbody td {
  vertical-align: middle;
  padding: var(--space-3, 0.75rem) var(--space-4, 1rem);
  font-size: var(--text-sm, 0.875rem);
}

/* Default first-column behaviour: LEFT-aligned text (data tables) */
.comparison-table-wrap .comparison-table tbody td:first-child {
  text-align: left;
  padding-left: var(--space-4, 1rem);
  padding-right: var(--space-3, 0.75rem);
}

/* EXCEPTION: Center the first column ONLY when it contains a rank badge */
.comparison-table-wrap .comparison-table tbody td:first-child:has(.rank-badge) {
  text-align: center;
}

.comparison-table-wrap .comparison-table tbody td:last-child {
  padding-right: var(--space-4, 1rem);
}

.comparison-table-wrap .comparison-table tbody .btn {
  white-space: nowrap;
}

.comparison-table-wrap .comparison-table tbody td strong + br + small,
.comparison-table-wrap .comparison-table tbody td strong {
  line-height: 1.3;
}

.comparison-table-wrap .comparison-table tbody td small {
  color: var(--text-tertiary, #6B7280);
  font-size: var(--text-xs, 0.75rem);
  display: block;
  margin-top: 2px;
}

@media (min-width: 769px) {
  .comparison-table .hide-mobile,
  .broker-table .hide-mobile {
    display: table-cell !important;
  }
}

@media (max-width: 768px) {
  .comparison-table .hide-mobile,
  .broker-table .hide-mobile {
    display: none !important;
  }
}


/* ─────────────────────────────────────────────────────────────────────────────
   0g. SMALL-TEXT UTILITY
   ───────────────────────────────────────────────────────────────────────────── */

.small-text {
  font-size: var(--text-sm, 0.875rem);
  color: var(--text-tertiary, #6B7280);
  line-height: 1.5;
  margin-top: var(--space-3, 0.75rem);
}


/* ─────────────────────────────────────────────────────────────────────────────
   0h. PHASE 2 SECTION SPACING & VISIBILITY OVERRIDE
   ───────────────────────────────────────────────────────────────────────────── */

.pillar-article .section,
.review-article .section {
  padding: var(--space-6, 1.5rem) 0;
  opacity: 1 !important;
  transform: none !important;
  position: relative;
}

.pillar-article .section + .section::before,
.review-article .section + .section::before {
  display: none !important;
  content: none !important;
}

.pillar-article .section h2,
.review-article .section h2 {
  margin-top: 0;
  margin-bottom: var(--space-4, 1rem);
  scroll-margin-top: calc(var(--header-height, 72px) + 16px);
}

.pillar-article .section h3,
.review-article .section h3 {
  margin-top: var(--space-6, 1.5rem);
  margin-bottom: var(--space-3, 0.75rem);
}

.pillar-article .section p,
.review-article .section p {
  margin-bottom: var(--space-4, 1rem);
  line-height: 1.7;
}

.pillar-article .section ul,
.pillar-article .section ol,
.review-article .section ul,
.review-article .section ol {
  margin: var(--space-3, 0.75rem) 0 var(--space-4, 1rem) var(--space-6, 1.5rem);
}

.pillar-article .section li,
.review-article .section li {
  margin-bottom: var(--space-2, 0.5rem);
  color: var(--text-secondary, #374151);
  line-height: 1.6;
}


/* ─────────────────────────────────────────────────────────────────────────────
   0i. TOC INSIDE PHASE 2 ARTICLES
   ───────────────────────────────────────────────────────────────────────────── */

.pillar-article aside.toc,
.review-article aside.toc {
  background: var(--bg-secondary, #F9FAFB) !important;
  border: 1px solid var(--border-subtle, #E5E7EB) !important;
  border-radius: var(--radius-lg, 0.75rem) !important;
  padding: var(--space-5, 1.25rem) !important;
  margin: var(--space-6, 1.5rem) 0 var(--space-8, 2rem) !important;
  position: static !important;
  top: auto !important;
  max-height: none !important;
  overflow: visible !important;
  font-size: var(--text-sm, 0.875rem);
}

.pillar-article aside.toc h6,
.review-article aside.toc h6 {
  margin: 0 0 var(--space-3, 0.75rem) 0;
  font-size: var(--text-xs, 0.75rem);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-gold-600, #B8935A);
  font-weight: 700;
}

.pillar-article aside.toc ul,
.review-article aside.toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
  columns: 2;
  column-gap: var(--space-6, 1.5rem);
}

@media (max-width: 640px) {
  .pillar-article aside.toc ul,
  .review-article aside.toc ul {
    columns: 1;
  }
}

.pillar-article aside.toc li,
.review-article aside.toc li {
  padding: 0;
  margin: 0;
  break-inside: avoid;
  border-bottom: none;
}

.pillar-article aside.toc a,
.review-article aside.toc a {
  display: block;
  padding: 6px 0;
  color: var(--text-secondary, #374151);
  text-decoration: none;
  border-left: none;
  background: none;
  transition: color 160ms ease, padding-left 160ms ease;
  font-weight: 400;
}

.pillar-article aside.toc a:hover,
.review-article aside.toc a:hover {
  color: var(--color-gold-600, #B8935A);
  padding-left: 6px;
  background: none;
}

.pillar-article aside.toc a.active,
.review-article aside.toc a.active {
  color: var(--color-gold-600, #B8935A);
  font-weight: 600;
  background: none;
}


/* ─────────────────────────────────────────────────────────────────────────────
   0j. PHASE 2 FAQ ITEMS
   ───────────────────────────────────────────────────────────────────────────── */

.pillar-article details.faq-item,
.review-article details.faq-item {
  border-bottom: 1px solid var(--border-subtle, #E5E7EB);
  padding: 0;
  margin: 0;
}

.pillar-article details.faq-item:first-of-type,
.review-article details.faq-item:first-of-type {
  border-top: 1px solid var(--border-subtle, #E5E7EB);
}

.pillar-article details.faq-item summary,
.review-article details.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: var(--space-4, 1rem) 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4, 1rem);
  transition: color 160ms ease;
}

.pillar-article details.faq-item summary::-webkit-details-marker,
.review-article details.faq-item summary::-webkit-details-marker {
  display: none;
}

.pillar-article details.faq-item summary::after,
.review-article details.faq-item summary::after {
  content: '+';
  flex-shrink: 0;
  font-size: 24px;
  color: var(--color-gold-600, #B8935A);
  font-weight: 300;
  transition: transform 200ms ease;
  line-height: 1;
}

.pillar-article details.faq-item[open] summary::after,
.review-article details.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.pillar-article details.faq-item summary h3,
.review-article details.faq-item summary h3 {
  margin: 0;
  font-size: var(--text-lg, 1.125rem);
  font-weight: 600;
  color: var(--text-primary, #0A1628);
}

.pillar-article details.faq-item summary:hover h3,
.review-article details.faq-item summary:hover h3 {
  color: var(--color-gold-600, #B8935A);
}

.pillar-article details.faq-item > p,
.review-article details.faq-item > p {
  padding: 0 0 var(--space-5, 1.25rem) 0;
  color: var(--text-secondary, #374151);
  line-height: 1.7;
  margin: 0;
}


/* ─────────────────────────────────────────────────────────────────────────────
   0k. PHASE 2 AUTHOR BOX
   ───────────────────────────────────────────────────────────────────────────── */

.pillar-article .author-box,
.review-article .author-box {
  margin: var(--space-10, 2.5rem) 0;
}

.author-box-inner {
  display: flex;
  gap: var(--space-5, 1.25rem);
  align-items: flex-start;
}

.author-image {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-tertiary, #F3F4F6);
}

.author-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.author-content {
  flex: 1;
  min-width: 0;
}

.author-content h4 {
  margin: 0 0 var(--space-1, 0.25rem);
  font-size: var(--text-lg, 1.125rem);
  font-weight: 700;
  color: var(--text-primary, #0A1628);
}

.author-content .author-title {
  margin-bottom: var(--space-2, 0.5rem);
}

.author-content p {
  font-size: var(--text-sm, 0.875rem);
  color: var(--text-secondary, #374151);
  line-height: 1.6;
  margin-bottom: var(--space-3, 0.75rem);
}

@media (max-width: 640px) {
  .author-box-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}


/* ─────────────────────────────────────────────────────────────────────────────
   0l. PHASE 2 RISK DISCLOSURE
   ───────────────────────────────────────────────────────────────────────────── */

.pillar-article > .risk-disclosure,
.review-article > .risk-disclosure,
.pillar-article aside.risk-disclosure,
.review-article aside.risk-disclosure {
  margin-top: var(--space-8, 2rem);
  font-size: var(--text-xs, 0.75rem);
  color: var(--text-tertiary, #6B7280);
  padding: var(--space-4, 1rem);
  background: var(--bg-secondary, #F9FAFB);
  border-radius: var(--radius-md, 0.5rem);
  border-left: 3px solid var(--color-bear-500, #EF4444);
  line-height: 1.6;
}


/* ─────────────────────────────────────────────────────────────────────────────
   1. RATING BARS — PHASE 2 (/5 SCALE)
   ───────────────────────────────────────────────────────────────────────────── */

.rating-bars {
  display: flex !important;
  flex-direction: column !important;
  gap: var(--space-3, 0.75rem) !important;
  padding: var(--space-4, 1rem) 0 !important;
  margin: var(--space-4, 1rem) 0 var(--space-6, 1.5rem) !important;
}

.rating-bars .rating-bar {
  display: grid !important;
  grid-template-columns: 200px 1fr 52px !important;
  gap: var(--space-4, 1rem) !important;
  align-items: center !important;
  font-size: var(--text-sm, 0.875rem) !important;
  height: auto !important;
  background: none !important;
  border-radius: 0 !important;
  overflow: visible !important;
  padding: 0 !important;
}

@media (max-width: 640px) {
  .rating-bars .rating-bar {
    grid-template-columns: 1fr 52px !important;
    grid-template-rows: auto auto !important;
    gap: 4px var(--space-3, 0.75rem) !important;
  }
  .rating-bars .rating-bar-track {
    grid-column: 1 / -1 !important;
  }
}

.rating-bars .rating-bar-label {
  color: var(--text-secondary, #374151) !important;
  font-weight: 500 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.rating-bars .rating-bar-track {
  height: 10px !important;
  background: var(--bg-tertiary, #F3F4F6) !important;
  border-radius: 999px !important;
  overflow: hidden !important;
  position: relative !important;
  width: auto !important;
}

.rating-bars .rating-bar-fill {
  height: 100% !important;
  background: linear-gradient(
    90deg,
    var(--color-gold-400, #D4BA7C),
    var(--color-gold-500, #C9A961)
  ) !important;
  border-radius: 999px !important;
  transition: width 900ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.rating-bars .rating-bar-fill[data-score="5.0"]  { width: 100% !important; }
.rating-bars .rating-bar-fill[data-score="4.9"]  { width: 98% !important; }
.rating-bars .rating-bar-fill[data-score="4.8"]  { width: 96% !important; }
.rating-bars .rating-bar-fill[data-score="4.7"]  { width: 94% !important; }
.rating-bars .rating-bar-fill[data-score="4.6"]  { width: 92% !important; }
.rating-bars .rating-bar-fill[data-score="4.5"]  { width: 90% !important; }
.rating-bars .rating-bar-fill[data-score="4.4"]  { width: 88% !important; }
.rating-bars .rating-bar-fill[data-score="4.3"]  { width: 86% !important; }
.rating-bars .rating-bar-fill[data-score="4.2"]  { width: 84% !important; }
.rating-bars .rating-bar-fill[data-score="4.1"]  { width: 82% !important; }
.rating-bars .rating-bar-fill[data-score="4.0"]  { width: 80% !important; }
.rating-bars .rating-bar-fill[data-score="3.9"]  { width: 78% !important; }
.rating-bars .rating-bar-fill[data-score="3.8"]  { width: 76% !important; }

.rating-bars .rating-bar-fill[data-score-level="low"],
.rating-bars .rating-bar-fill[data-score-level="mid"],
.rating-bars .rating-bar-fill[data-score-level="high"] {
  background: linear-gradient(90deg, var(--color-gold-400, #D4BA7C), var(--color-gold-500, #C9A961)) !important;
}

.rating-bars .rating-bar-value {
  font-family: var(--font-mono, 'JetBrains Mono', monospace) !important;
  font-weight: 600 !important;
  color: var(--text-primary, #0A1628) !important;
  font-variant-numeric: tabular-nums !important;
  text-align: right !important;
}

.rating-bars .rating-bar.rating-bar-overall {
  padding-top: var(--space-4, 1rem) !important;
  margin-top: var(--space-2, 0.5rem) !important;
  border-top: 1px solid var(--border-subtle, #E5E7EB) !important;
}
.rating-bars .rating-bar.rating-bar-overall .rating-bar-label {
  font-weight: 700 !important;
  color: var(--text-primary, #0A1628) !important;
}
.rating-bars .rating-bar.rating-bar-overall .rating-bar-fill {
  background: linear-gradient(90deg, var(--color-navy-700, #2A3F5F), var(--color-navy-950, #0A1628)) !important;
}
.rating-bars .rating-bar.rating-bar-overall .rating-bar-value {
  font-size: var(--text-base, 1rem) !important;
  color: var(--color-gold-600, #B8985A) !important;
}


/* ─────────────────────────────────────────────────────────────────────────────
   1b. V20 RATING BARS FIX
   ───────────────────────────────────────────────────────────────────────────── */

.rating-grid .rating-bar,
.rating-row .rating-bar {
  display: block !important;
  grid-template-columns: none !important;
  grid-template-rows: none !important;
  gap: 0 !important;
  align-items: initial !important;
  padding: 0 !important;
  font-size: inherit !important;
  height: 10px !important;
  background: var(--bg-tertiary, #F3F4F6) !important;
  border-radius: 999px !important;
  overflow: hidden !important;
  position: relative !important;
  width: 100% !important;
}

.rating-grid .rating-bar .rating-bar-fill,
.rating-row .rating-bar .rating-bar-fill {
  height: 100% !important;
  background: linear-gradient(
    90deg,
    var(--color-gold-400, #D4BA7C),
    var(--color-gold-500, #C9A961)
  ) !important;
  border-radius: 999px !important;
  display: block !important;
  transition: width 900ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.rating-bar-fill[data-width="100%"] { width: 100%; }
.rating-bar-fill[data-width="98%"]  { width: 98%; }
.rating-bar-fill[data-width="96%"]  { width: 96%; }
.rating-bar-fill[data-width="94%"]  { width: 94%; }
.rating-bar-fill[data-width="92%"]  { width: 92%; }
.rating-bar-fill[data-width="90%"]  { width: 90%; }
.rating-bar-fill[data-width="88%"]  { width: 88%; }
.rating-bar-fill[data-width="86%"]  { width: 86%; }
.rating-bar-fill[data-width="84%"]  { width: 84%; }
.rating-bar-fill[data-width="82%"]  { width: 82%; }
.rating-bar-fill[data-width="80%"]  { width: 80%; }
.rating-bar-fill[data-width="78%"]  { width: 78%; }
.rating-bar-fill[data-width="76%"]  { width: 76%; }

.rating-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: var(--space-3, 0.75rem) !important;
  margin: var(--space-5, 1.25rem) 0 !important;
}

.rating-row {
  display: grid !important;
  grid-template-columns: 180px 1fr 50px !important;
  gap: var(--space-4, 1rem) !important;
  align-items: center !important;
  font-size: var(--text-sm, 0.875rem) !important;
}

.rating-row .rating-label {
  color: var(--text-secondary, #374151);
  font-weight: 500;
}

.rating-row .rating-value {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-weight: 600;
  color: var(--text-primary, #0A1628);
  font-variant-numeric: tabular-nums;
  text-align: right;
}


/* ─────────────────────────────────────────────────────────────────────────────
   2. SCROLL PROGRESS BAR
   ───────────────────────────────────────────────────────────────────────────── */

#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(
    90deg,
    var(--color-gold-500, #C9A961),
    var(--color-navy-800, #1A2B4A)
  );
  z-index: 9999;
  transition: width 120ms linear;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  #scroll-progress { transition: none; }
}


/* ─────────────────────────────────────────────────────────────────────────────
   3. BACK-TO-TOP BUTTON
   ───────────────────────────────────────────────────────────────────────────── */

#back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-navy-950, #0A1628);
  color: #FFFFFF;
  border: 1px solid var(--color-gold-500, #C9A961);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 220ms ease, visibility 220ms ease, transform 220ms ease, background 160ms ease;
  z-index: 998;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(10, 22, 40, 0.18);
}

#back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#back-to-top:hover {
  background: var(--color-gold-500, #C9A961);
  color: var(--color-navy-950, #0A1628);
  transform: translateY(-2px);
}

#back-to-top svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.5;
}

@media (max-width: 768px) {
  #back-to-top {
    bottom: 80px;
  }
}


/* ─────────────────────────────────────────────────────────────────────────────
   4. HOVER ENHANCEMENTS
   ───────────────────────────────────────────────────────────────────────────── */

.card,
.card-hover {
  transition:
    transform 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
    box-shadow 200ms ease,
    border-color 200ms ease;
}

.card-hover:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(10, 22, 40, 0.08);
  border-color: var(--color-gold-500, #C9A961);
}

.comparison-table tbody tr,
table.broker-table tbody tr {
  transition: background-color 160ms ease;
}
.comparison-table tbody tr:hover,
table.broker-table tbody tr:hover {
  background-color: var(--bg-hover, rgba(201, 169, 97, 0.05));
}

.content-main a:not(.btn):not(.nav-link):not(.author-link) {
  background-image: linear-gradient(to right, currentColor 0%, currentColor 100%);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0 1px;
  transition: background-size 220ms ease;
}
.content-main a:not(.btn):not(.nav-link):not(.author-link):hover {
  background-size: 100% 1px;
}

.btn {
  transition:
    background-color 160ms ease,
    color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(10, 22, 40, 0.12);
}


/* ─────────────────────────────────────────────────────────────────────────────
   5. SECTION ENTRANCE ANIMATIONS (scoped to .fade-in-on-scroll only)
   ───────────────────────────────────────────────────────────────────────────── */

.fade-in-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 550ms ease, transform 550ms ease;
}
.fade-in-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .fade-in-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .rating-bars .rating-bar-fill { transition: none; }
  .rating-grid .rating-bar-fill { transition: none; }
  .rating-row .rating-bar-fill { transition: none; }
  #back-to-top { transition: opacity 0ms, visibility 0ms; }
}
