/* ===========================
   Retirement Planning App Styles
   =========================== */

/* Import Modern Font */
/* Import Modern Font - Moved to HTML for performance */

/* ===========================
   CSS Variables & Design System
   =========================== */
:root {
  /* Color Palette */
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --accent-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);

  --bg-primary: #f5f7fa;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: rgba(255, 255, 255, 1);

  --text-primary: #1a1a2e;
  --text-secondary: #2d3748;
  --text-muted: #4a5568;

  --border-color: rgba(0, 0, 0, 0.1);
  --border-focus: rgba(102, 126, 234, 0.5);

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 40px rgba(102, 126, 234, 0.3);

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* ===========================
   Reset & Base Styles
   =========================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Animated Background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.08) 0%, transparent 50%);
  z-index: -1;
  animation: backgroundPulse 15s ease-in-out infinite;
  will-change: opacity;
  transform: translateZ(0);
}

@keyframes backgroundPulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* ===========================
   Layout
   =========================== */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--spacing-lg);
}

/* ===========================
   Header
   =========================== */
.header {
  text-align: center;
  padding: var(--spacing-xl) 0;
  margin-bottom: var(--spacing-lg);
}

.header h1 {
  font-size: 3rem;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--spacing-sm);
  animation: fadeInDown 0.8s ease;
}

.header p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  font-weight: 300;
  animation: fadeInUp 0.8s ease;
}

/* ===========================
   Cards
   =========================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
  animation: fadeIn 0.6s ease;
  transform: translateZ(0);
}

.card:hover {
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px) translateZ(0);
  will-change: transform, box-shadow;
}

.card-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.card-icon {
  font-size: 1.5rem;
}

/* ===========================
   Form Elements
   =========================== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.875rem 1rem;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--border-focus);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input:hover,
.form-group select:hover {
  border-color: rgba(0, 0, 0, 0.2);
}

/* Input with prefix (for currency) */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-prefix {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  pointer-events: none;
}

.input-wrapper input {
  padding-left: 2rem;
}

.input-suffix {
  position: absolute;
  right: 1rem;
  color: var(--text-muted);
  pointer-events: none;
}

.input-wrapper.has-suffix input {
  padding-right: 2.5rem;
}

/* Radio Group */
.radio-group {
  display: flex;
  gap: var(--spacing-md);
  padding: var(--spacing-sm) 0;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  cursor: pointer;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.radio-option:hover {
  background: rgba(102, 126, 234, 0.05);
}

.radio-option input[type="radio"] {
  width: auto;
  cursor: pointer;
  accent-color: #667eea;
}

.radio-option label {
  cursor: pointer;
  margin: 0;
}

/* ===========================
   Buttons
   =========================== */
.btn {
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  justify-content: center;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary-gradient);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px) translateZ(0);
  will-change: transform, box-shadow;
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(102, 126, 234, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(102, 126, 234, 0.15);
  border-color: rgba(102, 126, 234, 0.3);
}

.btn-success {
  background: var(--accent-gradient);
  color: #064e3b;
  box-shadow: var(--shadow-md);
}

.btn-success:hover {
  box-shadow: 0 0 40px rgba(67, 233, 123, 0.3);
  transform: translateY(-2px) translateZ(0);
  will-change: transform, box-shadow;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.button-group {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

/* ===========================
   Results Section
   =========================== */
.results-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.summary-card {
  background: rgba(102, 126, 234, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  text-align: center;
  transition: all var(--transition-normal);
}

.summary-card:hover {
  background: rgba(102, 126, 234, 0.08);
  transform: translateY(-2px);
}

.summary-card h3 {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--spacing-xs);
}

.summary-card .value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #0284c7;
}

.summary-card.warning .value {
  color: #d946ef;
}

/* ===========================
   Retirement Assessment Banner
   =========================== */
.assessment-banner {
  padding: var(--spacing-lg);
  border-radius: var(--radius-lg);
  margin-bottom: var(--spacing-lg);
  border: 2px solid;
  animation: fadeIn 0.6s ease;
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  box-shadow: var(--shadow-md);
}

.assessment-banner .icon {
  font-size: 3rem;
  flex-shrink: 0;
}

.assessment-banner .content {
  flex: 1;
}

.assessment-banner h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--spacing-xs);
}

.assessment-banner p {
  font-size: 1rem;
  line-height: 1.5;
  opacity: 0.9;
}

.assessment-banner.excellent {
  background: linear-gradient(135deg, rgba(67, 233, 123, 0.15) 0%, rgba(56, 249, 215, 0.15) 100%);
  border-color: #43e97b;
  color: #1a5f3a;
}

.assessment-banner.excellent .icon {
  color: #43e97b;
}

.assessment-banner.good {
  background: linear-gradient(135deg, rgba(79, 172, 254, 0.15) 0%, rgba(0, 242, 254, 0.15) 100%);
  border-color: #4facfe;
  color: #1a4a6f;
}

.assessment-banner.good .icon {
  color: #4facfe;
}

.assessment-banner.caution {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.15) 0%, rgba(255, 152, 0, 0.15) 100%);
  border-color: #ffc107;
  color: #7a5000;
}

.assessment-banner.caution .icon {
  color: #ffc107;
}

.assessment-banner.critical {
  background: linear-gradient(135deg, rgba(245, 87, 108, 0.15) 0%, rgba(240, 93, 251, 0.15) 100%);
  border-color: #f5576c;
  color: #7a1f2e;
}

.assessment-banner.critical .icon {
  color: #f5576c;
}

.assessment-details {
  margin-top: var(--spacing-sm);
  padding-top: var(--spacing-sm);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 0.9rem;
}

.assessment-details ul {
  margin: var(--spacing-xs) 0 0 var(--spacing-md);
  padding: 0;
}

.assessment-details li {
  margin-bottom: var(--spacing-xs);
}

/* ===========================
   Sequence Risk Heatmap
   =========================== */
.heatmap-container {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: var(--spacing-md) 0;
}

.heatmap-block {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  cursor: help;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.heatmap-block:hover {
  transform: scale(1.4);
  box-shadow: var(--shadow-sm);
  z-index: 10;
}

.heatmap-legend {
  display: flex;
  gap: var(--spacing-md);
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: var(--spacing-sm);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.legend-box {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}


/* ===========================
   Table
   =========================== */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

thead {
  background: rgba(102, 126, 234, 0.1);
  position: sticky;
  top: 0;
  z-index: 10;
}

thead th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition-fast);
}

tbody tr:hover {
  background: rgba(102, 126, 234, 0.05);
}

tbody tr.retirement-start {
  background: rgba(102, 126, 234, 0.1);
  font-weight: 600;
}

tbody tr.balance-depleted {
  background: rgba(245, 87, 108, 0.1);
  color: #f5576c;
}

tbody td {
  padding: 0.875rem 1rem;
}

.positive {
  color: #16a34a;
  font-weight: 600;
}

.negative {
  color: #e11d48;
  font-weight: 600;
}

/* ===========================
   Utilities
   =========================== */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-muted);
}

.mb-0 {
  margin-bottom: 0;
}

.mb-1 {
  margin-bottom: var(--spacing-sm);
}

.mb-2 {
  margin-bottom: var(--spacing-md);
}

.mb-3 {
  margin-bottom: var(--spacing-lg);
}

.mt-0 {
  margin-top: 0;
}

.mt-1 {
  margin-top: var(--spacing-sm);
}

.mt-2 {
  margin-top: var(--spacing-md);
}

.mt-3 {
  margin-top: var(--spacing-lg);
}

/* ===========================
   Animations
   =========================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 768px) {
  .header h1 {
    font-size: 2rem;
  }

  .header p {
    font-size: 1rem;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .results-summary {
    grid-template-columns: 1fr;
  }

  .button-group {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  /* Stack radio buttons vertically on mobile */
  .radio-group {
    flex-direction: column;
    gap: var(--spacing-sm);
  }

  .radio-option {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(102, 126, 234, 0.03);
    border-radius: var(--radius-sm);
  }

  .radio-option label {
    flex: 1;
    word-wrap: break-word;
  }

  table {
    font-size: 0.85rem;
  }

  thead th,
  tbody td {
    padding: 0.75rem 0.5rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: var(--spacing-sm);
  }

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

  .header h1 {
    font-size: 1.75rem;
  }
}

/* ===========================
   Loading State
   =========================== */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

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

/* ===========================
   Tooltips
   =========================== */
.tooltip {
  position: relative;
  display: inline-block;
  cursor: help;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.tooltip:hover::after,
.tooltip:focus::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: var(--spacing-xs) var(--spacing-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  font-size: 0.85rem;
  z-index: 1000;
  margin-bottom: 5px;
  box-shadow: var(--shadow-md);
}

/* ===========================
   PDF Export Styles
   =========================== */
.pdf-export-mode {
  background: #fff !important;
  color: #111 !important;
}

.pdf-export-mode .card {
  background: #fff !important;
  border: 1px solid #222 !important;
  box-shadow: none !important;
  margin-bottom: 20px !important;
  break-inside: avoid;
  page-break-inside: avoid;
}

.pdf-export-mode .card-header h2 {
  background: none !important;
  -webkit-text-fill-color: initial !important;
  color: #111 !important;
}

.pdf-export-mode .assessment-banner {
  box-shadow: none !important;
  border: 1px solid #222 !important;
  background: #fff !important;
  color: #111 !important;
}

.pdf-export-mode .summary-card {
  background: #fff !important;
  border: 1px solid #222 !important;
  box-shadow: none !important;
  break-inside: avoid;
  page-break-inside: avoid;
}

.pdf-export-mode .summary-card .value {
  background: none !important;
  -webkit-text-fill-color: initial !important;
  color: #111 !important;
}

.pdf-export-mode table {
  font-size: 11pt !important;
  color: #111 !important;
  background: #fff !important;
  border-collapse: collapse !important;
}

.pdf-export-mode th,
.pdf-export-mode td {
  color: #111 !important;
  background: #fff !important;
  border: 1px solid #222 !important;
  padding: 4px 6px !important;
}

.pdf-export-mode th {
  background-color: #e0e0e0 !important;
  color: #111 !important;
  border-bottom: 2px solid #222 !important;
}

.pdf-export-mode tr.retirement-start {
  background-color: #d0eaff !important;
}

.pdf-export-mode tr.balance-depleted {
  background-color: #ffd6d6 !important;
  color: #b20000 !important;
}

.pdf-export-mode .button-group {
  display: none !important;
}

/* Force page breaks for cards and tables */
.pdf-export-mode .card,
.pdf-export-mode table {
  page-break-inside: avoid;
  break-inside: avoid;
}

.pdf-export-mode tr {
  page-break-inside: avoid;
  break-inside: avoid;
}

/* ===========================
   Footer & Expandable Terms Styles
   =========================== */
.footer {
  margin-top: var(--spacing-xl);
  padding: var(--spacing-lg) 0 var(--spacing-xl) 0;
  border-top: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.8);
  transform: translateZ(0);
}

.terms-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

.copyright {
  text-align: center;
  margin-top: var(--spacing-lg);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--border-color);
}

.copyright p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.terms-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md) var(--spacing-lg);
  background: rgba(102, 126, 234, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-normal);
  font-family: inherit;
}

.terms-toggle:hover {
  background: rgba(102, 126, 234, 0.1);
  border-color: rgba(102, 126, 234, 0.3);
  color: var(--text-primary);
  transform: translateY(-2px) translateZ(0);
  box-shadow: var(--shadow-sm);
  will-change: transform;
}

.terms-toggle-icon {
  font-size: 1.2rem;
}

.terms-toggle-text {
  flex: 1;
}

.terms-toggle-arrow {
  font-size: 0.8rem;
  transition: transform var(--transition-normal);
}

.terms-toggle[aria-expanded="true"] .terms-toggle-arrow {
  transform: rotate(180deg);
}

.terms-collapsible {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out;
}

.terms-collapsible.active {
  max-height: 2000px;
  transition: max-height 0.5s ease-in;
}

.terms-inner {
  padding: var(--spacing-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  margin-top: -1px;
}

.terms-title {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin: 0 0 var(--spacing-lg) 0;
  padding-bottom: var(--spacing-md);
  border-bottom: 2px solid var(--border-color);
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.terms-title-icon {
  font-size: 2rem;
  filter: grayscale(0);
}

.terms-section-inline {
  display: flex;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  background: rgba(102, 126, 234, 0.03);
  border-radius: var(--radius-md);
  border-left: 4px solid rgba(102, 126, 234, 0.3);
  transition: all var(--transition-normal);
}

.terms-section-inline:hover {
  background: rgba(102, 126, 234, 0.08);
  border-left-color: rgba(102, 126, 234, 0.5);
  transform: translateX(4px);
}

.terms-icon-inline {
  font-size: 1.8rem;
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(102, 126, 234, 0.1);
  border-radius: var(--radius-sm);
}

.terms-text-inline {
  flex: 1;
}

.terms-text-inline h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--spacing-xs) 0;
}

.terms-text-inline p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

.terms-agreement-inline {
  text-align: center;
  padding: var(--spacing-md);
  background: rgba(102, 126, 234, 0.05);
  border-radius: var(--radius-md);
  border: 2px dashed rgba(102, 126, 234, 0.3);
  margin-top: var(--spacing-md);
}

.terms-agreement-inline p {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

/* ===========================
   Tab Navigation Styles
   =========================== */
.tabs-container {
  margin-bottom: var(--spacing-lg);
}

.tabs-nav {
  display: flex;
  gap: var(--spacing-xs);
  border-bottom: 2px solid var(--border-color);
  margin-bottom: var(--spacing-lg);
  overflow-x: auto;
  scrollbar-width: thin;
}

.tabs-nav::-webkit-scrollbar {
  height: 4px;
}

.tabs-nav::-webkit-scrollbar-track {
  background: transparent;
}

.tabs-nav::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

.tab-btn {
  background: transparent;
  border: none;
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  border-bottom: 3px solid transparent;
  transition: all var(--transition-fast);
  white-space: nowrap;
  font-family: inherit;
  position: relative;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(102, 126, 234, 0.05);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.tab-btn.active {
  color: #667eea;
  border-bottom-color: #667eea;
  font-weight: 600;
}

.tab-icon {
  font-size: 1.2rem;
}

.badge {
  font-size: 0.65rem;
  padding: 0.2rem 0.5rem;
  background: var(--primary-gradient);
  color: white;
  border-radius: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 0.25rem;
}

/* Tab Panels */
.tabs-content {
  position: relative;
  min-height: 200px;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-panel.active {
  display: block;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: calc(var(--spacing-xl) * 2) var(--spacing-lg);
  color: var(--text-secondary);
}

.empty-icon {
  font-size: 4rem;
  display: block;
  margin-bottom: var(--spacing-md);
  opacity: 0.4;
  filter: grayscale(20%);
}

.empty-state h3 {
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
  font-size: 1.5rem;
  font-weight: 600;
}

.empty-state p {
  font-size: 1rem;
  opacity: 0.8;
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ===========================
   Advanced Options Accordion
   =========================== */
.advanced-options-card {
  border: 2px dashed var(--border-color);
  background: rgba(102, 126, 234, 0.02);
  margin-bottom: var(--spacing-lg);
}

.advanced-toggle {
  width: 100%;
  background: transparent;
  border: none;
  padding: var(--spacing-md);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: all var(--transition-fast);
  font-family: inherit;
}

.advanced-toggle:hover {
  background: rgba(102, 126, 234, 0.05);
  border-radius: var(--radius-md);
}

.toggle-icon {
  font-size: 1.3rem;
}

.toggle-text {
  flex: 1;
  text-align: left;
}

.pill-optional {
  font-size: 0.7rem;
  padding: 0.25rem 0.75rem;
  background: rgba(102, 126, 234, 0.15);
  color: #667eea;
  border-radius: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.toggle-arrow {
  font-size: 0.9rem;
  transition: transform var(--transition-normal);
  display: inline-block;
}

.toggle-arrow.expanded {
  transform: rotate(180deg);
}

.advanced-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out, padding 0.4s ease-out;
}

.advanced-content.expanded {
  max-height: 2000px;
  padding: 0 var(--spacing-md) var(--spacing-md);
}

/* Checkbox Labels */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  margin-bottom: var(--spacing-sm);
  color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #667eea;
}

.checkbox-label:hover {
  color: #667eea;
}

/* Conditional Inputs */
.conditional-inputs {
  margin-top: var(--spacing-sm);
  padding-left: 2rem;
  animation: fadeIn 0.3s ease;
}

.conditional-inputs label {
  margin-top: var(--spacing-sm);
  font-size: 0.9rem;
}

/* ===========================
   Charts Styling
   =========================== */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: var(--spacing-lg);
  margin-top: var(--spacing-md);
}

.chart-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.chart-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.chart-title {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-md);
}

.chart-icon {
  font-size: 1.5rem;
}

.chart-container {
  position: relative;
  height: 300px;
  width: 100%;
}

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

/* Responsive terms */
@media (max-width: 768px) {
  .terms-container {
    padding: 0 var(--spacing-sm);
  }

  .terms-toggle {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.9rem;
  }

  .terms-inner {
    padding: var(--spacing-md);
  }

  .terms-title {
    font-size: 1.25rem;
    flex-direction: column;
    text-align: center;
  }

  .terms-section-inline {
    flex-direction: column;
    text-align: center;
    padding: var(--spacing-sm);
  }

  .terms-icon-inline {
    margin: 0 auto;
  }

  /* Charts responsive */
  .charts-grid {
    grid-template-columns: 1fr;
  }

  .chart-container {
    height: 250px;
  }

  .funded-detail-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  .valley-stat-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  .tax-insight-container {
    grid-template-columns: 1fr !important;
  }
}

/* ===========================
   Funded Ratio Dashboard
   =========================== */
.funded-ratio-dashboard {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.funded-ratio-hero {
  text-align: center;
  padding: 1.5rem 0;
}

.funded-gauge-container {
  max-width: 600px;
  margin: 0 auto 1.5rem;
}

.funded-gauge-track {
  position: relative;
  height: 28px;
  background: #f1f5f9;
  border-radius: 14px;
  overflow: visible;
  border: 2px solid #e2e8f0;
}

.funded-gauge-fill {
  height: 100%;
  border-radius: 12px;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.funded-gauge-markers {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
}

.gauge-marker {
  position: absolute;
  top: -6px;
  bottom: -6px;
  width: 2px;
  background: #94a3b8;
  transform: translateX(-50%);
}

.gauge-marker::after {
  content: attr(data-label);
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
}

.gauge-marker.sweet-spot-start,
.gauge-marker.sweet-spot-end {
  background: #10b981;
  width: 2px;
}

.funded-gauge-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 500;
}

.funded-ratio-value {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
  margin-top: 0.5rem;
}

.funded-status-label {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: white;
  padding: 0.25rem 1rem;
  border-radius: 20px;
  margin-left: 0.75rem;
  vertical-align: middle;
}

.funded-ratio-details {
  padding: 0;
}

.funded-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.funded-detail-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
  transition: all var(--transition-fast);
}

.funded-detail-card:hover {
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.funded-detail-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: #64748b;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.funded-detail-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.funded-ratio-insight {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 226, 0.05));
  border: 1px solid rgba(102, 126, 234, 0.2);
  border-radius: var(--radius-md);
  align-items: flex-start;
}

.insight-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.insight-content h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
}

.insight-content p {
  font-size: 0.95rem;
  color: #475569;
  line-height: 1.6;
  margin: 0;
}

/* ===========================
   Die With Zero Optimizer Dashboard
   =========================== */
.dwz-dashboard {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.dwz-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  padding: 1.5rem 0;
  flex-wrap: wrap;
}

.dwz-hero-spending {
  text-align: center;
}

.dwz-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

.dwz-optimal-value {
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.dwz-monthly {
  font-size: 1rem;
  color: #94a3b8;
  font-weight: 500;
  margin-top: 0.25rem;
}

.dwz-delta-container {
  text-align: center;
}

.dwz-delta-badge {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  border-radius: 24px;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.dwz-delta-badge.dwz-positive {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1.5px solid rgba(16, 185, 129, 0.3);
}

.dwz-delta-badge.dwz-negative {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1.5px solid rgba(239, 68, 68, 0.25);
}

.dwz-delta-badge.dwz-neutral {
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
  border: 1.5px solid rgba(102, 126, 234, 0.25);
}

.dwz-status-label {
  font-size: 0.9rem;
  font-weight: 700;
  margin-top: 0.5rem;
  color: var(--text-primary);
}

.dwz-vs {
  font-size: 0.82rem;
  color: #94a3b8;
  margin-top: 0.15rem;
}

/* Fulfillment Score gauge */
.dwz-gauge-section {
  text-align: center;
  padding: 0.5rem 0;
}

.dwz-gauge-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.dwz-gauge-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 500px;
  margin: 0 auto;
}

.dwz-gauge-track {
  flex: 1;
  height: 22px;
  background: #f1f5f9;
  border-radius: 11px;
  overflow: hidden;
  border: 2px solid #e2e8f0;
}

.dwz-gauge-fill {
  height: 100%;
  border-radius: 9px;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.dwz-gauge-value {
  font-size: 1.6rem;
  font-weight: 800;
  min-width: 80px;
}

.dwz-gauge-hint {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 0.35rem;
}

/* Detail Grid */
.dwz-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.dwz-detail-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
  transition: all var(--transition-fast);
}

.dwz-detail-card:hover {
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.dwz-detail-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: #64748b;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dwz-detail-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Insight box — reuses .insight-icon / .insight-content from funded ratio */
.dwz-insight {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 226, 0.05));
  border: 1px solid rgba(102, 126, 234, 0.2);
  border-radius: var(--radius-md);
  align-items: flex-start;
}

/* Responsive DWZ */
@media (max-width: 768px) {
  .dwz-hero {
    flex-direction: column;
    gap: 1rem;
  }

  .dwz-optimal-value {
    font-size: 2.2rem;
  }

  .dwz-detail-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  .dwz-gauge-container {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* ===========================
   Tax Valley Timeline & Analyzer
   =========================== */
.tax-valley-section {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.tax-valley-hero {
  padding: 0.5rem 0;
}

.valley-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.valley-stat {
  text-align: center;
  padding: 1.25rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.valley-stat:hover {
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.valley-stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.valley-stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

.valley-stat-detail {
  font-size: 0.78rem;
  color: #94a3b8;
}

.tax-timeline-container {
  display: flex;
  gap: 4px;
  padding: 1rem 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.tax-timeline-block {
  flex: 1;
  min-width: 52px;
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.25rem;
  text-align: center;
  cursor: help;
  transition: all var(--transition-fast);
  position: relative;
}

.tax-timeline-block.low {
  background: linear-gradient(135deg, #10b981, #34d399);
  color: white;
}

.tax-timeline-block.medium {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: white;
}

.tax-timeline-block.high {
  background: linear-gradient(135deg, #ef4444, #f87171);
  color: white;
}

.tax-timeline-block:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 5;
}

.timeline-age {
  font-size: 0.85rem;
  font-weight: 700;
}

.timeline-indicators {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
  align-items: center;
}

.timeline-indicators .indicator {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.3);
}

.timeline-indicators .indicator.valley {
  font-size: 0.85rem;
  background: none;
  padding: 0;
}

.tax-timeline-legend {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #64748b;
}

.tax-bracket-table {
  width: 100%;
}

.recommended-bracket {
  background: rgba(16, 185, 129, 0.05) !important;
}

.recommended-bracket td {
  font-weight: 600;
}

.badge-recommended {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: linear-gradient(135deg, #10b981, #34d399);
  color: white;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-optional {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: #e2e8f0;
  color: #64748b;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

.tax-insight-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.tax-insight-card {
  padding: 1.25rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.tax-insight-card:hover {
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.tax-insight-card h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
}

.tax-insight-card p {
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.6;
  margin: 0;
}

/* ===========================
   Geographic Arbitrage Simulator
   =========================== */

.geo-arbitrage-card {
  margin-top: 1rem;
}

.geo-arbitrage-card .form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  padding: 0 1.5rem;
}

.geo-state-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: border-color 0.2s ease;
  appearance: auto;
}

.geo-state-select:focus {
  border-color: var(--accent-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.geo-compare-section {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  margin-top: 1rem;
}

.geo-compare-heading {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.75rem 0;
}

.geo-compare-slot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.geo-compare-slot select {
  flex: 1;
}

.geo-remove-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-md);
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.geo-remove-btn:hover {
  background: rgba(239, 68, 68, 0.2);
}

.geo-add-btn {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.geo-calc-btn {
  margin: 1.25rem 1.5rem 1.5rem;
  width: calc(100% - 3rem);
  font-size: 1.05rem;
  padding: 0.85rem;
}

/* Savings Callout */
.geo-savings-callout {
  margin-bottom: 1.5rem;
}

.geo-callout-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
  border: 2px solid;
}

.geo-saving {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.3);
}

.geo-costing {
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.3);
}

.geo-callout-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.geo-callout-amount {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
}

.geo-saving .geo-callout-amount {
  color: #059669;
}

.geo-costing .geo-callout-amount {
  color: #dc2626;
}

.geo-callout-detail {
  font-size: 0.95rem;
  color: #475569;
  margin-top: 0.25rem;
  line-height: 1.5;
}

/* Comparison Cards Grid */
.geo-comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.geo-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-color);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.geo-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.geo-card-current {
  border-color: rgba(79, 70, 229, 0.3);
}

.geo-card-better {
  border-color: rgba(16, 185, 129, 0.3);
}

.geo-card-worse {
  border-color: rgba(239, 68, 68, 0.2);
}

.geo-card-header {
  padding: 1rem 1.25rem;
  background: rgba(0, 0, 0, 0.015);
  border-bottom: 1px solid var(--border-color);
}

.geo-card-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0.5rem 0 0 0;
  color: var(--text-primary);
}

.geo-card-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.geo-badge-current {
  background: rgba(79, 70, 229, 0.1);
  color: #4f46e5;
}

.geo-badge-savings {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

.geo-badge-costly {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.geo-card-body {
  padding: 1rem 1.25rem;
}

.geo-cost-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  gap: 0.5rem;
}

.geo-cost-label {
  font-size: 0.88rem;
  color: #6b7280;
  flex: 1;
}

.geo-cost-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
  min-width: 80px;
}

.geo-delta {
  font-size: 0.78rem;
  font-weight: 600;
  min-width: 75px;
  text-align: right;
}

.geo-delta-positive {
  color: #059669;
}

.geo-delta-negative {
  color: #dc2626;
}

.geo-cost-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 0 0.5rem;
  margin-top: 0.5rem;
  border-top: 2px solid var(--border-color);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.geo-net-savings {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0.85rem;
  margin-top: 0.75rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.95rem;
}

.geo-net-savings.geo-delta-positive {
  background: rgba(16, 185, 129, 0.08);
  color: #059669;
}

.geo-net-savings.geo-delta-negative {
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
}

/* Portfolio Impact */
.geo-portfolio-card {
  margin-top: 1.5rem;
}

.geo-impact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  padding: 1rem 1.5rem;
}

.geo-impact-item {
  text-align: center;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  border: 2px solid;
}

.geo-impact-positive {
  background: rgba(16, 185, 129, 0.04);
  border-color: rgba(16, 185, 129, 0.2);
}

.geo-impact-negative {
  background: rgba(239, 68, 68, 0.04);
  border-color: rgba(239, 68, 68, 0.15);
}

.geo-impact-state {
  font-size: 0.9rem;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 0.5rem;
}

.geo-impact-amount {
  font-size: 1.6rem;
  font-weight: 800;
}

.geo-impact-positive .geo-impact-amount {
  color: #059669;
}

.geo-impact-negative .geo-impact-amount {
  color: #dc2626;
}

.geo-impact-detail {
  font-size: 0.82rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

.geo-impact-annual {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 0.35rem;
}

.geo-impact-note {
  font-size: 0.8rem;
  color: #94a3b8;
  text-align: center;
  padding: 0.75rem 1.5rem 1.25rem;
  margin: 0;
  font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
  .geo-arbitrage-card .form-grid {
    grid-template-columns: 1fr;
  }

  .geo-comparison-grid {
    grid-template-columns: 1fr;
  }

  .geo-impact-grid {
    grid-template-columns: 1fr;
  }

  .geo-calc-btn {
    margin: 1rem;
    width: calc(100% - 2rem);
  }

  .geo-callout-inner {
    flex-direction: column;
    text-align: center;
  }
}

/* ===========================
   Floating Feedback Button & Modal
   =========================== */

/* Floating Action Button */
.feedback-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.feedback-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(102, 126, 234, 0.55);
}

.feedback-fab.hidden {
  opacity: 0;
  transform: scale(0);
  pointer-events: none;
}

/* Overlay */
.feedback-overlay {
  position: fixed;
  inset: 0;
  z-index: 1001;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.feedback-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* Modal */
.feedback-modal {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1002;
  width: 380px;
  max-height: calc(100vh - 3rem);
  background: var(--bg-secondary, #ffffff);
  border-radius: var(--radius-lg, 16px);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.feedback-modal.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Modal Header */
.feedback-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
}

.feedback-modal-header h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.feedback-close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  line-height: 1;
}

.feedback-close-btn:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* Form */
.feedback-form {
  padding: 1.25rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.feedback-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.feedback-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary, #1e293b);
}

.feedback-field input,
.feedback-field select,
.feedback-field textarea {
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-sm, 8px);
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-primary, #1e293b);
  background: var(--bg-primary, #f8fafc);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.feedback-field input:focus,
.feedback-field select:focus,
.feedback-field textarea:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

.feedback-field textarea {
  resize: vertical;
  min-height: 80px;
}

.feedback-submit-btn {
  width: 100%;
  padding: 0.75rem;
  border: none;
  border-radius: var(--radius-sm, 8px);
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.feedback-submit-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.feedback-submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Success state */
.feedback-success {
  padding: 2.5rem 1.5rem;
  text-align: center;
}

.feedback-success-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}

.feedback-success h4 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary, #1e293b);
}

.feedback-success p {
  margin: 0;
  font-size: 0.95rem;
  color: #64748b;
}

/* Responsive */
@media (max-width: 480px) {
  .feedback-modal {
    right: 0.75rem;
    left: 0.75rem;
    bottom: 0.75rem;
    width: auto;
  }

  .feedback-fab {
    bottom: 1rem;
    right: 1rem;
    width: 48px;
    height: 48px;
    font-size: 1.3rem;
  }
}

/* ===========================
   Social Security Optimizer
   =========================== */

.ss-subtitle {
  color: var(--text-secondary, #6b7280);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.ss-subtitle strong {
  color: var(--primary, #667eea);
  font-size: 1.05rem;
}

/* Claiming Age Comparison Cards */
.ss-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.ss-claim-card {
  background: var(--surface, #f9fafb);
  border: 2px solid var(--border, #e5e7eb);
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.ss-claim-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.ss-card-chosen {
  border-color: var(--primary, #667eea);
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.ss-card-best:not(.ss-card-chosen) {
  border-color: #10b981;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.03), rgba(16, 185, 129, 0.08));
}

.ss-card-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.8rem;
  border-bottom-left-radius: 12px;
}

.ss-badge-max {
  background: linear-gradient(135deg, #10b981, #059669);
}

.ss-card-age {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-secondary, #6b7280);
  margin-bottom: 0.5rem;
}

.ss-card-amount {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary, #1f2937);
  line-height: 1.2;
}

.ss-card-period {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary, #6b7280);
}

.ss-card-annual {
  font-size: 0.9rem;
  color: var(--text-secondary, #6b7280);
  margin: 0.25rem 0 0.75rem;
}

.ss-card-adj {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: 20px;
  display: inline-block;
}

.ss-adj-positive {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.ss-adj-negative {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.ss-card-fra {
  font-size: 0.75rem;
  color: var(--primary, #667eea);
  font-weight: 600;
  margin-top: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Breakeven Analysis */
.ss-breakeven-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border, #e5e7eb);
}

.ss-breakeven-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary, #1f2937);
  margin-bottom: 0.5rem;
}

.ss-breakeven-desc {
  font-size: 0.85rem;
  color: var(--text-secondary, #6b7280);
  margin-bottom: 1rem;
}

.ss-breakeven-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.ss-breakeven-item {
  background: var(--surface, #f9fafb);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  border: 1px solid var(--border, #e5e7eb);
}

.ss-be-pair {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}

.ss-be-age {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary, #667eea);
  margin-bottom: 0.3rem;
}

.ss-be-label {
  font-size: 0.78rem;
  color: var(--text-secondary, #6b7280);
  line-height: 1.4;
}

/* Recommendation */
.ss-recommendation-card {
  border-left: 4px solid #f59e0b;
}

.ss-recommendation-body p {
  line-height: 1.7;
  color: var(--text-primary, #1f2937);
  font-size: 0.95rem;
}

.ss-disclaimer {
  font-size: 0.8rem !important;
  color: var(--text-secondary, #6b7280) !important;
  font-style: italic;
  margin-top: 1rem !important;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border, #e5e7eb);
}

/* Responsive */
@media (max-width: 768px) {
  .ss-cards-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .ss-breakeven-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .ss-card-amount {
    font-size: 1.6rem;
  }
}