/* ============================================================
   Tool Styles — Motor Inrush Current v2.1
   File: /assets/css/modules/electronics/motor-inrush-current.v2.1.css
   Purpose:
   - Tool-only layout + motor surge visuals + work formatting
   - No changes to ub-toolkit.v2.1.css
   - Mobile-first, 44x44 touch targets, clamp typography
   ============================================================ */

/* ============================== Local tokens (tool-scoped) ============================== */
:root{
  --mic-radius: 16px;
  --mic-gap: 14px;
}

/* ============================== Header row (keeps H1 + theme toggle uniform) ============================== */
.ub-headrow{
  display:flex;
  gap:10px;
  justify-content:space-between;
  align-items:center;
  flex-wrap:wrap;
}
.ub-head-title{
  margin:0;
}
.ub-head-sub{
  margin:6px 0 0;
}

/* ============================== Tool hero layout ============================== */
.ub-hero{
  display:grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--mic-gap);
}

/* Stack on tablet/mobile */
@media (max-width: 980px){
  .ub-hero{ grid-template-columns: 1fr; }
}

/* ============================== Lab panel ============================== */
.ub-lab{
  background: var(--ub-surface-2);
  border: 1px solid var(--ub-border);
  border-radius: var(--mic-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;
}

.ub-lab-bar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 10px;
  flex-wrap:wrap;
}

/* ============================== 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;
}

/* ============================== Risk 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; /* touch target */
}
.ub-dot{
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ub-muted);
}

/* ============================== Start chips (tool) ============================== */
.ub-wheel{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
}
.ub-wheel .ub-chip{
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--ub-border);
  background: var(--ub-chip-bg);
  color: var(--ub-chip-text);
  font-weight: 900;
  cursor: pointer;
  user-select:none;
}
.ub-wheel .ub-chip:hover{
  background: var(--ub-chip-hover);
}
.ub-wheel .ub-chip[aria-pressed="true"]{
  border-color: rgba(249,58,19,.55);
  box-shadow: 0 0 0 4px rgba(249,58,19,.12);
}

/* ============================== Motor visualization SVG ============================== */
.ub-motorviz{
  width: 100%;
  height: auto;
  margin-top: 10px;
  display:block;
  border-radius: 14px;
}

/* Pulse animation driven by JS (duration set inline) */
@keyframes ub-pulse{
  0%{ stroke-dashoffset: 44; opacity: .50; }
  50%{ opacity: .95; }
  100%{ stroke-dashoffset: 0; opacity: .55; }
}
.ub-pulse{
  stroke-dasharray: 10 12;
  animation: ub-pulse 900ms linear infinite;
}

/* Heat overlay set by JS opacity; slightly higher in dark */
#svgHeat{
  opacity: .05;
}
html.ub-theme-dark #svgHeat{
  opacity: .09;
}

/* Accessible focus ring for any future SVG tabindex items */
.ub-motorviz [tabindex]:focus{
  outline: none;
  box-shadow: 0 0 0 4px var(--ub-focus);
  border-radius: 10px;
}

/* ============================== 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;
}

/* ============================== Range slider row polish ============================== */
.ub-slider-row{
  display:flex;
  gap: 10px;
  align-items:center;
  flex-wrap:wrap;
}

/* ============================== Work area formatting ============================== */
.ub-work{
  font-family: var(--ub-mono);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap:anywhere;
}

/* Improve details/summary click target (tool-level) */
.ub-collapsible summary{
  cursor:pointer;
  font-weight: 950;
  min-height: 44px;
  display:flex;
  align-items:center;
}

/* Rail button helper (tool-only, safe even if toolkit also defines it) */
.ub-btn--block{ width: 100%; }

/* Small screens: make KPI tiles slightly narrower */
@media (max-width: 520px){
  .ub-kpi{ min-width: 98px; }
}

/* ============================== Container query hook (optional) ============================== */
.ub-lab.ub-cq{
  container-type: inline-size;
}
@container (max-width: 520px){
  .ub-wheel{
    grid-template-columns: 1fr;
  }
}
