/* ============================================================
 * Utilities Bunker — Resistor Color Picker & Calculator (v2.1)
 * File: /assets/css/modules/electronics/resistor-color-picker.v2.1.css
 * Purpose:
 * - Tool-only layout + resistor preview + band picker polish
 * - Mobile-first, 44x44 touch targets, clamp typography
 * Notes:
 * - Do NOT modify ub-toolkit.v2.1.css
 * - Keep visuals scoped to this tool only
 * ============================================================ */

/* ============================== Local tokens (tool-scoped) ============================== */
:root{
  --rpp-radius: 16px;
  --rpp-gap: 14px;
  --rpp-soft: rgba(0,0,0,.06);
}

/* ============================== Tool hero layout ============================== */
.ub-rpp-hero{
  display:grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--rpp-gap);
}

/* Stack on tablet/mobile */
@media (max-width: 980px){
  .ub-rpp-hero{ grid-template-columns: 1fr; }
}

/* ============================== Preview / Lab panel ============================== */
.ub-rpp-lab{
  background: var(--ub-surface-2);
  border: 1px solid var(--ub-border);
  border-radius: var(--rpp-radius);
  padding: 12px;
}

.ub-rpp-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap: 10px;
  flex-wrap:wrap;
  margin-bottom: 8px;
}

.ub-rpp-title{
  font-size: clamp(13px, 1.2vw, 14px);
  font-weight: 950;
  letter-spacing: .01em;
}

.ub-rpp-sub{
  font-size: 12px;
  color: var(--ub-muted);
  margin-top: 2px;
}

/* KPI tiles come from toolkit, but ensure tight wrap here */
.ub-rpp-lab .ub-kpis{
  justify-content:flex-end;
}

/* ============================== Band count wheel ============================== */
.ub-rpp-wheel{
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 10px;
}

.ub-rpp-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-rpp-wheel .ub-chip:hover{ background: var(--ub-chip-hover); }

.ub-rpp-wheel .ub-chip[aria-pressed="true"]{
  border-color: rgba(249,58,19,.55);
  box-shadow: 0 0 0 4px rgba(249,58,19,.12);
}

/* ============================== Resistor SVG preview ============================== */
.ub-rpp-resistor{
  width: 100%;
  height: auto;
  margin-top: 10px;
  display:block;
  border-radius: 14px;
}

/* Band rectangles */
.ub-rpp-resistor .rpp-band{
  transition: fill 120ms ease, opacity 120ms ease;
}

/* ============================== 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;
}

/* ============================== Form / picker polish ============================== */
.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; /* keeps layout stable */
}

/* Make selects feel "color-picky" without heavy UI */
.ub-field select{
  font-weight: 900;
}

/* ============================== Outputs / work area ============================== */
.ub-work{
  font-family: var(--ub-mono);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap:anywhere;
}

/* Details styling enhancement (tool-only) */
.ub-collapsible summary{
  cursor:pointer;
  font-weight: 950;
  min-height: 44px;
  display:flex;
  align-items:center;
}

.ub-collapsible summary:focus{
  outline: none;
  box-shadow: 0 0 0 4px var(--ub-focus);
  border-radius: 12px;
}

/* ============================== Rail helper ============================== */
.ub-btn--block{ width: 100%; }

/* ============================== Small screens polish ============================== */
@media (max-width: 520px){
  .ub-rpp-wheel{ grid-template-columns: 1fr; }
  .ub-kpi{ min-width: 98px; }
}
