/* ============================================================
   Utilities Bunker — Interest Calculator (v2.1)
   File: /assets/css/modules/calculators/financialcalculators/interest-calculator.v2.1.css
   Purpose:
   - Tool-only layout, dashboard, chart, work area, and schedule styling
   - No changes to ub-toolkit.v2.1.css
   - Mobile-first, responsive, UB-consistent
   ============================================================ */

:root{
  --int-radius: 16px;
  --int-gap: 14px;
  --int-soft: rgba(0,0,0,.06);
  --int-line: rgba(249,58,19,.95);
  --int-line-soft: rgba(249,58,19,.18);
  --int-line-fill: rgba(249,58,19,.10);
}

/* Header helpers */
.int-head{
  display:flex;
  gap:10px;
  justify-content:space-between;
  align-items:flex-start;
  flex-wrap:wrap;
}
.int-title{
  margin:0;
  font-size:var(--ub-fs-5);
}
.int-subtitle{
  margin:6px 0 0;
}

/* How-to spacing */
.int-howto{
  margin:0;
  padding-left:18px;
}
.int-howto li + li{
  margin-top:6px;
}

/* Hero layout */
.int-hero{
  display:grid;
  grid-template-columns:1.08fr 0.92fr;
  gap:var(--int-gap);
}

@media (max-width: 980px){
  .int-hero{
    grid-template-columns:1fr;
  }
}

/* Dashboard / left panel */
.int-dashboard{
  background:var(--ub-surface-2);
  border:1px solid var(--ub-border);
  border-radius:var(--int-radius);
  padding:12px;
}

.int-dashboard-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:10px;
}

.int-dashboard-title{
  font-size:clamp(13px, 1.2vw, 14px);
  font-weight:950;
  letter-spacing:.01em;
}
.int-dashboard-sub{
  font-size:12px;
  color:var(--ub-muted);
  margin-top:2px;
}

/* Mode chips */
.int-mode-chips{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.int-mode-chips .ub-chip{
  min-height:44px;
  padding:10px 14px;
}

/* KPI cards */
.int-kpis{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:10px;
  margin-top:10px;
}

@media (max-width: 520px){
  .int-kpis{
    grid-template-columns:1fr;
  }
}

.int-kpi{
  min-width:0;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--ub-border);
  background:var(--ub-card-bg);
}
.int-kpi .k{
  font-size:11px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.04em;
  color:var(--ub-muted);
}
.int-kpi .v{
  margin-top:4px;
  font-family:var(--ub-mono);
  font-weight:950;
  font-size:clamp(14px, 1rem + .18vw, 18px);
  line-height:1.2;
  overflow-wrap:anywhere;
}

/* Status pills */
.int-status-row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:10px;
}
.int-pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:44px;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid var(--ub-border);
  background:var(--ub-card-bg);
  font-size:12px;
  font-weight:950;
}
.int-dot{
  width:10px;
  height:10px;
  border-radius:50%;
  background:var(--ub-muted);
}

/* Chart area */
.int-chart-card{
  margin-top:12px;
  border:1px solid var(--ub-border);
  border-radius:14px;
  background:var(--ub-card-bg);
  overflow:hidden;
}

.int-chart-meta{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  padding:10px 12px;
  border-bottom:1px solid var(--ub-border);
  background:var(--ub-surface-2);
  font-size:12px;
}
.int-chart-meta strong{
  font-size:12px;
  font-weight:950;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.int-chart-meta span{
  color:var(--ub-muted);
}

.int-chart-wrap{
  padding:10px;
}

.int-chart{
  width:100%;
  height:auto;
  display:block;
  border-radius:12px;
}

/* Chart SVG parts */
.int-grid line{
  stroke:rgba(0,0,0,.10);
  stroke-width:1;
}
html.ub-theme-dark .int-grid line{
  stroke:rgba(255,255,255,.10);
}

.int-axis line{
  stroke:rgba(0,0,0,.18);
  stroke-width:1.25;
}
html.ub-theme-dark .int-axis line{
  stroke:rgba(255,255,255,.18);
}

.int-chart-title,
.int-axis-labels text{
  fill:rgba(0,0,0,.62);
  font-family:var(--ub-mono);
  font-size:12px;
}
html.ub-theme-dark .int-chart-title,
html.ub-theme-dark .int-axis-labels text{
  fill:rgba(255,255,255,.68);
}

.int-growth-area{
  fill:var(--int-line-fill);
  stroke:none;
}

.int-growth-line{
  fill:none;
  stroke:var(--int-line);
  stroke-width:4;
  stroke-linecap:round;
  stroke-linejoin:round;
  filter:drop-shadow(0 0 8px rgba(249,58,19,.14));
}

.int-growth-points circle{
  fill:var(--int-line);
  stroke:var(--ub-card-bg);
  stroke-width:2;
}

/* Legend */
.int-chart-legend{
  display:flex;
  gap:14px;
  flex-wrap:wrap;
  padding:0 12px 12px;
  font-size:12px;
  color:var(--ub-muted);
}
.legend-item{
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.legend-swatch{
  display:inline-block;
  width:18px;
  height:10px;
  border-radius:999px;
}
.legend-swatch--line{
  background:var(--int-line);
}
.legend-swatch--area{
  background:var(--int-line-fill);
  border:1px solid rgba(249,58,19,.18);
}

/* Presets */
.int-preset-row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:10px;
}
.int-preset-row .ub-chip{
  min-height:44px;
  padding:10px 12px;
}

/* Divider */
.int-divider{
  border:none;
  border-top:1px solid var(--ub-border);
  margin:14px 0;
}

/* Inline chips / controls */
.int-inline-tools{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}
.int-check-chip{
  display:inline-flex;
  gap:8px;
  align-items:center;
}
.int-check-chip input[type="checkbox"]{
  width:18px;
  height:18px;
  margin:0;
}

.int-actions{
  margin-top:12px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

/* Work box */
.int-work{
  font-family:var(--ub-mono);
  font-size:13px;
  line-height:1.55;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}
.int-work-note{
  margin-top:10px;
  color:var(--ub-muted);
  font-size:12px;
}

/* Table wrap */
.int-table-wrap{
  width:100%;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}

/* Formula / FAQ helpers */
.int-formula-list{
  margin:10px 0 0;
  padding-left:18px;
}
.int-formula-list li + li{
  margin-top:4px;
}
.int-formula-note{
  margin-top:10px;
  color:var(--ub-muted);
  font-size:12px;
}

.int-faq-q{
  margin:12px 0 6px;
}
.int-faq-a{
  margin:0 0 10px;
}

/* Better wrapping for long output and tables */
#outEnding,
#outInterest,
#outContrib,
#outEay,
#kpiEnding,
#kpiInterest,
#kpiContrib,
#kpiEay{
  overflow-wrap:anywhere;
  word-break:break-word;
}

/* Focus enhancements */
.int-mode-chips .ub-chip:focus,
.int-preset-row .ub-chip:focus{
  outline:none;
  box-shadow:0 0 0 4px var(--ub-focus);
}

/* Small-screen polish */
@media (max-width: 640px){
  .int-dashboard,
  .ub-card{
    container-type:inline-size;
  }

  .int-chart-meta{
    align-items:flex-start;
  }

  .int-pill{
    width:100%;
    justify-content:flex-start;
  }
}

@media (max-width: 480px){
  .int-chart-wrap{
    padding:8px;
  }

  .int-chart-legend{
    padding:0 10px 10px;
  }

  .int-kpi{
    padding:10px;
  }
}