/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  --navy: #0b2131;
  --navy-rgb: 11, 33, 49;
  --gold: #c09335;
  --gold-rgb: 192, 147, 53;
  --muted: #566b7a;
  --bg: #f4f7f9;
  --card: #ffffff;
  --radius: 16px;
  --glass: rgba(255, 255, 255, 0.45);
  --accent: #8e44ad;
  --border-color: rgba(11, 33, 49, 0.06);
  --card-shadow: 0 12px 36px -4px rgba(11, 33, 49, 0.04), 0 4px 16px -2px rgba(11, 33, 49, 0.02);
  --focus-ring: rgba(192, 147, 53, 0.15);
  --font-heading: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
}

body.dark {
  --navy: #f1f5f9;
  --navy-rgb: 241, 245, 249;
  --gold: #f2d184;
  --gold-rgb: 242, 209, 132;
  --muted: #94a3b8;
  --bg: #060b0e;
  --card: #0d151c;
  --glass: rgba(13, 21, 28, 0.45);
  --border-color: rgba(241, 245, 249, 0.08);
  --card-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.6), 0 6px 24px -4px rgba(0, 0, 0, 0.4);
  --focus-ring: rgba(242, 209, 132, 0.2);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--navy);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.3s ease, color 0.3s ease;
}

/* Header */
.site-header {
  background: linear-gradient(135deg, #0b2131 0%, #12324a 100%);
  color: white;
  padding: 20px 0;
  box-shadow: 0 8px 24px rgba(11, 33, 49, 0.08);
  border-bottom: 2px solid rgba(192, 147, 53, 0.3);
}
body.dark .site-header {
  background: linear-gradient(135deg, #050b0f 0%, #0d1720 100%);
  border-bottom-color: rgba(242, 209, 132, 0.2);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}
.logo {
  height: 48px;
  width: auto;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.2s ease;
}
.logo:hover {
  transform: scale(1.05);
}

.brand-text h1 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.brand-text .tag {
  margin: 2px 0 0 0;
  font-size: 0.82rem;
  opacity: 0.85;
  letter-spacing: 0.2px;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.btn-ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: white;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s ease;
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
}
.btn-ghost:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--focus-ring);
}

/* Theme Switcher */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.switch input {
  display: none;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  transition: 0.25s ease;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.slider:before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
input:checked + .slider {
  background: var(--gold);
}
input:checked + .slider:before {
  transform: translateX(20px);
}
.toggle-label {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.82rem;
  font-weight: 500;
}

/* Layout */
.container {
  max-width: 1250px;
  margin: 36px auto;
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 32px;
  padding: 0 24px;
}

/* PDF Header (Hidden by default, shown during PDF capture) */
.pdf-header {
  display: none;
  grid-column: 1 / -1;
  background: var(--card);
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  margin-bottom: 20px;
}
.pdf-header.pdf-visible {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: start;
}
.pdf-logo {
  width: 110px;
  max-width: 100%;
  height: auto;
  display: block;
}
.pdf-header-right {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--navy);
}
.pdf-header-right .pdf-name {
  font-weight: 700;
  margin-bottom: 4px;
  font-size: 1.05rem;
}

/* Card Style */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-color);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Section Headings */
.inputs h2, .results h2 {
  margin: 32px 0 20px 0;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  border-left: 3px solid var(--gold);
  padding-left: 10px;
}
.inputs h2:first-of-type, .results h2:first-of-type {
  margin-top: 0;
}

/* Form Styles */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.form-group {
  display: flex;
  flex-direction: column;
}
.form-group.full {
  grid-column: 1 / -1;
}
.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
  letter-spacing: 0.2px;
}

/* Inputs & Form Controls */
input[type="text"], input[type="number"], input[type="date"], select {
  width: 100%;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--card);
  font-size: 0.95rem;
  color: var(--navy);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.01);
  transition: all 0.2s ease;
  outline: none;
}
input[type="text"]:focus, input[type="number"]:focus, input[type="date"]:focus, select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px var(--focus-ring);
}
input[type="text"]:hover, input[type="number"]:hover, input[type="date"]:hover, select:hover {
  border-color: rgba(var(--gold-rgb), 0.5);
}

/* Custom Sliders */
input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(var(--gold-rgb), 0.15);
  border-radius: 4px;
  outline: none;
  margin-top: 10px;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gold);
  border: 3px solid var(--card);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 0 0 6px var(--focus-ring);
}
input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold);
  border: 3px solid var(--card);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 0 0 6px var(--focus-ring);
}

.small-input {
  margin-top: 8px;
  padding: 8px;
  width: 120px;
}
.hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.35;
}

.hidden {
  display: none !important;
}

/* Actions Row buttons */
.actions-row {
  display: flex;
  gap: 16px;
  margin-top: 24px;
}
.btn-primary {
  background: linear-gradient(180deg, var(--gold) 0%, #a67b25 100%);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.2px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(192, 147, 53, 0.2);
  transition: all 0.2s ease;
}
.btn-primary:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 14px rgba(192, 147, 53, 0.3);
}
.btn-primary:active {
  transform: translateY(0.5px);
}
.btn-primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--focus-ring);
}
.actions-row .btn-ghost {
  border: 1px solid var(--border-color);
  color: var(--navy);
  padding: 12px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
}
.actions-row .btn-ghost:hover {
  background: rgba(var(--gold-rgb), 0.05);
  border-color: rgba(var(--gold-rgb), 0.2);
  color: var(--gold);
}

/* Results Section Layout */
.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 24px;
  margin-bottom: 28px;
}
.summary-card {
  padding: 24px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.summary-card h3 {
  margin: 0 0 6px 0;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
}

/* Payroll Display List */
.payroll-list {
  display: flex;
  flex-direction: column;
}
.payroll-row {
  display: flex;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-color);
}
.payroll-label {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
}
.payroll-value {
  color: var(--navy);
  font-weight: 600;
  font-size: 0.88rem;
}
.payroll-row.payroll-net {
  border-bottom: none;
  border-top: 2px solid var(--navy);
  margin-top: 8px;
  padding-top: 14px;
}
.payroll-row.payroll-net .payroll-label {
  font-weight: 700;
  color: var(--navy);
}
.payroll-row.payroll-net .payroll-value {
  font-size: 1.1rem;
  color: var(--gold);
  font-weight: 800;
}

/* Outlook Hero Card */
.hero-card {
  background: linear-gradient(135deg, #0b2131 0%, #153c57 100%);
  padding: 20px 24px;
  border-radius: 12px;
  color: white;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 8px 20px rgba(11, 33, 49, 0.15);
}
body.dark .hero-card {
  background: linear-gradient(135deg, #11212c 0%, #1b3243 100%);
  border: 1px solid rgba(242, 209, 132, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.hero-primary {
  font-family: var(--font-heading);
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: -0.5px;
  line-height: 1.2;
}
.hero-secondary {
  font-size: 0.88rem;
  font-weight: 500;
  margin-top: 4px;
  opacity: 0.9;
  color: rgba(255, 255, 255, 0.85);
}
.summary-card p {
  margin: 0;
  font-size: 0.88rem;
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  color: var(--muted);
}
.summary-card p span {
  font-weight: 600;
  color: var(--navy);
}

/* Future Values Mini Grid */
.risk-grid-compact {
  display: flex;
  gap: 14px;
  margin: 20px 0 0 0;
}
.risk-grid-compact div {
  flex: 1;
  background: rgba(var(--gold-rgb), 0.04);
  border: 1px solid rgba(var(--gold-rgb), 0.12);
  padding: 14px;
  border-radius: 10px;
  text-align: center;
  transition: all 0.2s ease;
}
.risk-grid-compact div:hover {
  background: rgba(var(--gold-rgb), 0.08);
  transform: translateY(-1px);
}
.risk-grid-compact small {
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
  color: var(--muted);
  font-size: 0.7rem;
}
.fv {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--navy);
  margin-top: 4px;
  letter-spacing: -0.3px;
}
#fv-mid {
  color: var(--gold);
}

/* Charts Card Layout */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  margin-bottom: 28px;
}
.chart-card {
  padding: 24px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border-color);
  box-shadow: var(--card-shadow);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.chart-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px -8px rgba(11, 33, 49, 0.08);
}
.chart-card h4 {
  margin: 0 0 16px 0;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
}
.chart-card.chart-full canvas {
  width: 100% !important;
  height: 340px !important;
}
canvas {
  width: 100% !important;
  height: 240px !important;
}

/* Analysis Section Grid */
.analysis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.analysis-card {
  padding: 24px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border-color);
  box-shadow: var(--card-shadow);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.analysis-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px -8px rgba(11, 33, 49, 0.08);
}
.analysis-card h4 {
  margin: 0 0 12px 0;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
  border-bottom: 1.5px solid rgba(var(--gold-rgb), 0.2);
  padding-bottom: 6px;
}
.analysis-card div {
  font-size: 0.88rem;
  line-height: 1.5;
}

/* Footer styling */
.site-footer {
  padding: 24px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
  border-top: 1px solid var(--border-color);
  background: var(--card);
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Financial Advisor Recommendation Card */
.literacy-alert {
  padding: 16px;
  border-radius: 8px;
  margin-top: 4px;
  border-left: 4px solid transparent;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.literacy-alert h5 {
  margin: 0 0 4px 0;
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
}
.literacy-alert p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
  display: block;
  padding: 0;
}

.alert-success {
  background-color: rgba(39, 174, 96, 0.05);
  border-left-color: #27ae60;
}
.alert-success h5 { color: #219653; }

.alert-warning {
  background-color: rgba(243, 156, 18, 0.05);
  border-left-color: #f39c12;
}
.alert-warning h5 { color: #d35400; }

.alert-danger {
  background-color: rgba(231, 76, 60, 0.05);
  border-left-color: #e74c3c;
}
.alert-danger h5 { color: #c0392b; }

/* Responsive adjustments */
@media (max-width: 1100px) {
  .container {
    grid-template-columns: 1fr;
    padding: 0 16px;
    margin: 24px auto;
  }
  .summary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 650px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  .analysis-grid {
    grid-template-columns: 1fr;
  }
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
}

/* Roth vs Pre-Tax Custom Styling */
.roth-banner {
  padding: 16px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  border-left: 4px solid var(--gold);
}
.roth-banner.alert-pretax {
  background-color: rgba(11, 33, 49, 0.04);
  border-left-color: var(--navy);
}
body.dark .roth-banner.alert-pretax {
  background-color: rgba(241, 245, 249, 0.04);
  border-left-color: var(--navy);
}
.roth-banner.alert-roth {
  background-color: rgba(192, 147, 53, 0.04);
  border-left-color: var(--gold);
}
.roth-banner.alert-diversification {
  background-color: rgba(142, 68, 173, 0.04);
  border-left-color: var(--accent);
}
.roth-banner h5 {
  margin: 0 0 6px 0;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
}
.roth-banner p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--muted);
}
.roth-banner .action-plan {
  margin-top: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--navy);
}

.roth-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}
.roth-stat-card {
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}
.roth-stat-card .stat-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
}
.roth-stat-card .stat-value {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--navy);
}
.roth-stat-card .stat-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}

@media (max-width: 650px) {
  .roth-stats-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================
   Inputs Restructuring & Floating Bar
   ========================= */
.sub-card {
  background: var(--card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--card-shadow);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.sub-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px -8px rgba(11, 33, 49, 0.08);
}
.sub-card h3 {
  margin: 0 0 20px 0;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1.5px solid rgba(192, 147, 53, 0.2);
  padding-bottom: 8px;
}
.actions-card {
  background: var(--card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--card-shadow);
  margin-bottom: 24px;
}
.mobile-floating-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card);
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -8px 32px rgba(11, 33, 49, 0.1);
  padding: 12px 24px;
  z-index: 1000;
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}
.floating-bar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 600px;
  margin: 0 auto;
  gap: 16px;
}
.floating-bar-info {
  display: flex;
  flex-direction: column;
}
.floating-bar-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 2px;
}
.floating-bar-val {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
}

/* ==========================================
   Mobile-First Optimization (Viewport <= 580px)
   ========================================== */
@media (max-width: 580px) {
  /* 1. Reduce container and card padding to maximize readable space */
  .container {
    margin: 16px auto;
    padding: 0 12px;
  }
  
  .card, .sub-card, .actions-card, .summary-card {
    padding: 16px 14px;
    border-radius: 12px;
  }

  /* 2. Scale down typography to fit small screens */
  .brand-text h1 {
    font-size: 1.15rem;
  }
  
  .hero-primary {
    font-size: 1.75rem;
  }
  
  .hero-card {
    padding: 16px;
  }

  /* 3. Stack action buttons vertically instead of forcing them side-by-side */
  .actions-row {
    flex-direction: column;
    gap: 12px;
  }
  
  .actions-row button, .actions-row .btn-ghost {
    width: 100%;
    padding: 12px;
    text-align: center;
  }

  /* 4. Let the nominal/real return cards wrap when horizontal space is tight */
  .risk-grid-compact {
    flex-direction: column;
    gap: 10px;
  }
  
  .risk-grid-compact div {
    padding: 10px 12px;
  }
  
  .fv {
    font-size: 1.25rem;
  }

  /* 5. Adjust chart heights so they fit on the screen without massive scrolling */
  .chart-card.chart-full canvas {
    height: 220px !important;
  }
  
  canvas {
    height: 180px !important;
  }

  /* 6. Improve form element density */
  .form-grid {
    gap: 12px;
  }
  
  input[type="text"], input[type="number"], input[type="date"], select {
    padding: 9px 12px;
    font-size: 0.9rem;
  }

  /* 7. Morningstar lookup scaling */
  .form-group.full div[style*="display: flex"] {
    flex-direction: column;
    align-items: stretch !important;
    gap: 10px !important;
  }
  
  #lookupBtn {
    width: 100%;
  }

  /* 8. Header actions wrapping and scaling */
  .header-actions {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 12px;
  }
  
  .header-actions .btn-ghost {
    padding: 6px 10px;
    font-size: 0.8rem;
  }
}

/* ==========================================
   PDF Print Template Styles
   ========================================== */
#pdfPrintTemplate {
  display: none; /* Hidden on-screen */
}

/* Offscreen container for rendering template prior to print capture */
.pdf-print-rendering {
  position: absolute !important;
  left: -9999px !important;
  top: 0 !important;
  display: block !important;
  z-index: -9999 !important;
}

.pdf-page {
  width: 794px;
  height: 1123px;
  padding: 45px;
  box-sizing: border-box;
  background: #ffffff !important;
  color: #0b2131 !important;
  font-family: 'Inter', sans-serif;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.pdf-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #c09335;
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.pdf-header-row img {
  width: 90px;
  height: auto;
}

.pdf-header-info {
  text-align: right;
  font-size: 0.76rem;
  line-height: 1.4;
  color: #566b7a;
}

.pdf-header-info strong {
  color: #0b2131;
  font-size: 0.85rem;
}

.pdf-title-row {
  margin-bottom: 18px;
}

.pdf-title-row h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: #0b2131;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pdf-title-row p {
  font-size: 0.8rem;
  color: #c09335;
  margin: 4px 0 0 0;
  font-weight: 600;
}

.pdf-client-box {
  background: rgba(11, 33, 49, 0.02);
  border: 1px solid rgba(11, 33, 49, 0.05);
  border-radius: 8px;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  font-size: 0.8rem;
}

.pdf-client-box div span {
  font-weight: 700;
  color: #0b2131;
}

.pdf-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 15px;
}

.pdf-section-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #c09335;
  border-bottom: 1.5px solid rgba(192, 147, 53, 0.2);
  padding-bottom: 5px;
  margin: 0 0 10px 0;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.pdf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  margin-bottom: 10px;
}

.pdf-table tr {
  border-bottom: 1px solid rgba(11, 33, 49, 0.04);
}

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

.pdf-table td {
  padding: 6px 0;
  line-height: 1.3;
}

.pdf-table td.val {
  text-align: right;
  font-weight: 700;
  color: #0b2131;
}

.pdf-table td.lbl {
  color: #566b7a;
}

.pdf-payroll-highlight {
  border-top: 1.5px solid #0b2131 !important;
  font-weight: 700;
}
.pdf-payroll-highlight td.val {
  color: #c09335;
  font-size: 0.85rem;
}

.pdf-outlook-hero {
  background: #0b2131;
  color: white;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(11, 33, 49, 0.05);
}

.pdf-hero-primary {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: #c09335;
  line-height: 1.1;
}

.pdf-hero-secondary {
  font-size: 0.78rem;
  margin-top: 4px;
  opacity: 0.85;
}

.pdf-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(11, 33, 49, 0.05);
  padding-top: 8px;
  font-size: 0.68rem;
  color: #94a3b8;
}

.pdf-charts-row {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 15px;
  margin-bottom: 30px;
}

.pdf-chart-container, .pdf-table-container {
  border: 1px solid rgba(11, 33, 49, 0.05);
  border-radius: 8px;
  padding: 12px 12px 20px 12px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  height: 235px;
  box-sizing: border-box;
}

.pdf-chart-container {
  align-items: center;
}

.pdf-table-container {
  align-items: flex-start;
}

.pdf-chart-container h4 {
  font-size: 0.8rem;
  margin: 0 0 8px 0;
  font-family: 'Outfit', sans-serif;
  color: #0b2131;
  text-align: left;
  width: 100%;
}

.pdf-print-banner {
  padding: 12px 16px;
  border-radius: 8px;
  border-left: 4px solid #c09335;
  background: rgba(192, 147, 53, 0.02);
  margin-bottom: 24px;
}

.pdf-print-banner h5 {
  margin: 0 0 3px 0;
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  color: #0b2131;
}

.pdf-print-banner p {
  margin: 0;
  font-size: 0.75rem;
  color: #566b7a;
  line-height: 1.35;
}

.pdf-print-banner .action {
  font-weight: 700;
  margin-top: 4px;
  font-size: 0.75rem;
  color: #0b2131;
}

.pdf-ss-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 8px 0 0 0;
}

.pdf-ss-list li {
  background: rgba(11, 33, 49, 0.02);
  border: 1px solid rgba(11, 33, 49, 0.03);
  border-radius: 6px;
  padding: 6px;
  text-align: center;
  font-size: 0.72rem;
  line-height: 1.3;
}

.pdf-ss-list li.active {
  border-color: #c09335;
  background: rgba(192, 147, 53, 0.03);
  font-weight: 700;
  color: #c09335;
}

/* =========================
   Custom Range Sliders
   ========================= */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #e2e8f0;
  outline: none;
  margin: 12px 0 8px 0;
  transition: background 0.3s ease;
}
body.dark input[type="range"] {
  background: rgba(255, 255, 255, 0.1);
}

/* Chrome, Safari, Opera, Edge */
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
  border: 2px solid var(--card);
  box-shadow: 0 2px 6px rgba(11, 33, 49, 0.25);
  transition: transform 0.1s ease, background-color 0.2s ease;
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}
input[type="range"]::-webkit-slider-thumb:active {
  transform: scale(1.1);
  background: var(--navy);
}

/* Firefox */
input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
  border: 2px solid var(--card);
  box-shadow: 0 2px 6px rgba(11, 33, 49, 0.25);
  transition: transform 0.1s ease, background-color 0.2s ease;
}
input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.2);
}
input[type="range"]::-moz-range-thumb:active {
  transform: scale(1.1);
  background: var(--navy);
}

/* Focus styles */
input[type="range"]:focus::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px var(--focus-ring), 0 2px 6px rgba(11, 33, 49, 0.25);
}
input[type="range"]:focus::-moz-range-thumb {
  box-shadow: 0 0 0 4px var(--focus-ring), 0 2px 6px rgba(11, 33, 49, 0.25);
}

/* =========================
   PDF Template Styles Polish
   ========================= */
.pdf-disclaimer-banner {
  margin-top: 18px;
  padding: 10px 14px;
  border: 1px dashed rgba(11, 33, 49, 0.15);
  border-radius: 6px;
  background: rgba(11, 33, 49, 0.01) !important;
  font-size: 0.65rem !important;
  color: #566b7a !important;
  line-height: 1.4 !important;
  text-align: justify;
}

.pdf-signature-section {
  margin-top: 25px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  font-size: 0.72rem;
  color: #0b2131;
}

.pdf-signature-section .sig-line {
  display: flex;
  flex-direction: column;
}

.pdf-signature-section .sig-line .line {
  border-bottom: 1px solid #0b2131;
  height: 30px;
  margin-bottom: 6px;
}

.pdf-signature-section .sig-line .labels {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  color: #566b7a;
}

/* ==========================================
   Macroeconomic Insights Dashboard Styles
   ========================================== */
.nav-outlook-btn:hover {
  color: var(--gold) !important;
  background: rgba(192, 147, 53, 0.08) !important;
  border-color: var(--gold) !important;
}

.macro-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}

.macro-card {
  background: var(--card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--card-shadow);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.macro-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px -8px rgba(11, 33, 49, 0.08);
}

.macro-card h3 {
  margin: 0 0 16px 0;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.macro-flex {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.macro-value {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
}

.macro-trend {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
}

.trend-up {
  color: #27ae60;
  background: rgba(39, 174, 96, 0.08);
}

.trend-down {
  color: #eb5757;
  background: rgba(235, 87, 87, 0.08);
}

.trend-neutral {
  color: var(--muted);
  background: rgba(var(--navy-rgb), 0.04);
}

.macro-desc {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.4;
}

/* 2-Column Gauge & Chart Layout */
.macro-details-grid {
  display: grid;
  grid-template-columns: 1fr 1.8fr;
  gap: 28px;
  margin-bottom: 28px;
}

.gauges-card {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.gauge-row {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--card);
  border: 1px solid var(--border-color);
  padding: 16px 20px;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
}

.gauge-circle-wrap {
  position: relative;
  width: 70px;
  height: 70px;
}

.gauge-circle-wrap svg {
  width: 70px;
  height: 70px;
  transform: rotate(-90deg);
}

.gauge-bg {
  fill: none;
  stroke: rgba(var(--gold-rgb), 0.08);
  stroke-width: 6px;
}

.gauge-fill {
  fill: none;
  stroke: var(--gold);
  stroke-dasharray: 201; /* circumference of r=32 circle is 2*pi*32 = 201 */
  stroke-width: 6px;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.gauge-text {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 800;
  color: var(--navy);
}

.gauge-info {
  display: flex;
  flex-direction: column;
}

.gauge-info h4 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--navy);
}

.gauge-info p {
  margin: 4px 0 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}

/* Economic Table styling */
.outlook-table-card {
  margin-top: 32px;
}

.outlook-table-card h3 {
  margin: 0 0 20px 0;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--navy);
  border-bottom: 2px solid rgba(var(--gold-rgb), 0.2);
  padding-bottom: 8px;
}

.outlook-table-wrapper {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

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

.outlook-table th, .outlook-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.outlook-table th {
  background: rgba(var(--navy-rgb), 0.02);
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.8px;
}

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

.outlook-table td.num {
  text-align: right;
  font-weight: 600;
}

.outlook-table td.lbl {
  color: var(--navy);
  font-weight: 600;
}

@media (max-width: 1100px) {
  .macro-grid {
    grid-template-columns: 1fr;
  }
  .macro-details-grid {
    grid-template-columns: 1fr;
  }
}

/* Tabbed Header Navigation */
.nav-tab {
  border: none !important;
  background: transparent !important;
  color: rgba(255, 255, 255, 0.7) !important;
  padding: 8px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  border-radius: 6px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-tab:hover {
  color: white !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

.nav-tab.active {
  color: var(--gold) !important;
  border-bottom: 2.5px solid var(--gold) !important;
  border-radius: 0 !important;
  background: transparent !important;
}

/* Sub-Tabs Navigation inside Outlook Page */
.sub-tabs-bar {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0;
  margin: 24px 0;
}

.sub-tab {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 10px 16px;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px; /* overlap border-bottom */
}

.sub-tab:hover {
  color: var(--navy);
  background: rgba(var(--gold-rgb), 0.05);
  border-radius: 6px 6px 0 0;
}

.sub-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
  font-weight: 700;
}

/* 6-Feed News Grid & Scrollable Box Styles */
.rss-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 20px;
}

.rss-box {
  background: var(--card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--card-shadow);
  height: 520px;
  overflow-y: auto;
  transition: transform 0.2s ease;
}

.rss-box:hover {
  transform: translateY(-1px);
}

.rss-box h3 {
  margin: 0 0 16px 0;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  border-bottom: 1.5px solid rgba(var(--gold-rgb), 0.2);
  padding-bottom: 8px;
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 10;
}

.rss-item {
  margin: 0 0 16px 0;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--border-color);
}

.rss-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.rss-item a {
  color: var(--navy);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  line-height: 1.4;
  display: inline-block;
  transition: color 0.15s ease;
}

.rss-item a:hover {
  color: var(--gold);
  text-decoration: none;
}

.rss-item small {
  display: block;
  font-size: 0.74rem;
  color: var(--muted);
  margin-top: 6px;
}

/* Elegant Scrollbars for RSS boxes */
.rss-box::-webkit-scrollbar {
  width: 6px;
}

.rss-box::-webkit-scrollbar-track {
  background: transparent;
}

.rss-box::-webkit-scrollbar-thumb {
  background: rgba(var(--navy-rgb), 0.12);
  border-radius: 3px;
}

.rss-box::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--gold-rgb), 0.5);
}

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

@media (max-width: 700px) {
  .rss-grid {
    grid-template-columns: 1fr;
  }
  .sub-tabs-bar {
    flex-direction: column;
    align-items: stretch;
    border-bottom: none;
  }
  .sub-tab {
    border-bottom: none;
    border-left: 3px solid transparent;
    margin-bottom: 0;
    text-align: left;
    padding: 8px 12px;
  }
  .sub-tab.active {
    border-left-color: var(--gold);
    background: rgba(var(--gold-rgb), 0.04);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

#indicatorsPanel, #newsPanel {
  min-width: 0;
  width: 100%;
}

/* Premium Infinite Scrolling Ticker */
.ticker-wrap {
  width: 100%;
  overflow: hidden;
  height: 46px;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  margin-bottom: 24px;
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker-scroll 30s linear infinite;
}

.ticker-track:hover {
  animation-play-state: paused;
}

.ticker-items {
  display: flex;
  align-items: center;
  gap: 40px;
  padding-right: 40px;
}

.ticker-item {
  white-space: nowrap;
  font-size: 0.95rem;
  font-weight: 600;
  color: #e6edf3;
  font-family: var(--font-heading);
}

@keyframes ticker-scroll {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-50%, 0, 0);
  }
}

.hidden {
  display: none !important;
}




