.ssaft-child-cost-tool {
  --ssaft-surface: #f8fbff;
  --ssaft-card: #ffffff;
  --ssaft-border: #d8e3f8;
  --ssaft-text: #102747;
  --ssaft-primary: #0f62fe;
  --ssaft-primary-hover: #0a4ec7;
  --ssaft-secondary: #eaf2ff;
  --ssaft-secondary-border: #bfd3f8;
  color: var(--ssaft-text);
  background: var(--ssaft-surface);
  border: 1px solid var(--ssaft-border);
  border-radius: 12px;
  padding: 18px;
  margin: 18px 0;
}

.ssaft-child-cost-tool h2,
.ssaft-child-cost-tool h3,
.ssaft-child-cost-tool h4,
.ssaft-child-cost-tool p,
.ssaft-child-cost-tool li,
.ssaft-child-cost-tool label,
.ssaft-child-cost-tool legend {
  color: #000 !important;
}

.ssaft-child-cost-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.ssaft-child-cost-field input {
  width: 100%;
  border: 1px solid #c8d7ef;
  border-radius: 8px;
  padding: 10px;
  min-height: 42px;
  box-sizing: border-box;
  background: #fff;
  color: #102747;
}

.ssaft-child-custom-wrap {
  border: 1px solid #d8e3f8;
  border-radius: 10px;
  padding: 12px;
  background: #f8fbff;
}

.ssaft-child-custom-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr auto;
  gap: 8px;
  margin-bottom: 8px;
}

.ssaft-child-custom-row input {
  width: 100%;
  border: 1px solid #c8d7ef;
  border-radius: 8px;
  padding: 10px;
  min-height: 40px;
  box-sizing: border-box;
}

.ssaft-child-cost-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.ssaft-child-btn-primary,
.ssaft-child-btn-secondary,
.ssaft-child-btn-remove {
  border-radius: 8px;
  border: 1px solid transparent;
  min-height: 40px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}

.ssaft-child-btn-primary {
  background: var(--ssaft-primary);
  color: #fff;
}

.ssaft-child-btn-primary:hover {
  background: var(--ssaft-primary-hover);
}

.ssaft-child-btn-secondary,
.ssaft-child-btn-remove {
  background: var(--ssaft-secondary);
  color: #0f2f59;
  border-color: var(--ssaft-secondary-border);
}

.ssaft-child-cost-results,
.ssaft-child-chart-section {
  margin-top: 14px;
  border: 1px solid var(--ssaft-border);
  border-radius: 10px;
  background: var(--ssaft-card);
  padding: 12px;
}

.ssaft-child-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.ssaft-child-metrics > div {
  border: 1px solid #dce8fa;
  border-radius: 8px;
  background: #f8fbff;
  padding: 10px;
}

.ssaft-child-metrics h4 {
  margin: 0 0 6px;
  font-size: 0.9rem;
}

.ssaft-child-metrics p {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
}

.ssaft-child-insight {
  margin-top: 12px;
  border: 1px solid #d7e5fb;
  border-radius: 10px;
  background: #f8fbff;
  padding: 12px;
}

.ssaft-child-chart-section {
  min-height: 0;
}

.ssaft-child-chart-section canvas {
  display: block;
  width: 100% !important;
  height: clamp(190px, 28vw, 250px) !important;
  max-height: 250px;
}

@media (max-width: 900px) {
  .ssaft-child-cost-grid,
  .ssaft-child-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .ssaft-child-cost-grid,
  .ssaft-child-metrics,
  .ssaft-child-custom-row {
    grid-template-columns: 1fr;
  }

  .ssaft-child-cost-actions {
    flex-direction: column;
  }

  .ssaft-child-btn-primary,
  .ssaft-child-btn-secondary {
    width: 100%;
  }

  .ssaft-child-chart-section canvas {
    height: 190px !important;
    max-height: 190px;
  }
}

/* SSA dark-neon production polish */
.ssaft-child-cost-tool {
  --ssaft-surface: rgba(3, 8, 18, 0.98);
  --ssaft-card: rgba(8, 18, 34, 0.96);
  --ssaft-border: rgba(45, 212, 191, 0.36);
  --ssaft-text: #f4fdff;
  --ssaft-muted: #dbeafe;
  --ssaft-primary: #2dd4bf;
  --ssaft-primary-hover: #38bdf8;
  --ssaft-secondary: rgba(2, 6, 23, 0.76);
  --ssaft-secondary-border: rgba(125, 211, 252, 0.36);
  color: var(--ssaft-text) !important;
  color-scheme: dark;
  background:
    radial-gradient(circle at 0% 0%, rgba(45, 212, 191, 0.13), transparent 32%),
    rgba(8, 18, 34, 0.96) !important;
  border-color: var(--ssaft-border) !important;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.26) !important;
}

.ssaft-child-cost-tool h2,
.ssaft-child-cost-tool h3,
.ssaft-child-cost-tool h4,
.ssaft-child-cost-tool p,
.ssaft-child-cost-tool li,
.ssaft-child-cost-tool label,
.ssaft-child-cost-tool legend,
.ssaft-child-cost-tool span,
.ssaft-child-cost-tool strong {
  color: var(--ssaft-text) !important;
}

.ssaft-child-cost-tool p,
.ssaft-child-cost-tool li {
  color: var(--ssaft-muted) !important;
}

.ssaft-child-cost-field input,
.ssaft-child-custom-row input {
  background: rgba(2, 6, 23, 0.86) !important;
  border-color: rgba(125, 211, 252, 0.34) !important;
  color: var(--ssaft-text) !important;
}

.ssaft-child-custom-wrap,
.ssaft-child-cost-results,
.ssaft-child-chart-section,
.ssaft-child-metrics > div,
.ssaft-child-insight {
  background:
    radial-gradient(circle at 0% 0%, rgba(45, 212, 191, 0.1), transparent 30%),
    rgba(2, 6, 23, 0.62) !important;
  border-color: var(--ssaft-border) !important;
}

.ssaft-child-btn-primary,
.ssaft-child-btn-secondary,
.ssaft-child-btn-remove {
  border-color: rgba(45, 212, 191, 0.48) !important;
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.82), rgba(2, 132, 199, 0.72)) !important;
  color: #f4fdff !important;
  box-shadow: 0 10px 24px rgba(8, 145, 178, 0.18) !important;
}

.ssaft-child-btn-secondary,
.ssaft-child-btn-remove {
  background: rgba(2, 6, 23, 0.76) !important;
}

.ssaft-child-btn-primary:hover,
.ssaft-child-btn-primary:focus,
.ssaft-child-btn-secondary:hover,
.ssaft-child-btn-secondary:focus,
.ssaft-child-btn-remove:hover,
.ssaft-child-btn-remove:focus {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.96), rgba(14, 165, 233, 0.86)) !important;
  color: #ffffff !important;
}

.ssaft-child-chart-section canvas {
  background: rgba(2, 6, 23, 0.44) !important;
  border: 1px solid rgba(125, 211, 252, 0.18) !important;
  border-radius: 10px !important;
}
