/**
 * Investment Calculator Styles
 * Two-column layout: Inputs left, Results right
 */

/* Panel Overlay */
.calc-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 9998;
}

.calc-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* Slide Panel - Wider for two columns */
.calc-panel {
  position: fixed;
  top: 0;
  right: -760px;
  width: 760px;
  max-width: 95vw;
  height: 100vh;
  background: #fff;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  transition: right 0.3s ease;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.calc-panel.open {
  right: 0;
}

/* Header */
.calc-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 16px 20px;
  flex-shrink: 0;
}

.calc-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.calc-title {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.calc-title i {
  font-size: 1rem;
}

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

.calc-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.calc-property-address {
  font-size: 0.85rem;
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Strategy Toggle */
.calc-strategy-toggle {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.calc-strategy-btn {
  flex: 1;
  padding: 8px 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  color: white;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calc-strategy-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.calc-strategy-btn.active {
  background: white;
  color: #667eea;
  border-color: white;
}

/* Two-Column Content Layout */
.calc-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.calc-two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  min-height: 100%;
}

.calc-two-column.hidden {
  display: none;
}

/* Inputs Column */
.calc-inputs-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Results Column */
.calc-results-column {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Compact Input Groups */
.calc-input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.calc-input-half {
  flex: 1;
  min-width: 0;
}

.calc-input-third {
  flex: 1;
  min-width: 0;
}

.calc-input-third .calc-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calc-input-third .calc-info-icon {
  display: none; /* Hide info icon in compact third-width to save space */
}

.calc-input-row {
  display: flex;
  gap: 10px;
}

.calc-label {
  font-size: 0.8rem;
  color: #495057;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.calc-label i {
  color: #667eea;
}

.calc-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.calc-input-wrapper .input-prefix {
  position: absolute;
  left: 10px;
  color: #6c757d;
  font-weight: 500;
  font-size: 0.9rem;
  pointer-events: none;
}

.calc-input-wrapper .input-suffix {
  position: absolute;
  right: 10px;
  color: #6c757d;
  font-weight: 500;
  font-size: 0.85rem;
  pointer-events: none;
}

.calc-input {
  width: 100%;
  padding: 10px 12px;
  padding-left: 24px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #212529;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -moz-appearance: textfield;
  appearance: textfield;}

.calc-input::-webkit-outer-spin-button,
.calc-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.calc-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

/* Warning state for missing data */
.calc-input-warning {
  border-color: #f0ad4e !important;
  background-color: #fffbf0;
}

.calc-input-warning:focus {
  border-color: #ec971f !important;
  box-shadow: 0 0 0 3px rgba(240, 173, 78, 0.2);
}

.calc-input.has-suffix {
  padding-right: 50px;
}

.calc-input.no-prefix {
  padding-left: 12px;
}

/* List Price Reference */
.calc-list-price-ref {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #f8f9fa;
  border-radius: 6px;
  font-size: 0.75rem;
  color: #6c757d;
}

.calc-list-price-ref button {
  background: none;
  border: none;
  color: #667eea;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-size: 0.75rem;
  margin-left: auto;
}

.calc-list-price-ref button:hover {
  text-decoration: underline;
}

/* Target Section - Highlighted */
.calc-target-section {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
  border: 1px dashed rgba(102, 126, 234, 0.3);
  border-radius: 10px;
  padding: 10px;
  margin-top: 4px;
}

.calc-target-hint {
  font-size: 0.7rem;
  color: #667eea;
  font-weight: 500;
  margin-left: auto;
}

.calc-target-input {
  border-color: rgba(102, 126, 234, 0.3);
}

.calc-target-input:focus {
  border-color: #667eea;
}

/* Mode Indicator */
.calc-mode-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: white;
  border-radius: 8px;
  font-size: 0.8rem;
  color: #495057;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.calc-mode-indicator i {
  color: #667eea;
}

.calc-mode-indicator.solving-mao {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
  color: #667eea;
  font-weight: 600;
}

.calc-mode-indicator.solving-mao i {
  color: #764ba2;
}

/* Primary Result */
.calc-result-primary {
  text-align: center;
  padding: 14px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.calc-result-primary-label {
  font-size: 0.75rem;
  color: #6c757d;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.calc-result-primary-value {
  font-size: 2rem;
  font-weight: 700;
  color: #28a745;
  transition: transform 0.2s ease;
}

.calc-result-primary-value.negative {
  color: #dc3545;
}

/* Pulse animation for calculated values */
.calc-result-primary-value.pulse {
  animation: resultPulse 0.5s ease;
}

@keyframes resultPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* Input pulse for MAO solve - prominent animation */
.calc-input.pulse-mao {
  animation: inputPulseMAO 1.2s ease;
}

@keyframes inputPulseMAO {
  0% { 
    border-color: #e9ecef;
    box-shadow: none;
    background-color: #fff;
  }
  20% { 
    border-color: #28a745;
    box-shadow: 0 0 0 6px rgba(40, 167, 69, 0.35);
    background-color: rgba(40, 167, 69, 0.08);
  }
  60% { 
    border-color: #28a745;
    box-shadow: 0 0 0 6px rgba(40, 167, 69, 0.35);
    background-color: rgba(40, 167, 69, 0.08);
  }
  100% { 
    border-color: #e9ecef;
    box-shadow: none;
    background-color: #fff;
  }
}

/* MAO calculated state - stays highlighted */
.calc-input.mao-calculated {
  border-color: #28a745;
  background-color: rgba(40, 167, 69, 0.06);
  box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.15);
}

/* MAO result badge */
.calc-mao-badge {
  display: none;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-top: 6px;
  animation: badgeFadeIn 0.3s ease;
}

.calc-mao-badge.visible {
  display: inline-flex;
}

.calc-mao-badge i {
  font-size: 0.65rem;
}

@keyframes badgeFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Result Grid */
.calc-result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.calc-result-item {
  background: white;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.calc-result-label {
  font-size: 0.7rem;
  color: #6c757d;
  margin-bottom: 2px;
}

.calc-result-value {
  font-size: 1rem;
  font-weight: 700;
  color: #212529;
}

.calc-result-value.positive {
  color: #28a745;
}

.calc-result-value.negative {
  color: #dc3545;
}

/* Spread Indicator */
.calc-spread-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px;
  background: white;
  border-radius: 8px;
  font-size: 0.85rem;
}

.calc-spread-label {
  color: #6c757d;
}

.calc-spread-value {
  font-weight: 700;
}

.calc-spread-value.positive {
  color: #28a745;
}

.calc-spread-value.negative {
  color: #dc3545;
}

/* Health Checks */
.calc-health-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.calc-health-check {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 16px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(40, 167, 69, 0.1);
  color: #28a745;
}

.calc-health-check.positive {
  background: rgba(40, 167, 69, 0.1);
  color: #28a745;
}

.calc-health-check.positive i {
  color: #28a745;
}

.calc-health-check.negative {
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

.calc-health-check.negative i {
  color: #dc3545;
}

/* Advanced Options */
.calc-advanced-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  background: none;
  border: 1px dashed #dee2e6;
  border-radius: 6px;
  color: #6c757d;
  font-size: 0.8rem;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s ease;
}

.calc-advanced-toggle:hover {
  color: #667eea;
  border-color: #667eea;
}

.calc-advanced-toggle.open i {
  transform: rotate(180deg);
}

.calc-advanced-options {
  padding-top: 10px;
}

.calc-advanced-options.hidden {
  display: none;
}

/* Generic hidden utility */
.hidden {
  display: none !important;
}

/* Inline mode toggle button (e.g. Maintenance $/yr ↔ %/yr) */
.calc-mode-toggle-btn {
  margin-left: auto;
  padding: 2px 7px;
  background: rgba(102, 126, 234, 0.1);
  border: 1px solid rgba(102, 126, 234, 0.35);
  border-radius: 4px;
  color: #667eea;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.4;
  white-space: nowrap;
}

.calc-mode-toggle-btn:hover {
  background: #667eea;
  color: #fff;
}

/* Small hint line below an input (e.g. implied $/yr when in % mode) */
.calc-input-hint {
  font-size: 0.7rem;
  color: #adb5bd;
  margin-top: 2px;
  min-height: 0.85rem;
}

/* Footer Actions */
.calc-footer {
  padding: 12px 16px;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
  flex-shrink: 0;
  display: flex;
  gap: 10px;
}

/* Unsaved-changes prompt overlay (shown by close() when dirty). */
.calc-dirty-prompt {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 24px;
}
.calc-dirty-prompt.active {
  display: flex;
}
.calc-dirty-prompt-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 380px;
  padding: 20px 22px;
}
.calc-dirty-prompt-card h4 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  color: #1e3a5f;
}
.calc-dirty-prompt-card p {
  margin: 0 0 16px;
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.45;
}
.calc-dirty-prompt-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.calc-dirty-prompt-actions .calc-btn {
  flex: 1 1 auto;
  padding: 10px 12px;
  font-size: 0.85rem;
}
.calc-dirty-prompt-hint {
  margin: 12px 0 0;
  font-size: 0.75rem;
  color: #94a3b8;
  text-align: center;
}

.calc-btn {
  flex: 1;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.calc-btn-primary {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
}

.calc-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.calc-btn-secondary {
  background: white;
  color: #495057;
  border: 2px solid #dee2e6;
}

.calc-btn-secondary:hover {
  background: #f8f9fa;
  border-color: #ced4da;
}

.calc-btn-notebook {
  background: white;
  color: #0d6efd;
  border: 2px solid #0d6efd;
}

.calc-btn-notebook:hover {
  background: #0d6efd;
  color: white;
}

/* Calculator trigger button */
.calc-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calc-trigger-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.calc-trigger-btn i {
  font-size: 1rem;
}

/* Inline calculator button (analysis section header) */
.calc-trigger-btn-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: transparent;
  color: #1e3a5f;
  border: 1.5px solid #1e3a5f;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: 'Lexend', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.calc-trigger-btn-inline:hover {
  background: linear-gradient(135deg, #1e3a5f 0%, #0d2137 100%);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(30, 58, 95, 0.25);
}

.calc-trigger-btn-inline i {
  font-size: 0.8rem;
}

/* Tooltips */
.calc-tooltip {
  position: relative;
  cursor: help;
}

.calc-info-icon {
  font-size: 0.7rem;
  color: #adb5bd;
  margin-left: 2px;
  transition: color 0.2s ease;
}

.calc-tooltip:hover .calc-info-icon {
  color: #667eea;
}

.calc-tooltip[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  right: auto;
  width: 260px;
  padding: 10px 12px;
  background: #212529;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.4;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  z-index: 10001;
  pointer-events: none;
  animation: tooltipFadeIn 0.2s ease;
}

.calc-tooltip[data-tooltip]:hover::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 20px;
  border: 6px solid transparent;
  border-top-color: #212529;
  z-index: 10001;
  pointer-events: none;
  animation: tooltipFadeIn 0.2s ease;
}

/* Tooltip on right side for items near left edge */
.calc-result-label.calc-tooltip[data-tooltip]:hover::after,
.calc-result-primary-label.calc-tooltip[data-tooltip]:hover::after {
  left: auto;
  right: 0;
}

.calc-result-label.calc-tooltip[data-tooltip]:hover::before,
.calc-result-primary-label.calc-tooltip[data-tooltip]:hover::before {
  left: auto;
  right: 20px;
}

/* Tooltip positioned below (for items near top of screen) */
.calc-tooltip-below[data-tooltip]:hover::after {
  bottom: auto;
  top: calc(100% + 8px);
}

.calc-tooltip-below[data-tooltip]:hover::before {
  bottom: auto;
  top: calc(100% + 2px);
  border-top-color: transparent;
  border-bottom-color: #212529;
}

/* Health check tooltips */
.calc-health-check.calc-tooltip[data-tooltip]:hover::after {
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  text-align: center;
}

.calc-health-check.calc-tooltip[data-tooltip]:hover::before {
  left: 50%;
  transform: translateX(-50%);
}

@keyframes tooltipFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive - Stack on mobile */
@media (max-width: 720px) {
  .calc-panel {
    width: 100vw;
    right: -100vw;
  }
  
  .calc-panel.open {
    right: 0;
  }
  
  .calc-two-column {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .calc-results-column {
    order: -1; /* Results first on mobile */
  }
  
  .calc-result-primary-value {
    font-size: 1.75rem;
  }
  
  .calc-result-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 400px) {
  .calc-input-row {
    flex-direction: column;
    gap: 10px;
  }
  
  .calc-result-grid {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════════
   BRRRR-SPECIFIC STYLES
   ═══════════════════════════════════════════════════════════ */

/* Section labels within BRRRR inputs column */
.calc-brrrr-section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #764ba2;
  padding: 6px 0 2px;
  border-bottom: 1px solid rgba(118, 75, 162, 0.15);
  margin-top: 2px;
}

.calc-brrrr-section-label i {
  font-size: 0.75rem;
  color: #764ba2;
}

/* Deal Breakdown panel inside results column */
.calc-brrrr-breakdown {
  background: white;
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.calc-brrrr-breakdown-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6c757d;
  margin-bottom: 7px;
}

.calc-brrrr-breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: #495057;
  padding: 3px 0;
}

.calc-brrrr-breakdown-row span:last-child {
  font-weight: 700;
  color: #212529;
}

.calc-brrrr-breakdown-divider {
  border-top: 1px solid #e9ecef;
  margin-top: 4px;
  padding-top: 7px;
}

.calc-brrrr-breakdown-highlight {
  background: rgba(102, 126, 234, 0.06);
  border-radius: 4px;
  padding: 4px 6px;
  margin-top: 4px;
  font-weight: 700;
}

.calc-brrrr-breakdown-highlight span:first-child {
  font-weight: 700;
  color: #495057;
}

/* HM shortfall warning row — shown when refi can't pay off HM note */
.calc-brrrr-shortfall-row {
  background: rgba(220, 53, 69, 0.07);
  border: 1px solid rgba(220, 53, 69, 0.25);
  border-radius: 4px;
  padding: 4px 6px;
  margin-top: 2px;
}

.calc-brrrr-shortfall-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #dc3545;
}

.calc-brrrr-shortfall-row span:last-child {
  font-weight: 700;
  color: #dc3545;
}

/* Full BRRRR badge on primary result */
.calc-result-primary-value.brrrr-full {
  background: linear-gradient(135deg, #28a745, #20c997);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* BRRRR% secondary badge (shown when 100%+) */
.calc-brrrr-infinity-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}

/* ═══════════════════════════════════════════════════════════
   FAQ SECTION (inside calc panel)
   ═══════════════════════════════════════════════════════════ */

.calc-faq-wrapper {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e9ecef;
}

.calc-faq-wrapper .accordion-item {
  border: 1px solid #e9ecef;
  border-radius: 8px !important;
  margin-bottom: 8px;
}

.calc-faq-wrapper .accordion-button {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e3a5f;
  background: #f8f9fb;
  padding: 10px 14px;
  box-shadow: none;
}

.calc-faq-wrapper .accordion-button:not(.collapsed) {
  background: linear-gradient(135deg, rgba(30,58,95,0.06) 0%, rgba(102,126,234,0.06) 100%);
  color: #1e3a5f;
}

.calc-faq-wrapper .accordion-button::after {
  width: 0.85rem;
  height: 0.85rem;
  background-size: 0.85rem;
}

.calc-faq-wrapper .accordion-body {
  font-size: 0.82rem;
  line-height: 1.6;
  color: #495057;
  padding: 12px 14px;
}

.calc-faq-wrapper .accordion-body h6 {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e3a5f;
  margin-bottom: 6px;
}

.calc-faq-wrapper .accordion-body p {
  margin-bottom: 8px;
}

.calc-faq-wrapper .accordion-body ul,
.calc-faq-wrapper .accordion-body ol {
  padding-left: 18px;
  margin-bottom: 8px;
}

.calc-faq-wrapper .accordion-body li {
  margin-bottom: 4px;
}

.calc-faq-wrapper .table-responsive {
  overflow-x: auto;
}

.calc-faq-wrapper table.table {
  font-size: 0.78rem;
  width: 100%;
}

.calc-faq-wrapper table.table th,
.calc-faq-wrapper table.table td {
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  padding: 8px 10px;
  vertical-align: top;
  text-align: left;
}

.calc-faq-wrapper table.table thead th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: #1e3a5f !important;
  color: white !important;
  border-color: #16304f !important;
}

.calc-faq-wrapper .alert {
  font-size: 0.8rem;
  padding: 8px 12px;
  border-radius: 6px;
}

.calc-faq-wrapper .alert code {
  font-size: 0.78rem;
}

@media (max-width: 720px) {
  .calc-faq-wrapper .accordion-body {
    padding: 10px 10px;
  }
  .calc-faq-wrapper table.table th,
  .calc-faq-wrapper table.table td {
    padding: 6px 6px;
    font-size: 0.72rem;
  }
  .calc-faq-wrapper table.table thead th {
    font-size: 0.68rem;
    letter-spacing: 0.2px;
  }
}

.calc-btn-help {
  width: 30px;
  height: 30px;
  background: transparent;
  color: rgba(255,255,255,0.6);
  border: 1.5px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calc-btn-help:hover {
  color: white;
  border-color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.1);
}

.calc-btn-help.active {
  color: white;
  border-color: white;
  background: rgba(255,255,255,0.15);
}

/* Three-button strategy toggle (wider) */
.calc-strategy-toggle {
  gap: 6px;
}

.calc-strategy-btn {
  font-size: 0.8rem;
  padding: 7px 10px;
}

/* BRRRR result grid: 2x2 */
#calcBRRRRInputs .calc-result-grid {
  grid-template-columns: 1fr 1fr;
}

/* Responsive adjustments for BRRRR */
@media (max-width: 720px) {
  #calcBRRRRInputs .calc-result-grid {
    grid-template-columns: 1fr 1fr;
  }
}