/* ============================================================
   Utilities Bunker — Oscillator Drift v2.1
   File: /assets/css/modules/electronics/osc-drift.v2.1.css
   Purpose:
   - Tool-only layout + dashboard visuals + work formatting
   - Mobile-first, 44x44 touch targets, clamp typography
   - No changes to ub-toolkit.v2.1.css
   ============================================================ */

/* ==============================
   Local tokens (tool-scoped)
   ============================== */
:root{
  --od-radius: 16px;
  --od-gap: 14px;
  --od-soft: rgba(0,0,0,.06);
}

/* ==============================
   Header row (H1 + theme + print)
   ============================== */
.ub-headrow{
  display:flex;
  gap: 12px;
  justify-content:space-between;
  align-items:flex-start;
  flex-wrap:wrap;
}
.ub-headrow-title{
  margin:0;
  font-size: var(--ub-fs-5);
}
.ub-headrow-sub{
  margin:6px 0 0;
}
.ub-headrow-actions{
  display:flex;
  gap: 10px;
  flex-wrap:wrap;
  align-items:center;
}
.ub-headrow-actions .ub-btn{
  min-height: var(--ub-hit);
}

/* ==============================
   Hero layout (dashboard + inputs)
   ============================== */
.ub-hero{
  display:grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: var(--od-gap);
}

/* Stack on tablet/mobile */
@media (max-width: 980px){
  .ub-hero{ grid-template-columns: 1fr; }
}

/* ==============================
   Dashboard panel (lab)
   ============================== */
.ub-lab{
  background: var(--ub-surface-2);
  border: 1px solid var(--ub-border);
  border-radius: var(--od-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: 132px;
  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;
  overflow-wrap:anywhere;
}

/* ==============================
   Status pill (Risk-ish)
   ============================== */
.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-bottom: 10px;
}
.ub-dot{
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ub-muted);
}

/* ==============================
   Mini breakdown rows
   ============================== */
.ub-mini{
  margin-top: 6px;
  border: 1px solid var(--ub-border);
  background: var(--ub-card-bg);
  border-radius: 14px;
  overflow:hidden;
}
.ub-mini-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0,0,0,.06);
}
html.ub-theme-dark .ub-mini-row{
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.ub-mini-row:last-child{ border-bottom: 0; }
.ub-mini-row .k{
  font-size: 12px;
  font-weight: 900;
  color: var(--ub-muted);
}
.ub-mini-row .v{
  font-family: var(--ub-mono);
  font-weight: 950;
  font-size: 13px;
  overflow-wrap:anywhere;
}

/* ==============================
   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;
}

/* Details enhancements (tool-safe) */
.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 (tool-only, but safe if toolkit also has it) */
.ub-btn--block{ width: 100%; }

/* Small screens polish */
@media (max-width: 520px){
  .ub-kpi{ min-width: 118px; }
}

/* Print friendliness */
@media print{
  .ub-rail-togglebar,
  .ub-rail,
  #ubRailBackdrop,
  #btnCopy,
  #btnShare{
    display:none !important;
  }
  .ub-shell{ max-width: none; padding: 0; }
  .ub-card{ box-shadow: none; }
}
