/* ============================================================
 * Utilities Bunker — Clock Duty Cycle (v2.1)
 * File: /assets/css/modules/electronics/clk-duty.v2.1.css
 * Purpose:
 * - Tool-only layout + waveform preview visuals + work formatting
 * - Mobile-first, 44x44 touch targets, clamp typography
 * - NO changes to ub-toolkit.v2.1.css
 * ============================================================ */

/* ============================== Local tokens (tool-scoped) ============================== */
:root{
  --clk-radius: 16px;
  --clk-gap: 14px;
}

/* ============================== Hero layout ============================== */
.ub-duty-hero{
  display:grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--clk-gap);
}

/* Stack on tablet/mobile */
@media (max-width: 980px){
  .ub-duty-hero{ grid-template-columns: 1fr; }
}

/* ============================== Waveform Lab panel ============================== */
.ub-duty-lab{
  background: var(--ub-surface-2);
  border: 1px solid var(--ub-border);
  border-radius: var(--clk-radius);
  padding: 12px;
}

.ub-duty-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap: 10px;
  flex-wrap:wrap;
  margin-bottom: 8px;
}

.ub-duty-title{
  font-size: clamp(13px, 1.2vw, 14px);
  font-weight: 950;
  letter-spacing: .01em;
}

.ub-duty-sub{
  font-size: 12px;
  color: var(--ub-muted);
  margin-top: 2px;
}

/* KPI tiles reused from toolkit (.ub-kpis/.ub-kpi). No overrides needed. */

/* ============================== Hint pill ============================== */
.ub-duty-pill{
  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;
}

/* dot uses .ub-dot from toolkit; keep compatible */
.ub-duty-pill .ub-dot{
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ub-muted);
}

/* ============================== Solve wheel chips (tool) ============================== */
.ub-duty-wheel{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
  margin-top: 10px;
}

.ub-duty-wheel .ub-chip{
  min-height: 44px;
  padding: 10px 12px;
}

/* Highlight pressed chip */
.ub-duty-wheel .ub-chip[aria-pressed="true"]{
  border-color: rgba(249,58,19,.55);
  box-shadow: 0 0 0 4px rgba(249,58,19,.12);
}

/* ============================== Waveform SVG ============================== */
.ub-duty-wave{
  width: 100%;
  height: auto;
  margin-top: 10px;
  display:block;
  border-radius: 14px;
}

/* Dark mode polish for text strokes inside SVG (best-effort) */
html.ub-theme-dark .ub-duty-wave text{
  fill: rgba(255,255,255,.70);
}
html.ub-theme-dark .ub-duty-wave path,
html.ub-theme-dark .ub-duty-wave line,
html.ub-theme-dark .ub-duty-wave rect{
  stroke: rgba(255,255,255,.22);
}

/* Duty fill stronger in dark (still subtle) */
html.ub-theme-dark #dutyFill{
  fill: rgba(249,58,19,.28);
}

/* ============================== Presets row ============================== */
.ub-duty-presets{
  display:flex;
  flex-wrap:wrap;
  gap: 10px;
  margin-top: 10px;
}

.ub-duty-presets .ub-chip{
  min-height: 44px;
  padding: 10px 12px;
}

/* ============================== Work formatting ============================== */
.ub-work{
  font-family: var(--ub-mono);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap:anywhere;
}

/* Details/summary enhancement (safe even if toolkit styles exist) */
.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;
}

/* ============================== Full-width rail buttons helper ============================== */
.ub-btn--block{ width: 100%; }

/* ============================== Small screens polish ============================== */
@media (max-width: 520px){
  .ub-kpi{ min-width: 98px; }
  .ub-duty-wheel{ grid-template-columns: 1fr; }
}
