/* ==========================================================================
   TOOL VERTIX - COMPONENT STYLESHEET
   Pure Vanilla CSS Architecture & Modern Component Design System
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. BUTTONS & CONTROLS
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.625rem 1.125rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.8125rem;
}

.btn-lg {
  padding: 0.875rem 1.625rem;
  font-size: 1rem;
  border-radius: var(--radius);
}

.btn-primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
  border-color: var(--border);
}

.btn-secondary:hover {
  background-color: var(--border);
  color: var(--foreground);
}

.btn-outline {
  background-color: transparent;
  color: var(--foreground);
  border-color: var(--border-strong);
}

.btn-outline:hover {
  background-color: var(--secondary);
  border-color: var(--foreground);
}

.btn-accent {
  background-color: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.btn-accent:hover {
  opacity: 0.92;
  box-shadow: 0 4px 12px rgba(16, 158, 104, 0.25);
}

.btn-icon {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
}

.btn-icon:hover {
  background: var(--secondary);
}

/* --------------------------------------------------------------------------
   2. SITE HEADER & NAVIGATION
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(251, 250, 248, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: all var(--transition-base);
}

.site-header.is-scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  background-color: rgba(251, 250, 248, 0.96);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: 1.5rem;
}

.header-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--foreground);
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand-icon {
  width: 2.125rem;
  height: 2.125rem;
  background-color: var(--primary);
  color: var(--primary-foreground);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.desktop-nav {
  display: none;
  align-items: center;
}

@media (min-width: 992px) {
  .desktop-nav {
    display: flex;
    align-items: center;
  }
}

/* Nav container list reset */
.desktop-nav ul,
.desktop-nav .header-nav-list,
.desktop-nav .menu,
.desktop-nav .primary-menu-list {
  display: flex;
  align-items: center;
  flex-direction: row;
  list-style: none !important;
  list-style-type: none !important;
  margin: 0 !important;
  padding: 0 !important;
  gap: 0.375rem;
}

/* Nav list items reset - guarantees NO bullets under any circumstance */
.desktop-nav li,
.desktop-nav .menu-item,
.header-nav-list li {
  list-style: none !important;
  list-style-type: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  position: relative;
}

.desktop-nav li::before,
.desktop-nav li::marker,
.desktop-nav .menu-item::before,
.desktop-nav .menu-item::marker,
.header-nav-list li::before,
.header-nav-list li::marker {
  content: none !important;
  display: none !important;
}

/* Nav Link Item (matches Screenshot 2 exactly) */
.desktop-nav a,
.desktop-nav li a,
.desktop-nav .nav-link,
.header-nav-list a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.95rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--muted-foreground);
  background-color: transparent;
  border-radius: var(--radius-md);
  text-decoration: none;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

/* Hover State */
.desktop-nav a:hover,
.desktop-nav li a:hover,
.desktop-nav .nav-link:hover,
.header-nav-list a:hover {
  color: var(--foreground);
  background-color: var(--secondary);
}

/* Active / Current Page State - Soft Pill (matches Screenshot 2 "Stock Calculator") */
.desktop-nav li.current-menu-item > a,
.desktop-nav li.current_page_item > a,
.desktop-nav li.current-page-ancestor > a,
.desktop-nav a.active,
.desktop-nav a[aria-current="page"],
.header-nav-list li.current-menu-item > a,
.header-nav-list li.current_page_item > a,
.header-nav-list a.active,
.nav-link.active {
  color: var(--foreground) !important;
  background-color: var(--secondary) !important;
  font-weight: 600 !important;
}

/* Submenu dropdown support if any */
.desktop-nav li.menu-item-has-children {
  position: relative;
}

.desktop-nav li.menu-item-has-children > ul.sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  display: flex;
  flex-direction: column;
  min-width: 13rem;
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 0.375rem;
  margin-top: 0.25rem !important;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: all var(--transition-fast);
  z-index: 100;
}

.desktop-nav li.menu-item-has-children:hover > ul.sub-menu,
.desktop-nav li.menu-item-has-children:focus-within > ul.sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.desktop-nav ul.sub-menu li {
  width: 100%;
}

.desktop-nav ul.sub-menu li a {
  width: 100%;
  justify-content: flex-start;
  padding: 0.5rem 0.75rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mobile-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.625rem;
  height: 2.625rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
}

@media (min-width: 1024px) {
  .mobile-toggle {
    display: none;
  }
}

/* Mobile Navigation Drawer */
.mobile-drawer-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(21, 34, 56, 0.45);
  backdrop-filter: blur(4px);
  z-index: 150;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}

.mobile-drawer-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 86vw;
  max-width: 24rem;
  background-color: var(--card);
  border-left: 1px solid var(--border);
  z-index: 160;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  transform: translateX(100%);
  transition: transform var(--transition-smooth);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
}

.mobile-drawer.is-active {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.drawer-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
}

.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.drawer-link {
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--foreground);
  border-radius: var(--radius-md);
  transition: background-color var(--transition-fast);
}

.drawer-link:hover,
.drawer-link.active {
  background-color: var(--secondary);
}

/* --------------------------------------------------------------------------
   3. HERO SECTION & INTERACTIVE ENGINE
   -------------------------------------------------------------------------- */
.hero-section {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff 0%, var(--surface) 100%);
  padding: 4rem 0 4.5rem 0;
}

@media (min-width: 1024px) {
  .hero-section {
    padding: 5.5rem 0 6rem 0;
  }
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -25%;
  left: 50%;
  transform: translateX(-50%);
  width: 1200px;
  height: 650px;
  background: radial-gradient(ellipse at center, rgba(16, 185, 129, 0.09) 0%, rgba(99, 102, 241, 0.04) 45%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero-section .container-page {
  position: relative;
  z-index: 1;
}

.hero-grid {
  display: grid;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr 1.08fr;
    gap: 4rem;
  }
}

/* Hero Content (Left) */
.hero-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.22);
  border-radius: 9999px;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  box-shadow: 0 1px 2px rgba(16, 185, 129, 0.05);
}

.hero-content h1 {
  margin-top: 1.25rem;
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 3.6vw + 0.5rem, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.035em;
  color: var(--foreground);
}

.hero-lead {
  margin-top: 1.25rem;
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--muted-foreground);
  max-width: 34rem;
}

.hero-actions {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.875rem;
}

.hero-actions .btn-primary {
  box-shadow: 0 4px 14px rgba(21, 34, 56, 0.16);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-actions .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(21, 34, 56, 0.22);
}

.hero-actions .btn-outline {
  background: var(--card);
  border-color: var(--border);
  color: var(--foreground);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.hero-actions .btn-outline:hover {
  background: var(--secondary);
  border-color: var(--border-strong);
}

/* Trust Badges Strip */
.hero-trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 2.25rem;
  padding-top: 1.75rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.hero-trust-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted-foreground);
}

.hero-trust-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.12);
  color: var(--positive);
  flex-shrink: 0;
}

/* Hero Interactive Card (Right) */
.hero-chart-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  box-shadow: 0 20px 45px -15px rgba(15, 23, 42, 0.09), 0 0 0 1px rgba(15, 23, 42, 0.03);
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

.hero-chart-card:hover {
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(15, 23, 42, 0.04);
}

.hero-card-accent-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, #6366f1 70%, #8b5cf6 100%);
}

.chart-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.chart-primary-metric {
  flex: 1 1 auto;
}

.chart-engine-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-display);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin-bottom: 0.25rem;
}

.chart-value {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--foreground);
  letter-spacing: -0.03em;
  margin: 0;
}

.chart-meta {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  margin-top: 0.35rem;
}

.chart-stats {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
}

.chart-stat {
  display: flex;
  flex-direction: column;
  text-align: right;
}

.chart-stat dt {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-foreground);
}

.chart-stat dd {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 700;
  margin: 0.2rem 0 0 0;
  color: var(--foreground);
}

.stat-indicator {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.stat-indicator-invested {
  background: #6366f1;
}

.stat-indicator-growth {
  background: #10b981;
}

/* SVG Chart Stage & Hover Tooltip */
.chart-svg-wrap {
  position: relative;
  width: 100%;
  height: 200px;
  margin-top: 0.5rem;
  touch-action: pan-y;
  user-select: none;
}

.hero-chart-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.hero-chart-tooltip {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translate(-50%, -100%);
  background: rgba(21, 34, 56, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.6875rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.15);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.1s ease;
  z-index: 10;
  white-space: nowrap;
}

.hero-chart-tooltip.is-active {
  opacity: 1;
}

.tooltip-header {
  font-weight: 700;
  color: #94a3b8;
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
}

.tooltip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.tooltip-label {
  color: #cbd5e1;
}

.tooltip-val {
  font-family: var(--font-display);
  font-weight: 700;
  color: #ffffff;
}

.tooltip-val.text-positive {
  color: #34d399 !important;
}

/* X-Axis Labels */
.chart-x-axis {
  display: flex;
  justify-content: space-between;
  padding: 0 1.25rem;
  margin-top: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--muted-foreground);
}

/* Legend */
.hero-chart-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-swatch {
  display: inline-block;
  width: 12px;
  height: 3px;
  border-radius: 2px;
}

.legend-swatch.swatch-curve {
  background: #10b981;
}

.legend-swatch.swatch-invested {
  background: #6366f1;
}

/* Sliders Control Panel */
.chart-slider-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

@media (min-width: 640px) {
  .chart-slider-strip {
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
  }
}

.slider-mini-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.slider-mini-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.slider-mini-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--foreground);
}

.slider-val-badge {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  background: var(--secondary);
  border-radius: var(--radius-sm);
  color: var(--foreground);
}

.slider-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Custom Styled Range Sliders */
.mini-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 9999px;
  background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--fill-pct, 50%), var(--secondary) var(--fill-pct, 50%), var(--secondary) 100%);
  outline: none;
  cursor: pointer;
  margin: 0.4rem 0;
  transition: background 0.1s ease;
}

.mini-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  border: 2.5px solid var(--accent);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mini-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.mini-slider:focus::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

.mini-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  border: 2.5px solid var(--accent);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mini-slider::-moz-range-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.slider-bounds {
  display: flex;
  justify-content: space-between;
  font-size: 0.625rem;
  color: var(--muted-foreground);
  padding: 0 2px;
}

.hero-card-footer {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
}

.hero-card-footnote {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.6875rem;
  color: var(--muted-foreground);
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   4. CALCULATOR DIRECTORY CARDS
   -------------------------------------------------------------------------- */
.calculators-section {
  padding: 4rem 0;
}

@media (min-width: 768px) {
  .calculators-section {
    padding: 6rem 0;
  }
}

.section-head {
  max-width: 42rem;
  margin-bottom: 2.5rem;
}

.section-head h2 {
  margin-bottom: 0.75rem;
}

.section-lead {
  font-size: 1.125rem;
  color: var(--muted-foreground);
}

.calculator-cards-grid {
  display: grid;
  gap: 1.25rem;
}

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

.calc-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  text-decoration: none;
  color: inherit;
}

.calc-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.calc-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.65rem;
  color: var(--foreground);
}

.calc-card-desc {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.calc-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.calc-pill {
  border: 1px solid var(--border);
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.calc-card-link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
}

.calc-card:hover .calc-card-link svg {
  transform: translateX(4px);
}

.calc-card-link svg {
  transition: transform var(--transition-fast);
}

/* --------------------------------------------------------------------------
   5. HOW IT WORKS & PRINCIPLES
   -------------------------------------------------------------------------- */
.how-it-works-section {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background-color: var(--surface);
  padding: 4rem 0;
}

.steps-grid {
  display: grid;
  gap: 2.5rem;
}

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

.step-card {
  display: flex;
  flex-direction: column;
}

.step-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.step-number {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--accent);
}

.step-icon {
  color: var(--muted-foreground);
}

.step-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.step-desc {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.6;
}

/* About & Principles Section */
.about-section {
  padding: 4rem 0;
}

@media (min-width: 1024px) {
  .about-section {
    padding: 6rem 0;
  }
}

.about-grid {
  display: grid;
  gap: 3rem;
}

@media (min-width: 1024px) {
  .about-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.about-disclaimer-box {
  margin-top: 1.5rem;
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.6;
}

.principles-list {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.principle-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}

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

.principle-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.principle-desc {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.6;
}

/* Call To Action Banner */
.cta-banner {
  border-top: 1px solid var(--border);
  background-color: var(--primary);
  color: var(--primary-foreground);
  padding: 4rem 0;
}

.cta-flex {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .cta-flex {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.cta-lead {
  font-size: 1.05rem;
  color: rgba(250, 249, 247, 0.8);
  margin-top: 0.5rem;
}

/* --------------------------------------------------------------------------
   6. CALCULATOR INTERFACE & WORKSPACES
   -------------------------------------------------------------------------- */
.calc-workspace {
  margin-top: 2rem;
  margin-bottom: 4rem;
}

.calc-grid {
  display: grid;
  gap: 2rem;
}

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

.calc-sidebar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.calc-sidebar-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 0.35rem;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-top: 0.25rem;
}

.input-affix-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-affix {
  position: absolute;
  left: 0.85rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted-foreground);
  pointer-events: none;
}

.form-control {
  width: 100%;
  height: 2.625rem;
  padding: 0.5rem 0.85rem;
  font-size: 0.9375rem;
  color: var(--foreground);
  background-color: var(--card);
  border: 1px solid var(--input);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input-has-prefix .form-control {
  padding-left: 2rem;
}

.form-control:focus {
  border-color: var(--ring);
  outline: none;
  box-shadow: 0 0 0 2px rgba(16, 158, 104, 0.18);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23606a7b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  padding-right: 2.25rem;
}

.form-range {
  width: 100%;
  accent-color: var(--accent);
  margin-top: 0.5rem;
}

/* Metric Tiles Grid */
.metric-tiles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

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

.metric-tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.metric-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-foreground);
  margin-bottom: 0.35rem;
}

.metric-val {
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 800;
  color: var(--foreground);
}

.metric-sub {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-top: 0.25rem;
}

/* Calculator Visualizer Canvas / Chart */
.calc-visualizer-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}

.visualizer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.visualizer-chart-wrap {
  width: 100%;
  height: 20rem;
  position: relative;
}

.visualizer-chart-wrap svg {
  width: 100%;
  height: 100%;
}

/* Data Table Component */
.calc-table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-head-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.calc-table-container {
  max-height: 26rem;
  overflow-y: auto;
  overflow-x: auto;
}

.calc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  text-align: left;
}

.calc-table th {
  position: sticky;
  top: 0;
  background-color: var(--surface);
  color: var(--foreground);
  font-weight: 700;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.calc-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.calc-table tr:hover td {
  background-color: rgba(244, 243, 240, 0.6);
}

.text-right {
  text-align: right !important;
}

/* --------------------------------------------------------------------------
   7. BLOG SUITE & ARTICLE TYPOGRAPHY
   -------------------------------------------------------------------------- */
.blog-hero {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 3.5rem 0;
}

.category-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.cat-pill {
  padding: 0.45rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted-foreground);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.cat-pill:hover,
.cat-pill.is-active {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

.blog-grid {
  display: grid;
  gap: 2rem;
  padding: 4rem 0;
}

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

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

.post-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-fast);
}

.post-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow-panel);
}

.post-thumb-wrap {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--secondary);
  position: relative;
}

.post-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-base);
}

.post-card:hover .post-thumb-wrap img {
  transform: scale(1.04);
}

.post-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.post-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-bottom: 0.75rem;
}

.post-cat-badge {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.post-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.75rem;
}

.post-excerpt {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.post-footer-meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* Single Article Layout */
.single-article-header {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.breadcrumb-nav {
  margin-bottom: 1.5rem;
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

.breadcrumb-sep {
  opacity: 0.5;
}

.article-title {
  font-size: clamp(2rem, 3.5vw + 1rem, 3.25rem);
  line-height: 1.15;
  margin-bottom: 1.25rem;
}

.article-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.article-featured-image {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-sm);
}

.article-featured-image img {
  width: 100%;
  max-height: 32rem;
  object-fit: cover;
}

/* Social Share Bar */
.social-share-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 2rem 0;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.share-btn:hover {
  background: var(--secondary);
  border-color: var(--border-strong);
}

/* Prose Typography */
.prose {
  max-width: 50rem;
  margin: 0 auto;
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--foreground);
}

.prose h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-size: 1.875rem;
}

.prose h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-size: 1.45rem;
}

.prose p {
  margin-bottom: 1.5rem;
}

.prose ul, .prose ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.prose ul { list-style-type: disc; }
.prose ol { list-style-type: decimal; }

.prose li {
  margin-bottom: 0.5rem;
}

.prose blockquote {
  border-left: 4px solid var(--accent);
  padding: 1rem 1.5rem;
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  margin: 2rem 0;
}

.author-bio-card {
  max-width: 50rem;
  margin: 3.5rem auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.author-avatar {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

/* Related Posts */
.related-posts-section {
  max-width: 50rem;
  margin: 4rem auto;
  border-top: 1px solid var(--border);
  padding-top: 3rem;
}

/* Comments */
.comments-area {
  max-width: 50rem;
  margin: 4rem auto;
  border-top: 1px solid var(--border);
  padding-top: 3rem;
}

.comment-list {
  margin-top: 2rem;
  margin-bottom: 3rem;
}

.comment {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}

.comment-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.comment-meta {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* --------------------------------------------------------------------------
   8. FOOTER
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background-color: var(--surface);
}

.footer-top {
  padding: 4rem 0 3rem;
}

.footer-grid {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.footer-desc {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.65;
  margin-top: 0.85rem;
  max-width: 24rem;
}

.footer-col-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted-foreground);
  margin-bottom: 1.25rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-link {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--foreground);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 1.75rem 0;
}

.footer-disclaimer-text {
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--muted-foreground);
}

.footer-copy {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* --------------------------------------------------------------------------
   9. ACCORDIONS, TABS & ANIMATIONS
   -------------------------------------------------------------------------- */
.faq-accordion {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

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

.faq-trigger {
  width: 100%;
  text-align: left;
  padding: 1.25rem 1.5rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--foreground);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: none;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.faq-trigger:hover {
  background-color: var(--surface);
}

.faq-trigger svg {
  transition: transform var(--transition-base);
  color: var(--muted-foreground);
  flex-shrink: 0;
}

.faq-trigger[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.faq-content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--transition-base);
  padding: 0 1.5rem;
}

.faq-content > div {
  overflow: hidden;
}

.faq-trigger[aria-expanded="true"] + .faq-content {
  grid-template-rows: 1fr;
  padding-bottom: 1.25rem;
}

/* Reveal on scroll animations */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 500ms ease, transform 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Number Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 3rem 0;
}

.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.page-numbers:hover,
.page-numbers.current {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

/* Tax Calculator Period Switcher Buttons */
.tax-period-btn {
  background: var(--card);
  color: var(--muted-foreground);
  border: 1px solid var(--border);
  font-weight: 600;
  transition: all var(--transition-fast);
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  text-align: center;
}

.tax-period-btn:hover {
  border-color: var(--primary);
  color: var(--foreground);
}

.tax-period-btn.is-active {
  background: var(--primary) !important;
  color: #ffffff !important;
  border-color: var(--primary) !important;
}

/* ==========================================================================
   SARMAAYA-STYLE ROI CALCULATOR COMPONENTS
   ========================================================================== */
.roi-sarmaaya-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (min-width: 992px) {
  .roi-sarmaaya-grid {
    grid-template-columns: 1.05fr 1.35fr;
    gap: 1.75rem;
    align-items: stretch;
  }
}

.roi-panel-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.roi-panel-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--foreground);
  margin-top: 0;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.roi-search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.roi-search-icon {
  position: absolute;
  left: 0.875rem;
  color: var(--muted-foreground);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.roi-search-input {
  padding-left: 2.5rem !important;
  padding-right: 2rem !important;
  font-weight: 600;
}

.roi-clear-btn {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--muted-foreground);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
}

.roi-clear-btn:hover {
  color: var(--foreground);
}

.roi-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-raise);
  max-height: 220px;
  overflow-y: auto;
  z-index: 100;
  margin-top: 0.25rem;
}

.roi-dropdown-item {
  padding: 0.625rem 0.875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background var(--transition-fast);
  border-bottom: 1px solid var(--border);
}

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

.roi-dropdown-item:hover {
  background: var(--secondary);
}

.roi-quick-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.625rem;
}

.roi-chip {
  background: var(--secondary);
  color: var(--muted-foreground);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  line-height: 1.2;
}

.roi-chip:hover {
  border-color: var(--primary);
  color: var(--foreground);
}

.roi-chip.is-active {
  background: var(--primary) !important;
  color: #ffffff !important;
  border-color: var(--primary) !important;
}

.roi-two-col-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.roi-history-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.roi-history-btn:hover {
  opacity: 0.85;
}

.roi-calc-action-btn {
  width: 100%;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  margin-top: 1.25rem;
}

/* ROI Chart Card */
.roi-chart-card {
  justify-content: space-between;
}

.roi-chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.roi-chart-badge {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--secondary);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  letter-spacing: -0.01em;
}

.roi-chart-viewport {
  position: relative;
  height: 270px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.roi-axis-label {
  position: absolute;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.roi-axis-y {
  left: 0.25rem;
  top: 50%;
  transform: rotate(-90deg) translate(-50%, -100%);
  transform-origin: left top;
}

.roi-axis-x {
  bottom: 0.25rem;
  left: 50%;
  transform: translateX(-50%);
}

.roi-svg-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

.roi-svg-wrapper svg {
  width: 100%;
  height: 100%;
}

.roi-chart-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.roi-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

.roi-legend-text {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  font-weight: 500;
}

.roi-tooltip {
  position: absolute;
  transform: translate(-50%, -120%);
  background: var(--primary);
  color: #ffffff;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  pointer-events: none;
  z-index: 50;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
  line-height: 1.4;
}

/* Summary Results Table Card */
.roi-summary-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  margin-top: 2rem;
}

.roi-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.roi-summary-table-wrap {
  overflow-x: auto;
}

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

.roi-summary-table tr {
  border-bottom: 1px solid var(--border);
}

.roi-summary-table tr:last-child {
  border-bottom: none;
}

.roi-summary-table td {
  padding: 0.875rem 0.5rem;
}

.roi-col-label {
  color: var(--muted-foreground);
  font-weight: 500;
  font-size: 0.9375rem;
}

.roi-col-value {
  text-align: right;
  font-weight: 700;
  font-size: 1rem;
  color: var(--foreground);
}

.roi-highlight-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--border);
}

.roi-highlight-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.roi-hl-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  font-weight: 600;
}

.roi-hl-val {
  font-size: 1.25rem;
  font-weight: 800;
}

/* History Modal */
.roi-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.roi-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
}

.roi-modal-content {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 38rem;
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.5rem;
  z-index: 10;
  box-shadow: var(--shadow-raise);
}

.roi-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

/* ==========================================================================
   ADVANCED USA & WORLDWIDE REAL-TIME ROI TOOLBAR & METRICS
   ========================================================================== */
.roi-market-toolbar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 768px) {
  .roi-market-toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.roi-currency-selector {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.roi-toolbar-label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.roi-currency-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.roi-cur-pill {
  background: var(--secondary);
  color: var(--muted-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.roi-cur-pill:hover {
  color: var(--foreground);
  border-color: var(--primary);
}

.roi-cur-pill.is-active {
  background: var(--primary) !important;
  color: #ffffff !important;
  border-color: var(--primary) !important;
}

.roi-mode-tabs {
  display: flex;
  align-items: center;
  background: var(--secondary);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  gap: 0.25rem;
}

.roi-tab-btn {
  background: transparent;
  border: none;
  padding: 0.4rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted-foreground);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.roi-tab-btn:hover {
  color: var(--foreground);
}

.roi-tab-btn.is-active {
  background: var(--card) !important;
  color: var(--foreground) !important;
  box-shadow: var(--shadow-sm);
}

.roi-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--positive);
  background: rgba(16, 158, 104, 0.1);
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  border: 1px solid rgba(16, 158, 104, 0.2);
}

.roi-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--positive);
  animation: roiPulse 2s infinite ease-in-out;
}

@keyframes roiPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* Switches & Toggles */
.roi-toggles-box {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 1rem;
}

.roi-toggle-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.roi-toggle-item input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.roi-toggle-slider {
  position: relative;
  width: 36px;
  height: 20px;
  background-color: var(--border);
  border-radius: 20px;
  transition: background-color var(--transition-fast);
  flex-shrink: 0;
  margin-top: 2px;
}

.roi-toggle-slider::before {
  content: "";
  position: absolute;
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  border-radius: 50%;
  transition: transform var(--transition-fast);
}

.roi-toggle-item input:checked + .roi-toggle-slider {
  background-color: var(--primary);
}

.roi-toggle-item input:checked + .roi-toggle-slider::before {
  transform: translateX(16px);
}

.roi-toggle-label {
  display: flex;
  flex-direction: column;
  font-size: 0.8125rem;
  line-height: 1.35;
}

.roi-toggle-label strong {
  color: var(--foreground);
}

.roi-toggle-hint {
  font-size: 0.725rem;
  color: var(--muted-foreground);
}

/* Advanced Legend */
.roi-advanced-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.roi-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  font-weight: 600;
}

.roi-legend-line {
  display: inline-block;
  width: 18px;
  border-radius: 2px;
}

/* 6-Up Metric Tiles Grid */
.roi-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .roi-metrics-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1200px) {
  .roi-metrics-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.roi-metric-tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.roi-metric-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.roi-metric-header {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  font-weight: 700;
  line-height: 1.2;
}

.roi-metric-number {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--foreground);
}

.roi-metric-sub {
  font-size: 0.725rem;
  color: var(--muted-foreground);
  line-height: 1.3;
}

.us-freq-btn.is-active {
  background: var(--primary) !important;
  color: #ffffff !important;
  border-color: var(--primary) !important;
}

/* Tool Directory & Explorer Tabs */
.tool-cat-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted-foreground);
  transition: all var(--transition-fast);
}

.tool-cat-btn:hover {
  border-color: var(--border-strong);
  color: var(--foreground);
}

.tool-cat-btn.is-active {
  background: var(--primary) !important;
  color: var(--primary-foreground) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tool-cat-btn.is-active .tool-count-badge {
  background: rgba(255, 255, 255, 0.22) !important;
  border-color: transparent !important;
  color: var(--primary-foreground) !important;
}

/* Tool Category Badges */
.badge-popular {
  background: rgba(217, 119, 6, 0.12) !important;
  color: #d97706 !important;
  border-color: rgba(217, 119, 6, 0.3) !important;
  font-weight: 700 !important;
}

.badge-positive {
  background: rgba(16, 158, 104, 0.12) !important;
  color: var(--positive) !important;
  border-color: rgba(16, 158, 104, 0.3) !important;
  font-weight: 700 !important;
}

.badge-accent {
  background: rgba(26, 86, 219, 0.12) !important;
  color: var(--accent) !important;
  border-color: rgba(26, 86, 219, 0.3) !important;
  font-weight: 700 !important;
}

.badge-neutral {
  background: var(--surface) !important;
  color: var(--muted-foreground) !important;
  border-color: var(--border) !important;
}

.tool-directory-card {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
}

.tool-directory-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.tool-modal-trigger:hover {
  color: var(--primary);
}

.tool-modal-trigger:hover svg {
  transform: translateX(3px) translateY(-1px);
}


