/* ============================================================
   Voltage Divider Calculator · F.Robin Technologies
   scoped to .vd-wrap
   ============================================================ */
.vd-wrap {
  --cyan:#00BFFF; --cyan-d:#0099CC; --dark:#0d0d0d; --dark2:#0a1628;
  --white:#fff; --off:#f5f7fa; --border:#e5e7eb; --grey:#6b7280;
  --text:#1a1a1a; --green:#10b981; --red:#e05a4d; --radius:10px;
  --font:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --mono:"Courier New",monospace;
  font-family:var(--font); color:var(--text); background:var(--white);
  border:1px solid var(--border); border-radius:var(--radius);
  box-shadow:0 4px 24px rgba(0,0,0,.09); max-width:820px; margin:2em auto; overflow:hidden;
}
.vd-header { background:linear-gradient(135deg,#0d0d0d 0%,#0a1628 100%); color:#fff; padding:24px 28px 20px; text-align:center; }
.vd-icon { margin-bottom:6px; }
.vd-title { margin:0 0 5px; font-size:1.3rem; font-weight:800; color:#fff; border:none; padding:0; line-height:1.2; }
.vd-subtitle { margin:0; font-size:.82rem; color:rgba(255,255,255,.6); line-height:1.5; }
.vd-body { padding:22px 22px 24px; }

.vd-panels { display:grid; grid-template-columns:1fr 1fr; gap:18px; margin-bottom:16px; }
.vd-panel { background:var(--off); border:1px solid var(--border); border-radius:var(--radius); padding:16px 16px 18px; }
.vd-panel-title { font-size:1rem; font-weight:800; padding-bottom:10px; margin-bottom:14px; border-bottom:2px solid var(--cyan); }
.vd-panel-out .vd-panel-title { border-bottom-color:var(--grey); }

.vd-field { display:flex; flex-direction:column; gap:5px; margin-bottom:13px; }
.vd-label { font-size:.74rem; font-weight:700; color:var(--text); }
.vd-input-row { display:flex; align-items:stretch; border:1.5px solid var(--border); border-radius:7px; background:var(--white); overflow:hidden; transition:border-color .15s, box-shadow .15s; }
.vd-input-row:focus-within { border-color:var(--cyan); box-shadow:0 0 0 3px rgba(0,191,255,.13); }
.vd-input { flex:1 1 auto; width:100%; border:none; outline:none; background:transparent; font-size:.98rem; font-weight:700; font-family:var(--font); color:var(--text); padding:10px 12px; min-width:80px; -moz-appearance:textfield; box-sizing:border-box; }
.vd-input::-webkit-outer-spin-button,.vd-input::-webkit-inner-spin-button{ -webkit-appearance:none; margin:0; }
.vd-input::placeholder { color:#b8bfc9; font-weight:400; }
.vd-unit, .vd-unit-sel { flex:0 0 auto; padding:0 10px; font-size:.85rem; font-weight:700; color:var(--grey); background:var(--off); display:flex; align-items:center; border-left:1px solid var(--border); box-sizing:border-box; }
.vd-unit { min-width:40px; justify-content:center; }
.vd-unit-sel { border:none; outline:none; cursor:pointer; font-family:var(--font); max-width:76px; width:76px; }

.vd-actions { display:flex; gap:10px; margin:16px 0 4px; }
.vd-btn { flex:1; padding:11px; border:none; border-radius:7px; font-size:.92rem; font-weight:800; cursor:pointer; font-family:var(--font); transition:all .15s; }
.vd-btn-calc { background:var(--cyan); color:#000; box-shadow:0 2px 8px rgba(0,191,255,.28); }
.vd-btn-calc:hover { background:var(--cyan-d); }
.vd-btn-reset { flex:0 0 auto; padding:11px 18px; background:var(--white); color:var(--grey); border:1.5px solid var(--border); }
.vd-btn-reset:hover { background:#e5e7eb; }

.vd-diagram { margin-top:16px; padding:12px; background:var(--white); border:1px dashed var(--border); border-radius:8px; max-width:180px; }

/* Output */
.vd-results { display:none; }
.vd-placeholder { color:var(--grey); font-size:.88rem; line-height:1.6; padding:20px 4px; text-align:center; }
.vd-hero-out { background:linear-gradient(135deg,#0d0d0d,#0a1628); border-radius:var(--radius); padding:18px 20px; text-align:center; margin-bottom:14px; }
.vd-hero-label { font-size:.72rem; font-weight:700; text-transform:uppercase; letter-spacing:.07em; color:rgba(255,255,255,.5); margin-bottom:6px; }
.vd-hero-value { font-size:2.1rem; font-weight:900; color:var(--cyan); font-family:var(--mono); line-height:1; word-break:break-all; }
.vd-out-rows { display:flex; flex-direction:column; gap:8px; }
.vd-out-row { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:10px 13px; background:var(--white); border:1px solid var(--border); border-radius:7px; }
.vd-out-row span:first-child { font-size:.78rem; color:var(--grey); font-weight:600; }
.vd-out-row span:last-child { font-size:.9rem; font-weight:800; color:var(--text); font-family:var(--mono); }

/* Under load */
.vd-load-toggle { width:100%; padding:11px 14px; border:1.5px dashed var(--border); border-radius:8px; background:var(--off); color:var(--grey); font-size:.85rem; font-weight:700; cursor:pointer; font-family:var(--font); transition:all .15s; margin-bottom:14px; }
.vd-load-toggle:hover { border-color:var(--cyan); color:var(--cyan); }
.vd-load-panel { display:none; background:var(--off); border:1px solid var(--border); border-radius:var(--radius); padding:16px; margin-bottom:14px; }
.vd-load-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:12px; }
.vd-load-card { display:flex; flex-direction:column; gap:4px; padding:11px 13px; background:var(--white); border:1px solid var(--border); border-radius:7px; }
.vd-lc-l { font-size:.72rem; color:var(--grey); font-weight:600; line-height:1.3; }
.vd-lc-v { font-size:1rem; font-weight:800; color:var(--cyan-d); font-family:var(--mono); }

.vd-msg { border-radius:7px; font-size:.85rem; font-weight:600; }
.vd-msg:not(:empty){ padding:.65em 1em; margin-bottom:14px; }
.vd-msg.vd-error { background:#fce8e6; color:#c0392b; border:1px solid #f5c6c2; }

.vd-formula { background:rgba(0,191,255,.06); border:1px solid rgba(0,191,255,.22); border-radius:8px; padding:12px 14px; font-size:.82rem; color:var(--grey); line-height:1.6; }
.vd-formula strong { color:var(--text); }

@media (max-width:640px){
  .vd-panels { grid-template-columns:1fr; }
  .vd-load-grid { grid-template-columns:1fr; }
  .vd-body { padding:14px 12px 16px; }
  .vd-diagram { max-width:150px; margin-left:auto; margin-right:auto; }
}
