/* ============================================================
 * Utilities Bunker — RMS Voltage ↔ dBV (v2.1)
 * File: /assets/css/modules/electronics/dbv.v2.1.css
 * Purpose:
 * - Tool-only layout + meter visuals + work formatting
 * - No changes to ub-toolkit.v2.1.css
 * Notes:
 * - Mobile-first, 44x44 touch targets, clamp typography
 * ============================================================ */

/* ============================== Local tokens (tool-scoped) ============================== */
:root{
  --dbv-radius: 16px;
  --dbv-gap: 14px;
}

/* ============================== Header row helper ============================== */
.ub-headrow{
  display:flex;
  gap:10px;
  justify-content:space-between;
  align-items:center;
  flex-wrap:wrap;
}

/* ============================== Tool hero layout ============================== */
.ub-hero{
  display:grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--dbv-gap);
}
@media (max-width: 980px){
  .ub-hero{ grid-template-columns: 1fr; }
}

/* ============================== How-to ordered list polish ============================== */
.ub-ol{
  margin:0;
  padding-left:18px;
}
.ub-ol li{ margin: 6px 0; }

/* ============================== HR helper ============================== */
.ub-hr{
  border:none;
  border-top:1px solid var(--ub-border);
  margin:14px 0;
}

/* ============================== Options row ============================== */
.ub-options{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}

/* ============================== Actions ============================== */
.ub-actions{
  margin-top:12px;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

/* ============================== Lab panel ============================== */
.ub-lab{
  background: var(--ub-surface-2);
  border: 1px solid var(--ub-border);
  border-radius: var(--dbv-radius);
  padding: 12px;
}
.ub-lab-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap: 10px;
  flex-wrap:wrap;
  margin-bottom: 10px;
}
.ub-lab-title{
  font-size: clamp(13px, 1.2vw, 14px);
  font-weight: 950;
  letter-spacing: .01em;
}
.ub-lab-sub{
  font-size: 12px;
  color: var(--ub-muted);
  margin-top: 2px;
}

/* ============================== KPI tiles ============================== */
.ub-kpis{
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
  justify-content:flex-end;
}
.ub-kpi{
  min-width: 112px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid var(--ub-border);
  background: var(--ub-card-bg);
}
.ub-kpi .k{
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ub-muted);
}
.ub-kpi .v{
  font-family: var(--ub-mono);
  font-weight: 950;
  font-size: 14px;
  margin-top: 2px;
}

/* ============================== Level pill (uses toolkit tokens) ============================== */
.ub-risk{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--ub-border);
  background: var(--ub-card-bg);
  font-size: 12px;
  font-weight: 950;
  min-height: 44px;
}
.ub-dot{
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ub-muted);
}

/* ============================== Meter block ============================== */
.ub-meter{
  margin-top: 10px;
  border-radius: var(--dbv-radius);
  border: 1px solid var(--ub-border);
  background: var(--ub-card-bg);
  padding: 12px;
}
.ub-meter-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom: 10px;
}
.ub-meter-mini{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

/* meter bar */
.ub-meter-bar{
  height: 14px;
  border-radius: 999px;
  border: 1px solid var(--ub-border);
  background: var(--ub-surface-3);
  overflow:hidden;
}
.ub-meter-fill{
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(92deg, var(--ub-btn-grad-a), var(--ub-btn-grad-b));
  box-shadow: 0 10px 22px var(--ub-btn-glow);
}

/* meter foot */
.ub-meter-foot{
  margin-top: 10px;
  font-size: 12px;
  color: var(--ub-muted);
}

/* Presets row */
.ub-preset-row{
  display:flex;
  flex-wrap:wrap;
  gap: 10px;
  margin-top: 12px;
}
.ub-preset-row .ub-chip{
  min-height: 44px;
  padding: 10px 12px;
}

/* ============================== Work area formatting ============================== */
.ub-work{
  font-family: var(--ub-mono);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap:anywhere;
}
.ub-work-note{
  margin-top:10px;
  color: var(--ub-muted);
  font-size: 12px;
}

/* ============================== Table wrap (scroll on narrow) ============================== */
.ub-table-wrap{
  overflow:auto;
  border-radius: var(--ub-radius-2);
}

/* ============================== FAQ headings (tool local) ============================== */
.ub-h3{
  margin: 12px 0 6px;
  font-size: var(--ub-fs-2);
  font-weight: 950;
}
.ub-p{
  margin: 0 0 10px;
  font-size: var(--ub-fs-2);
}

/* ============================== Rail block button helper ============================== */
.ub-btn--block{ width: 100%; }

/* ============================== Small screens polish ============================== */
@media (max-width: 520px){
  .ub-kpi{ min-width: 98px; }
}
