/* ============================================================
   Tool Styles — Investment Calculator v2.1
   File: /assets/css/modules/calculators/financialcalculators/investment-calculator.v2.1.css
   Purpose:
   - Tool-only layout, chart area, KPI cards, yearly table polish
   - No changes to ub-toolkit.v2.1.css
   - Mobile-first, responsive, accessible, UB-CERT aligned
   ============================================================ */

:root{
  --inv-radius: 16px;
  --inv-gap: 14px;
  --inv-soft: rgba(0,0,0,.06);
}

/* Header */
.ub-invest-head{
  display:flex;
  gap:10px;
  justify-content:space-between;
  align-items:center;
  flex-wrap:wrap;
}
.ub-invest-title{
  margin:0;
  font-size:var(--ub-fs-5);
}
.ub-invest-subtitle{
  margin:6px 0 0;
}

/* Shared list spacing */
.ub-invest-list{
  margin:0;
  padding-left:18px;
}
.ub-invest-list li + li{
  margin-top:6px;
}

/* Main hero layout */
.ub-invest-hero{
  display:grid;
  grid-template-columns:1.12fr 0.88fr;
  gap:var(--inv-gap);
}
@media (max-width: 980px){
  .ub-invest-hero{
    grid-template-columns:1fr;
  }
}

/* Projection panel */
.ub-invest-panel{
  background:var(--ub-surface-2);
  border:1px solid var(--ub-border);
  border-radius:var(--inv-radius);
  padding:12px;
}
.ub-invest-panel-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:10px;
}
.ub-invest-panel-title{
  font-size:clamp(13px, 1.2vw, 14px);
  font-weight:950;
  letter-spacing:.01em;
}
.ub-invest-panel-sub{
  font-size:12px;
  color:var(--ub-muted);
  margin-top:2px;
}

/* Status badge */
.ub-invest-badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  min-height:44px;
  border-radius:999px;
  border:1px solid var(--ub-border);
  background:var(--ub-card-bg);
  font-size:12px;
  font-weight:950;
}
.ub-dot{
  width:10px;
  height:10px;
  border-radius:50%;
  background:var(--ub-muted);
  flex:0 0 auto;
}

/* KPI cards */
.ub-invest-kpis{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:10px;
  margin-bottom:12px;
}
.ub-invest-kpi{
  min-width:0;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--ub-border);
  background:var(--ub-card-bg);
}
.ub-invest-kpi .k{
  font-size:11px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.04em;
  color:var(--ub-muted);
}
.ub-invest-kpi .v{
  margin-top:4px;
  font-family:var(--ub-mono);
  font-weight:950;
  font-size:15px;
  line-height:1.25;
  overflow-wrap:anywhere;
}
@media (max-width: 520px){
  .ub-invest-kpis{
    grid-template-columns:1fr;
  }
}

/* Chart card */
.ub-invest-chartcard{
  border:1px solid var(--ub-border);
  border-radius:14px;
  background:var(--ub-card-bg);
  overflow:hidden;
}
.ub-invest-charthead{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
  flex-wrap:wrap;
  padding:12px 12px 0;
}
.ub-invest-mini-meta{
  color:var(--ub-muted);
  font-size:12px;
  line-height:1.4;
}
.ub-invest-chartwrap{
  padding:12px;
}
#growthChart{
  display:block;
  width:100%;
  height:auto;
  border-radius:12px;
  border:1px solid var(--ub-border);
  background:var(--ub-surface-2);
}

/* Presets */
.ub-invest-presets{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:10px;
}
.ub-invest-presets .ub-chip{
  min-height:44px;
  padding:10px 12px;
}

/* Separator */
.ub-invest-sep{
  border:none;
  border-top:1px solid var(--ub-border);
  margin:14px 0;
}

/* Toggle areas */
.ub-invest-stack{
  display:grid;
  gap:12px;
}
.ub-invest-toggle-row{
  display:flex;
  gap:10px;
  align-items:flex-start;
  justify-content:space-between;
  flex-wrap:wrap;
}
.ub-invest-toggle-label{
  min-width:180px;
  font-weight:950;
  padding-top:10px;
}
.ub-invest-toggle-group{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}
.ub-invest-toggle-group .ub-chip{
  min-height:44px;
  padding:10px 12px;
}

/* Check rows */
.ub-invest-checks{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

/* Work box */
.ub-work{
  font-family:var(--ub-mono);
  font-size:13px;
  line-height:1.55;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}
.ub-invest-footnote{
  margin-top:10px;
  color:var(--ub-muted);
  font-size:12px;
  line-height:1.5;
}

/* Table */
.ub-invest-tablehead{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
  flex-wrap:wrap;
}
.ub-invest-tablewrap{
  margin-top:10px;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
}
.ub-invest-tablewrap .ub-table{
  min-width:720px;
}
.ub-invest-tablewrap td,
.ub-invest-tablewrap th{
  white-space:nowrap;
}
.ub-invest-tablewrap td:first-child,
.ub-invest-tablewrap th:first-child{
  white-space:normal;
}

/* FAQ */
.ub-invest-faq-h{
  margin:12px 0 6px;
}
.ub-invest-faq-p{
  margin:0 0 10px;
}
.ub-invest-faq-p:last-child{
  margin-bottom:0;
}

/* Details polish */
.ub-collapsible summary{
  cursor:pointer;
  font-weight:950;
  min-height:44px;
  display:flex;
  align-items:center;
}
.ub-collapsible summary:focus{
  outline:none;
  box-shadow:0 0 0 4px var(--ub-focus);
  border-radius:12px;
}

/* Button helper */
.ub-btn--block{
  width:100%;
}

/* Tighten numeric displays on narrower screens */
@media (max-width: 640px){
  .ub-invest-kpi .v{
    font-size:14px;
  }

  .ub-invest-toggle-label{
    min-width:100%;
    padding-top:0;
  }

  .ub-invest-charthead{
    padding:12px;
  }
}

/* Dark mode subtle boost */
html.ub-theme-dark #growthChart{
  background:rgba(255,255,255,.02);
}

/* Safer wrapping for long currency outputs */
#kpiFutureValue,
#kpiContributions,
#kpiInterest,
#kpiEffectiveRate,
#outFutureValue,
#outPrincipalContrib,
#outInterest,
#outRealValue{
  overflow-wrap:anywhere;
  word-break:break-word;
}