/* Calculadora de caída de voltaje — complementa calculadora-respaldo.css (.en-calc-*) */
#en-calculadora-cv .hidden { display: none !important; }

.en-cv-hint {
  margin-top: 0.375rem;
  font-size: 11px;
  color: #94a3b8;
}

.en-cv-desc {
  margin: -0.5rem 0 1rem;
  font-size: 12.5px;
  color: #64748b;
}

.en-cv-subtitle {
  font-family: 'Oswald', 'Plus Jakarta Sans', sans-serif;
  margin: 1.25rem 0 0.5rem;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #110317;
}

.en-cv-row2 {
  display: grid;
  grid-template-columns: 1fr 96px;
  gap: 0.5rem;
  align-items: center;
}

.en-cv-unit { flex-wrap: nowrap; }
.en-cv-unit .en-calc-pill { padding: 0.5rem 0.25rem; }

.en-cv-select {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  width: 100%;
  margin-top: 0.5rem;
  border-radius: 0.75rem;
  border: 1px solid #f3e8ff;
  background: #f4f4f4;
  padding: 0.625rem 0.75rem;
  font-size: 14px;
  color: #110317;
  outline: none;
  box-sizing: border-box;
}
.en-calc-field > label + .en-cv-select,
.en-calc-field > .en-cv-select:first-of-type { margin-top: 0; }
.en-cv-select:focus {
  border-color: #641d82;
  box-shadow: 0 0 0 4px rgba(100, 29, 130, 0.12);
}

.en-cv-variable {
  margin-top: 0.75rem;
  border-radius: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(100, 29, 130, 0.12);
  background: linear-gradient(135deg, #f6effa, #ffffff);
}
.en-cv-variable .en-calc-readout-val { text-align: center; color: #632281; margin-bottom: 0.25rem; }
.en-cv-slider-readout {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  color: #64748b;
  margin-top: 0.25rem;
}

.en-cv-warn {
  display: flex;
  gap: 0.625rem;
  margin-bottom: 0.5rem;
  border-radius: 0.75rem;
  padding: 0.625rem 0.75rem;
  font-size: 12.5px;
  line-height: 1.5;
  color: #8a4508;
  background: #fdeada;
  border: 1px solid #f3c393;
}
.en-cv-warn:last-child { margin-bottom: 0; }

/* medidor (reutiliza .en-calc-rec / .en-calc-lcd) */
.en-cv-unit-big {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 16px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
}
#vOutBig {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: clamp(38px, 6vw, 56px);
  text-shadow: 0 0 22px rgba(247, 186, 20, 0.35);
}
.en-cv-status { display: inline-flex; align-items: center; }
.en-cv-led {
  width: 10px; height: 10px; border-radius: 50%;
  display: inline-block; margin-right: 7px;
  box-shadow: 0 0 10px currentColor;
}
.en-cv-lcd { font-size: 20px; }

.en-cv-gauge { position: relative; z-index: 1; margin-top: 1.25rem; }
.en-cv-gauge-track { height: 10px; border-radius: 9999px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.en-cv-gauge-fill { height: 100%; border-radius: 9999px; transition: width 0.4s ease; }
.en-cv-gauge-scale {
  display: flex; justify-content: space-between; margin-top: 5px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px; color: rgba(255, 255, 255, 0.45);
}

/* semáforo */
.en-cv-legend { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
@media (max-width: 640px) { .en-cv-legend { grid-template-columns: repeat(2, 1fr); } }
.en-cv-lg { border-radius: 0.75rem; padding: 0.625rem 0.75rem; font-size: 12px; }
.en-cv-lg b { display: block; font-family: 'JetBrains Mono', ui-monospace, monospace; }
.en-cv-lg.is-green { background: #e8f8ee; color: #0f5c2e; }
.en-cv-lg.is-yellow { background: #fdf3da; color: #7a5900; }
.en-cv-lg.is-orange { background: #fdeada; color: #8a4508; }
.en-cv-lg.is-red { background: #fbe4e4; color: #8e1f1f; }

/* recomendaciones */
.en-cv-rec-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.en-cv-rec-list li {
  display: flex; gap: 0.625rem; align-items: flex-start;
  font-size: 13px; line-height: 1.5; color: #475569;
  padding: 0.625rem 0.75rem; border-radius: 0.75rem;
  background: #f6effa; border-left: 3px solid #641d82;
}
.en-cv-rec-list li .ico { color: #641d82; font-weight: 700; font-family: 'JetBrains Mono', ui-monospace, monospace; flex-shrink: 0; }

/* botones */
.en-cv-btn-row { display: flex; flex-wrap: wrap; gap: 0.625rem; margin-bottom: 0.875rem; }
.en-cv-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  border-radius: 0.75rem; padding: 0.625rem 1rem;
  font-size: 13px; font-weight: 600; cursor: pointer; transition: 0.15s;
  color: #fff; background: #641d82; border: 1px solid #641d82;
}
.en-cv-btn:hover { background: #4a1561; }
.en-cv-btn.is-secondary { color: #641d82; background: #f6effa; border-color: rgba(100, 29, 130, 0.2); }
.en-cv-btn.is-secondary:hover { background: #ead9f5; }

/* dimensionamiento */
.en-cv-cam-row { display: grid; grid-template-columns: 1.4fr 1fr 70px 34px; gap: 0.5rem; align-items: center; margin-bottom: 0.5rem; }
@media (max-width: 640px) { .en-cv-cam-row { grid-template-columns: 1fr 1fr 56px 32px; } }
.en-cv-cam-row .en-cv-select, .en-cv-cam-row input {
  margin-top: 0; padding: 0.5rem 0.625rem; font-size: 13px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  width: 100%; box-sizing: border-box; border-radius: 0.75rem;
  border: 1px solid #f3e8ff; background: #f4f4f4; color: #110317; outline: none;
}
.en-cv-cam-row input:focus { border-color: #641d82; box-shadow: 0 0 0 4px rgba(100, 29, 130, 0.12); }
.en-cv-rm-btn { background: #fef2f2; color: #dc2626; border: none; border-radius: 0.5rem; height: 34px; cursor: pointer; font-weight: 700; }
.en-cv-dim-reco {
  display: block; margin-top: 2px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 14px; font-weight: 700; color: #632281;
}
.en-calc-readout { align-items: center; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 0; }
.en-calc-readout .en-calc-readout-lbl { display: block; }

/* gráfica */
.en-cv-chart-container { position: relative; }
.en-cv-chart-wrap { height: 280px; }
.en-cv-chart-wrap svg { width: 100%; height: 100%; overflow: visible; }
.en-cv-chart-tooltip {
  position: absolute; pointer-events: none; opacity: 0; transition: opacity 0.1s ease; z-index: 5;
  background: #110317; color: #fff; white-space: nowrap;
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11.5px;
  padding: 6px 9px; border-radius: 7px;
}
.en-cv-chart-tooltip.show { opacity: 1; }

/* acordeón */
.en-cv-acc-item { border-bottom: 1px solid #f3e8ff; }
.en-cv-acc-item:last-child { border-bottom: none; }
.en-cv-acc-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.8rem 0.125rem; cursor: pointer; font-size: 13.5px; font-weight: 600; color: #110317;
}
.en-cv-acc-head .chev { transition: transform 0.2s ease; color: #641d82; }
.en-cv-acc-item.open .chev { transform: rotate(45deg); }
.en-cv-acc-body { max-height: 0; overflow: hidden; transition: max-height 0.25s ease; font-size: 13px; line-height: 1.55; color: #64748b; }
.en-cv-acc-item.open .en-cv-acc-body { max-height: 260px; }
.en-cv-acc-body p { padding: 0 0.125rem 0.875rem; margin: 0; }

@media (prefers-reduced-motion: reduce) {
  #en-calculadora-cv * { transition: none !important; }
}
