/* ============================================================
   BRICKS PORTFOLIO CALCULATOR V2 — Light Premium Theme
   Adapted from dark Lavender theme to warm Ivory & Gold
   ============================================================ */

/* ── Page Layout ────────────────────────────── */
.calc-v2-page {
  min-height: 100vh;
  padding-top: var(--nav-height);
  background: var(--bg-primary);
}

#calc-v2-container {
  min-height: 80vh;
}

/* ── Screen Layout ─────────────────────────── */
.screen {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px clamp(16px, 5vw, 48px);
}

.screen-inner {
  max-width: 800px;
  width: 100%;
}

.results-screen { min-height: auto; padding-bottom: 64px; }
.results-inner { max-width: 1100px; width: 100%; }

/* ── Animations ────────────────────────────── */
@keyframes calcFadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: calcFadeInUp 0.55s ease both; }
.animate-in-delay-1 { animation-delay: 0.1s; }
.animate-in-delay-2 { animation-delay: 0.2s; }
.animate-in-delay-3 { animation-delay: 0.3s; }

/* ── Typography ────────────────────────────── */
.gradient-text {
  background: linear-gradient(135deg, #B8860B, #D4A843, #9A7209);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-success   { color: #059669 !important; }
.text-danger    { color: #DC2626 !important; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

/* ══ Calculator Hero ═══════════════════════════ */
.calc-hero { text-align: center; margin-bottom: 32px; }
.calc-hero .hero-badge {
  display: inline-block;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(184, 134, 11, 0.3);
  border-radius: var(--radius-pill);
  padding: 4px 16px;
  margin-bottom: 16px;
}
.calc-hero .hero-title {
  font-family: 'Heebo', sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.25;
  margin-bottom: 12px;
  color: var(--text-primary);
}
.calc-hero .hero-sub {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ══ Assumptions Banner ═══════════════════════ */
.assumptions-banner {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
}
.assumptions-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
  position: relative;
}
.assumptions-header h4 {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  margin: 0;
}
.btn-edit-assumptions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-family: 'Assistant', sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 3px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-edit-assumptions svg { width: 13px; height: 13px; }
.btn-edit-assumptions:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-light);
}
.assumptions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.assumptions-grid-4 {
  grid-template-columns: repeat(5, 1fr);
}
.assumption-item {
  text-align: center;
  padding: 8px;
}
.assumption-value {
  display: block;
  font-family: 'Inter', 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
}
.assumption-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ══ Input Card ═══════════════════════════════ */
.input-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.input-group {
  margin-bottom: 32px;
}
.input-group:last-child { margin-bottom: 0; }
.input-group label {
  display: block;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 12px;
  color: var(--text-primary);
}
.input-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.input-row input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--bg-warm);
  border-radius: 3px;
  outline: none;
}
.input-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 10px var(--accent-glow);
  transition: transform 0.15s ease;
}
.input-row input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}
.input-row input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
  box-shadow: 0 0 10px var(--accent-glow);
}
.input-value-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  min-width: 140px;
  transition: border-color 0.15s ease;
}
.input-value-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.input-prefix {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 4px;
}
.input-value-wrap input[type="number"] {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  width: 100%;
  outline: none;
  direction: ltr;
  text-align: left;
}
.input-value-wrap input[type="number"]::-webkit-inner-spin-button { opacity: 0; }
.input-range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  padding: 0 2px;
  direction: rtl;
}

/* ══ CTA Button ═══════════════════════════════ */
.cta-wrap { text-align: center; }
.screen .btn-primary,
.calc-v2-page .btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  font-family: 'Heebo', 'Assistant', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 16px 40px;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  box-shadow: 0 4px 20px var(--accent-glow);
}
.screen .btn-primary:hover,
.calc-v2-page .btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
}
.screen .btn-primary:active,
.calc-v2-page .btn-primary:active { transform: translateY(0); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-family: 'Assistant', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-ghost:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-light);
}

/* ══ Results Header ═══════════════════════════ */
.results-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-direction: row-reverse;
  margin-bottom: 32px;
  gap: 16px;
}
.results-header h2 { margin-bottom: 4px; }

/* ══ Milestones ═══════════════════════════════ */
.milestones {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}
.milestone-card {
  background: linear-gradient(135deg, rgba(184,134,11,0.06), rgba(245,236,212,0.4));
  border: 1px solid rgba(184,134,11,0.15);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.milestone-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(184,134,11,0.06), transparent 70%);
  pointer-events: none;
}
.milestone-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}
.milestone-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  color: var(--accent);
  flex-shrink: 0;
}
.milestone-badge svg { width: 18px; height: 18px; }
.milestone-header h3 { margin: 0; font-size: 1.2rem; color: var(--text-primary); }
.milestone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 12px;
}
.milestone-metric { text-align: center; }
.milestone-value {
  display: block;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
}
.milestone-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ══ Summary Section ═════════════════════════ */
.summary-section {
  margin-bottom: 40px;
}
.summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.summary-header h3 { margin: 0; }

/* Period toggle */
.period-toggle {
  display: flex;
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 2px;
}
.period-btn {
  font-family: 'Assistant', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 4px 16px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.period-btn:hover { color: var(--text-primary); }
.period-btn.active {
  background: var(--accent-light);
  color: var(--accent);
}

/* Summary grid */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  transition: opacity 0.2s ease;
}
.summary-grid.summary-fade {
  opacity: 0;
  transform: translateY(4px);
}
.metric-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  box-shadow: var(--shadow-sm);
}
.metric-card:hover {
  border-color: rgba(184, 134, 11, 0.25);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.metric-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 0 auto 8px;
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  color: var(--accent);
}
.metric-icon svg { width: 18px; height: 18px; }
.metric-value {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.metric-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.metric-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Metric info tooltip ───────────────────── */
.metric-info-wrap {
  position: absolute;
  top: 8px;
  left: 8px;
}
.metric-info-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.65rem;
  font-style: normal;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.metric-info-btn:hover,
.metric-info-wrap:hover .metric-info-btn {
  border-color: var(--accent);
  color: var(--accent);
}
.metric-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  background: rgba(28, 25, 23, 0.95);
  border: 1px solid rgba(28, 25, 23, 0.3);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  min-width: 230px;
  max-width: 280px;
  font-family: 'Assistant', sans-serif;
  font-size: 0.78rem;
  line-height: 1.6;
  color: #F5F5F4;
  text-align: right;
  direction: rtl;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  white-space: normal;
  pointer-events: none;
}
.metric-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(28, 25, 23, 0.95);
}
.metric-info-wrap:hover .metric-tooltip { display: block; }

/* ══ Charts ═══════════════════════════════════ */
.charts-section { margin-bottom: 32px; }
.charts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.chart-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: var(--shadow-sm);
}
.chart-card h4 {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 12px;
}
.chart-card canvas { width: 100%; display: block; }

/* ══ Chart Tooltip ════════════════════════════ */
.chart-tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 100;
  background: rgba(28, 25, 23, 0.94);
  border: 1px solid rgba(28, 25, 23, 0.3);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  min-width: 140px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  opacity: 0;
  transition: opacity 0.15s ease;
  direction: rtl;
}
.chart-tooltip-label {
  font-family: 'Assistant', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: #F5F5F4;
  margin-bottom: 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}
.chart-tooltip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
}
.chart-tooltip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.chart-tooltip-name {
  font-family: 'Assistant', sans-serif;
  font-size: 0.72rem;
  color: #A8A29E;
  flex: 1;
}
.chart-tooltip-val {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: #F5F5F4;
}

/* ══ Tables ═══════════════════════════════════ */
.yearly-section { margin-bottom: 40px; }
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.yearly-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  white-space: nowrap;
}
.yearly-table th {
  background: var(--bg-warm);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.75rem;
  text-align: center;
  padding: 12px;
  position: sticky;
  top: 0;
  border-bottom: 1px solid var(--border);
}
.yearly-table td {
  text-align: center;
  padding: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  background: var(--bg-white);
}
.yearly-table tr:hover td {
  background: var(--accent-light);
}
.yearly-table tr.milestone-row td {
  background: var(--accent-light);
  color: var(--text-primary);
  font-weight: 600;
}
.yearly-table tr.milestone-row {
  border-right: 3px solid var(--accent);
}

/* ══ Loans Section ═══════════════════════════ */
.loans-section { margin-bottom: 40px; }
.loans-accordions { display: flex; flex-direction: column; gap: 12px; }

/* Split bar */
.loan-split-bar {
  height: 6px;
  border-radius: 3px;
  background: rgba(5,150,105,0.15);
  overflow: hidden;
  margin-bottom: 3px;
  min-width: 80px;
}
.loan-split-interest {
  height: 100%;
  background: rgba(220,38,38,0.7);
  border-radius: 3px;
  transition: width 0.3s ease;
}
.loan-split-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.loan-mini-bar {
  height: 5px;
  border-radius: 3px;
  background: rgba(5,150,105,0.15);
  overflow: hidden;
  min-width: 60px;
}
.loan-mini-bar > div {
  height: 100%;
  border-radius: 3px;
}

/* Property badge */
.loan-prop-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--accent-light);
  color: var(--accent);
  white-space: nowrap;
}
.loan-prop-badge-free {
  background: rgba(5,150,105,0.1);
  color: #059669;
}
.loan-prop-badge-waiting {
  background: rgba(217,119,6,0.1);
  color: #D97706;
}
.loan-free-row { opacity: 0.55; }
.loan-free-row td { border-bottom-style: dashed !important; }
.loan-waiting-row { opacity: 0.65; }
.loan-waiting-row td { border-bottom-style: dashed !important; }
.loan-detail-table td:first-child { text-align: right; }

/* ══ Accordion ════════════════════════════════ */
.monthly-section { margin-bottom: 40px; }
.year-accordion {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.year-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-white);
  cursor: pointer;
  transition: background 0.15s ease;
  user-select: none;
}
.year-accordion-header:hover { background: var(--bg-warm); }
.year-accordion-title {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.year-summary-badges {
  display: flex;
  gap: 8px;
}
.year-accordion-header > svg {
  transition: transform 0.25s ease;
  color: var(--text-muted);
  flex-shrink: 0;
}
.year-accordion-header.open > svg {
  transform: rotate(180deg);
}
.year-accordion-body {
  background: var(--bg-primary);
}

/* Badges */
.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}
.badge-purchase { background: var(--accent-light); color: var(--accent); }
.badge-refi     { background: rgba(37,99,235,0.1);  color: #2563EB; }
.badge-props    { background: rgba(217,119,6,0.1);   color: #D97706; }

/* Monthly Table */
.monthly-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.monthly-table th {
  background: var(--bg-warm);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.7rem;
  padding: 8px 12px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.monthly-table td {
  text-align: center;
  padding: 8px 12px;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
.monthly-table tr.row-event td {
  background: rgba(184,134,11,0.04);
}

/* Events */
.event {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: 'Assistant', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  vertical-align: middle;
}
.event-icon { display: inline-flex; align-items: center; }
.event-icon svg { width: 13px; height: 13px; }
.event-purchase  { background: var(--accent-light); color: var(--accent); }
.event-refi      { background: rgba(37,99,235,0.1);  color: #2563EB; }
.event-injection { background: rgba(5,150,105,0.1);  color: #059669; }

/* ══ Exit Strategy Card ═════════════════════ */
.exit-card {
  margin-top: 20px;
  padding: 20px;
  background: var(--bg-white);
  border: 1px solid rgba(184,134,11,0.2);
  border-right: 3px solid var(--accent);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.exit-card-clean {
  border-color: rgba(5,150,105,0.2);
  border-right-color: #059669;
}
.exit-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.exit-icon {
  width: 22px;
  height: 22px;
  color: var(--accent);
  flex-shrink: 0;
}
.exit-header h5 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0;
  color: var(--accent);
}
.exit-desc {
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 16px;
}
.exit-desc strong { color: var(--text-primary); }
.exit-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.exit-badge-ok { color: #059669; }
.exit-card-clean p { font-size: 0.82rem; color: var(--text-secondary); margin: 0; }

.exit-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.exit-stat {
  text-align: center;
  padding: 12px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.exit-stat-highlight {
  background: rgba(184,134,11,0.04);
  border-color: rgba(184,134,11,0.2);
}
.exit-stat-value {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
}
.exit-stat-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.exit-table-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 0 8px;
}
.exit-action-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.exit-action-sell {
  background: rgba(220,38,38,0.08);
  color: #DC2626;
  border: 1px solid rgba(220,38,38,0.2);
}
.exit-action-keep {
  background: rgba(5,150,105,0.08);
  color: #059669;
  border: 1px solid rgba(5,150,105,0.2);
}
.exit-row-sell { background: rgba(220,38,38,0.03); }
.exit-row-keep { opacity: 0.7; }
.exit-table { margin-top: 8px; }

/* Property status labels */
.prop-status {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.prop-status-loan { background: rgba(220,38,38,0.08); color: #DC2626; }
.prop-status-free { background: rgba(5,150,105,0.08); color: #059669; }
.prop-status-waiting { background: rgba(217,119,6,0.08); color: #D97706; }

/* ══ Modal ════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(28, 25, 23, 0);
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
  transition: background 0.25s ease, backdrop-filter 0.25s ease;
  padding: 16px;
}
.modal-overlay.modal-visible {
  background: rgba(28, 25, 23, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-card {
  width: 100%;
  max-width: 580px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0,0,0,0.15);
  transform: scale(0.92) translateY(20px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.modal-visible .modal-card {
  transform: scale(1) translateY(0);
  opacity: 1;
}
.modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 24px 16px;
}
.modal-icon {
  width: 28px;
  height: 28px;
  color: #D97706;
  flex-shrink: 0;
}
.modal-header h3 {
  font-size: 1.2rem;
  margin: 0;
  color: var(--text-primary);
}
.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 24px;
}
.modal-disclaimer-text p {
  font-size: 0.85rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: 16px;
}
.modal-disclaimer-text p:last-child { margin-bottom: 0; }
.modal-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
}

/* Custom checkbox */
.modal-checkbox-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  user-select: none;
}
.modal-checkbox-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.modal-checkmark {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  transition: all 0.15s ease;
  position: relative;
}
.modal-checkmark::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 6px;
  width: 6px;
  height: 11px;
  border: 2px solid transparent;
  border-top: none;
  border-right: none;
  transform: rotate(-45deg);
  transition: border-color 0.15s ease;
}
.modal-checkbox-label input:checked ~ .modal-checkmark {
  background: var(--accent);
  border-color: var(--accent);
}
.modal-checkbox-label input:checked ~ .modal-checkmark::after {
  border-color: #fff;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-start;
}
.modal-btn-continue {
  font-size: 0.95rem;
  padding: 12px 32px;
}
.modal-btn-continue:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Edit modal */
.modal-card-edit { max-width: 640px; }
.modal-card-edit .modal-icon { color: var(--accent); }

.edit-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.edit-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.edit-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  transition: border-color 0.15s ease;
}
.edit-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.edit-input-wrap input[type="number"] {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  width: 100%;
  outline: none;
  direction: ltr;
  text-align: left;
}
.edit-input-wrap input[type="number"]::-webkit-inner-spin-button { opacity: 0; }
.edit-unit {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.edit-unit-prefix { margin-left: 4px; }

.btn-ghost-accent {
  color: var(--accent);
  border-color: transparent;
}
.btn-ghost-accent:hover {
  color: var(--accent-hover);
  border-color: rgba(184,134,11,0.3);
}

/* ══ Disclaimer Bar ═══════════════════════════ */
.calc-v2-disclaimer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px clamp(16px, 5vw, 48px);
  background: rgba(249, 247, 242, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  direction: rtl;
}
.calc-v2-disclaimer-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  margin-top: 1px;
}
.calc-v2-disclaimer p {
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0;
}

/* Push content above disclaimer */
.calc-v2-page { padding-bottom: 56px; }

/* ══ Responsive ═══════════════════════════════ */
@media (max-width: 900px) {
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-grid  { grid-template-columns: 1fr 1fr; }
  .assumptions-grid-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
  .screen { padding: 24px 12px; min-height: auto; }
  .milestones { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
  .assumptions-grid { grid-template-columns: repeat(2, 1fr); }
  .assumptions-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .results-header { flex-direction: column-reverse; gap: 12px; }
  .input-card { padding: 20px; }
  .input-row { flex-direction: column; gap: 12px; }
  .input-value-wrap { min-width: 100%; }
  .milestone-grid { grid-template-columns: repeat(2, 1fr); }
  .modal-card { max-height: 90vh; }
  .modal-header { padding: 16px 16px 12px; }
  .modal-body { padding: 0 16px; }
  .modal-footer { padding: 16px; }
  .modal-actions { flex-direction: column; }
  .modal-btn-continue { width: 100%; justify-content: center; }
  .edit-fields-grid { grid-template-columns: 1fr; }
  .exit-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .calc-v2-disclaimer { padding: 8px 12px; }
  .calc-v2-disclaimer p { font-size: 0.67rem; }
  .calc-v2-page { padding-bottom: 72px; }
}

/* ============================================================
   STAGE 2 — SINGLE DEAL COMPARISON STYLE ACCENTS
   ============================================================ */

.stage2-cta-section {
  margin-top: 56px;
  border-top: 2px solid var(--accent);
  padding-top: 48px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding-bottom: 24px;
}

.badge-cash { background: rgba(5,150,105,0.1) !important; color: #059669 !important; }
.badge-dscr { background: rgba(37,99,235,0.1) !important; color: #2563EB !important; }
.badge-hm { background: rgba(217,119,6,0.1) !important; color: #D97706 !important; }

.formula-container {
  margin-top: 16px;
  width: 100%;
}
.formula-box-content {
  display: none;
  margin-top: 8px;
  padding: 12px 16px;
  background: rgba(245,236,212,0.25);
  border: 1px solid rgba(184,134,11,0.15);
  border-radius: var(--radius-sm);
  animation: calcFadeInUp 0.3s ease;
}
.formula-box-content .f-line {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(184,134,11,0.12);
  font-size: 0.8rem;
}
.formula-box-content .f-line:last-child {
  border-bottom: none;
}
.btn-formula-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  padding: 4px 12px;
  border: 1px solid rgba(184,134,11,0.25);
  color: var(--accent);
  background: transparent;
  border-radius: var(--radius-sm);
  font-family: 'Heebo', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-formula-toggle:hover {
  background: var(--accent-light);
  border-color: var(--accent);
}

.dynamic-price-box {
  margin-top: 16px;
  padding: 12px 20px;
  background: rgba(184,134,11,0.05);
  border: 1px solid rgba(184,134,11,0.15);
  border-radius: var(--radius-md);
  font-weight: 700;
  color: var(--accent);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ctable {
  width: 100% !important;
  border-collapse: collapse;
  font-family: 'Assistant', sans-serif;
  white-space: normal !important;
  table-layout: fixed !important;
}
.ctable th, .ctable td {
  padding: 10px 8px !important;
  text-align: center;
  vertical-align: middle;
  font-size: 0.82rem !important;
}
.ctable th {
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--bg-warm);
}
.ctable td:first-child, .ctable th:first-child {
  text-align: right !important;
  font-weight: 600;
  width: 28% !important;
}
.ctable td:not(:first-child), .ctable th:not(:first-child) {
  width: 24% !important;
}
.ctable tr {
  border-bottom: 1px solid var(--border);
}
.ctable tr:last-child {
  border-bottom: none;
}
.ctable .cat-row {
  background: var(--bg-warm);
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border);
}
.ctable .cat-row td {
  text-align: right !important;
  font-size: 0.85rem !important;
  padding: 10px 16px !important;
  width: 100% !important;
}

@media (max-width: 768px) {
  .ctable {
    table-layout: auto !important;
  }
  .ctable td:first-child, .ctable th:first-child {
    width: auto !important;
  }
  .ctable td:not(:first-child), .ctable th:not(:first-child) {
    width: auto !important;
  }
}

/* Stage 2 rcard styles */
.rcard {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: visible !important; /* Allow tooltips to pop out! */
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}
.rcard:hover {
  transform: translateY(-4px);
  border-color: rgba(184, 134, 11, 0.4);
  box-shadow: var(--shadow-md);
}
.rcard-head {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  border-top-left-radius: calc(var(--radius-lg) - 1px);
  border-top-right-radius: calc(var(--radius-lg) - 1px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-warm);
}
.rcard-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.hero-coc {
  text-align: center;
  padding: 20px;
  background: rgba(245,236,212,0.25);
  border: 1px solid rgba(184,134,11,0.15);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}
.coc-val {
  display: block;
  font-size: 2.2rem;
  font-weight: 800;
  font-family: 'Inter', sans-serif;
  color: var(--accent);
}
.coc-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 4px;
}
.key-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}
.kmetric {
  text-align: center;
  padding: 12px 6px;
  background: rgba(184,134,11,0.04);
  border: 1px solid rgba(184,134,11,0.1);
  border-radius: var(--radius-sm);
}
.kmetric .kval {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
}
.kmetric .klbl {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.3;
}
.detail-section {
  margin-bottom: 16px;
  text-align: right;
}
.detail-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}
.detail-section .row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.detail-section .row:last-child {
  border-bottom: none;
}
.detail-section .row .lbl {
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.detail-section .row .val {
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  color: var(--text-primary);
}
.phase-header {
  font-size: 0.85rem;
  font-weight: 700;
  padding-right: 6px;
  margin-top: 16px;
  margin-bottom: 8px;
  text-align: right;
}
.fit-note {
  margin-top: auto;
  padding: 12px 16px;
  background: var(--bg-warm);
  border-right: 3.5px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.6;
  font-family: 'Assistant', sans-serif;
  text-align: right;
}

.insights-box {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  text-align: right;
}
.insights-title {
  font-family: 'Heebo', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.insights-box .insight {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
  padding: 8px 0;
  border-bottom: 1px solid rgba(184,134,11,0.08);
}
.insights-box .insight:last-child {
  border-bottom: none;
}

/* Calculator Registration Modal Custom Inputs */
.edit-input-wrap input[type="text"],
.edit-input-wrap input[type="email"],
.edit-input-wrap input[type="tel"] {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  width: 100%;
  outline: none;
}


