/* ============================================================
 * Utilities Bunker — Coaxial Cable Loss (v2.1)
 * File: /assets/css/modules/electronics/coax-loss.v2.1.css
 * Purpose:
 * - Tool-only layout + signal path visuals + work formatting
 * - NO changes to ub-toolkit.v2.1.css
 * - Mobile-first, 44x44 touch targets, clamp typography
 * ============================================================ */

/* ============================== Local tokens (tool-scoped) ============================== */
:root{
  --coax-radius: 16px;
  --coax-gap: 14px;
  --coax-soft: rgba(0,0,0,.06);
}

/* ============================== Header bar (matches Ohm's vibe) ============================== */
.ub-headbar{
  display:flex;
  gap:10px;
  justify-content:space-between;
  align-items:center;
  flex-wrap:wrap;
}
.ub-title-h1{
  margin:0;
  font-size: var(--ub-fs-5);
}

/* ============================== Tool hero layout ============================== */
.ub-hero{
  display:grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--coax-gap);
}
/* Stack on tablet/mobile */
@media (max-width: 980px){
  .ub-hero{ grid-template-columns: 1fr; }
}

/* ============================== Signal panel ============================== */
.ub-lab{
  background: var(--ub-surface-2);
  border: 1px solid var(--ub-border);
  border-radius: var(--coax-radius);
  padding: 12px;
}

.ub-lab-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap: 10px;
  flex-wrap:wrap;
  margin-bottom: 8px;
}
.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: 122px;
  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;
}

/* ============================== Quality pill ============================== */
.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;
  margin-top: 8px;
}
.ub-dot{
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ub-muted);
}

/* ============================== Delivered power bar ============================== */
.ub-bar-wrap{
  margin-top: 12px;
}
.ub-bar-track{
  width: 100%;
  height: 14px;
  border-radius: 999px;
  border: 1px solid var(--ub-border);
  background: var(--ub-surface-3);
  overflow: hidden;
}
.ub-bar-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 6px 18px var(--ub-btn-glow);
  transition: width 140ms ease;
}
@media (prefers-reduced-motion: reduce){
  .ub-bar-fill{ transition:none; }
}
.ub-bar-meta{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-top: 8px;
  font-size: 12px;
  color: var(--ub-muted);
  font-weight: 900;
}

/* ============================== Path SVG ============================== */
.ub-path{
  width: 100%;
  height: auto;
  margin-top: 12px;
  display:block;
  border-radius: 14px;
}
#svgLossHeat{
  opacity: .06;
}
html.ub-theme-dark #svgLossHeat{
  opacity: .10;
}

/* ============================== Presets row ============================== */
.ub-preset-row{
  display:flex;
  flex-wrap:wrap;
  gap: 10px;
  margin-top: 10px;
}
.ub-preset-row .ub-chip{
  min-height: 44px;
  padding: 10px 12px;
}

/* ============================== Tool form extras ============================== */
.ub-toggle-row{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}

/* Make checkbox chips align nicely */
.ub-chip--check{
  gap: 8px;
}

/* Work area (Show Work) */
.ub-work{
  font-family: var(--ub-mono);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap:anywhere;
}

/* Collapsible summary polish (tool-level enhancement) */
.ub-collapsible summary{
  cursor:pointer;
  font-weight: 950;
  min-height: 44px;
  display:flex;
  align-items:center;
}

/* Input hint + inline error (keeps layout stable) */
.hint{
  margin-top: 6px;
  font-size: 12px;
  color: var(--ub-muted);
}
.ub-inline-error{
  margin-top: 6px;
  font-size: 12px;
  color: var(--ub-danger);
  font-weight: 800;
  min-height: 16px;
}

/* Full-width helper for rail buttons (in case toolkit doesn't define it) */
.ub-btn--block{ width:100%; }

/* Small screens polish */
@media (max-width: 520px){
  .ub-kpi{ min-width: 108px; }
}

/* Optional: tighten ordered list spacing in How-to */
.ub-olist{
  margin:0;
  padding-left:18px;
}
.ub-olist li{
  margin: 6px 0;
}
