/* ============================================================
   Budget detail popups · DETAILED METHODOLOGY EDITION
   ============================================================ */
.budget-info {
  background: rgba(29, 78, 216, 0.10);
  color: #1d4ed8;
  border: 1px solid rgba(29, 78, 216, 0.20);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
  font-family: inherit;
}
.budget-info:hover {
  background: #1d4ed8; color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.32);
}

/* Modal */
.budget-modal {
  position: fixed; inset: 0;
  z-index: 9000;
  display: none;
  align-items: center; justify-content: center;
  padding: 24px 16px;
}
.budget-modal.open { display: flex; }
.bm-backdrop {
  position: absolute; inset: 0;
  background: rgba(10, 22, 40, 0.65);
  backdrop-filter: blur(10px);
}
.bm-card {
  position: relative;
  background: white;
  width: 100%;
  max-width: 820px;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  border-radius: 22px;
  padding: 32px 32px 28px;
  box-shadow: 0 30px 80px rgba(10, 22, 40, 0.45);
  animation: bm-pop .35s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes bm-pop {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.bm-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 0;
  font-size: 22px;
  color: #475569;
  cursor: pointer;
  line-height: 1;
  z-index: 2;
}
.bm-close:hover { background: #0a1628; color: white; }

.bm-phase {
  display: inline-block;
  background: linear-gradient(135deg, #1d4ed8, #06b6d4);
  color: white;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin-bottom: 12px;
}
.bm-title {
  font-size: 24px;
  font-weight: 800;
  color: #0a1628;
  line-height: 1.25;
  margin-bottom: 6px;
}
.bm-amount {
  font-size: 36px;
  font-weight: 800;
  color: #1d4ed8;
  margin-bottom: 20px;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #1d4ed8, #06b6d4);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* SECTIONS */
.bm-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #e2e8f0;
}
.bm-section-h {
  font-size: 12px;
  font-weight: 800;
  color: #1e293b;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

/* Methodology block */
.bm-methodology {
  background: linear-gradient(135deg, rgba(29, 78, 216, 0.06), rgba(6, 182, 212, 0.06));
  border-left: 4px solid #1d4ed8;
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.7;
  color: #1e293b;
}

/* Unit cost table */
.bm-unitcost {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  border-radius: 10px;
  overflow: hidden;
}
.bm-unitcost thead th {
  background: #0a1628;
  color: white;
  padding: 10px 12px;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-align: left;
}
.bm-unitcost tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}
.bm-unitcost tbody td:nth-child(2) {
  color: #1d4ed8;
  font-feature-settings: "tnum";
}
.bm-unitcost tbody td:last-child small {
  color: #64748b;
  font-size: 11px;
}
.bm-unitcost tbody tr:last-child td { border-bottom: 0; }
.bm-unitcost tbody tr:nth-child(odd) td { background: rgba(241, 245, 249, 0.4); }

/* Steps · show your work */
.bm-steps {
  display: flex; flex-direction: column; gap: 12px;
}
.bm-step {
  display: flex; gap: 14px;
  background: #f8fafc;
  padding: 16px 18px;
  border-radius: 12px;
  border-left: 4px solid #06b6d4;
}
.bm-step-num {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1d4ed8, #06b6d4);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 3px 8px rgba(29, 78, 216, 0.32);
}
.bm-step-body { flex: 1; min-width: 0; }
.bm-step-title {
  font-size: 14px;
  font-weight: 800;
  color: #0a1628;
  margin-bottom: 8px;
}
.bm-step-row {
  display: flex; align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  padding: 4px 0;
}
.bm-step-label {
  flex-shrink: 0;
  width: 55px;
  color: #64748b;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.bm-step-row code {
  background: white;
  padding: 3px 8px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 12px;
  color: #1d4ed8;
  border: 1px solid #e2e8f0;
  line-height: 1.55;
  word-break: break-word;
  font-feature-settings: "tnum";
}
.bm-step-row.bm-step-result {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dashed #cbd5e1;
}
.bm-step-row.bm-step-result b {
  color: #10b981;
  font-size: 14px;
  font-weight: 800;
}

/* Scenarios */
.bm-scen-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 12px;
}
.bm-scen {
  padding: 16px;
  border-radius: 14px;
  text-align: center;
  border: 2px solid #e2e8f0;
}
.bm-scen.low { background: #f8fafc; }
.bm-scen.mid {
  background: linear-gradient(135deg, rgba(29, 78, 216, 0.10), rgba(6, 182, 212, 0.10));
  border-color: #1d4ed8;
  transform: scale(1.04);
  box-shadow: 0 6px 20px rgba(29, 78, 216, 0.18);
}
.bm-scen.high { background: rgba(168, 85, 247, 0.08); }
.bm-scen-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #64748b;
  margin-bottom: 6px;
}
.bm-scen.mid .bm-scen-label { color: #1d4ed8; }
.bm-scen-n {
  font-size: 30px;
  font-weight: 800;
  color: #0a1628;
  line-height: 1.0;
  font-feature-settings: "tnum";
}
.bm-scen.mid .bm-scen-n { color: #1d4ed8; }
.bm-scen-unit {
  font-size: 11px;
  color: #64748b;
  margin-top: 4px;
  font-weight: 500;
}

/* Co-invest */
.bm-coinvest #bm-coinvest {
  background: rgba(16, 185, 129, 0.10);
  border-left: 4px solid #10b981;
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 13px;
  color: #064e3b;
  font-weight: 600;
  line-height: 1.6;
}

/* References list */
.bm-section ul {
  list-style: none;
  padding: 0; margin: 0;
}
.bm-section ul li {
  padding: 7px 0 7px 24px;
  font-size: 13px;
  color: #1e293b;
  position: relative;
  line-height: 1.55;
}
.bm-section ul li::before {
  content: '▸';
  position: absolute;
  left: 0; top: 7px;
  color: #06b6d4;
  font-weight: 700;
}

/* Warning note */
.bm-note {
  margin-top: 20px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(239, 68, 68, 0.08));
  border-left: 4px solid #f59e0b;
  border-radius: 10px;
  font-size: 12.5px;
  color: #78350f;
  line-height: 1.55;
  font-weight: 500;
}

/* Mobile responsive */
@media (max-width: 720px) {
  .bm-card { padding: 24px 20px 20px; }
  .bm-title { font-size: 20px; }
  .bm-amount { font-size: 28px; }
  .bm-scen-row { grid-template-columns: 1fr; gap: 8px; }
  .bm-scen.mid { transform: none; }
  .bm-step { padding: 12px 14px; }
  .bm-step-row { flex-direction: column; gap: 4px; }
  .bm-step-label { width: auto; }
}
