/* ============================================================
   Utilities Bunker — AWG Current Capacity (v2.1)
   File: /assets/css/modules/electronics/awg-current.v2.1.css
   Purpose:
   - Tool-only layout + table + KPIs styling
   - Mobile-first, 44x44 targets, fluid type via clamp()
   Notes:
   - DO NOT modify /assets/css/ub-toolkit.v2.1.css
   ============================================================ */

/* ============================== Local tokens (tool-scoped) ============================== */
:root{
  --awg-radius: 16px;
  --awg-gap: 14px;
}

/* ============================== Header row helper ============================== */
.ub-headrow{
  display:flex;
  gap:10px;
  justify-content:space-between;
  align-items:center;
  flex-wrap:wrap;
}

/* ============================== Tool grid ============================== */
.ub-toolgrid{
  display:grid;
  grid-template-columns: 1fr 0.95fr;
  gap: var(--awg-gap);
  align-items:start;
}

@media (max-width: 980px){
  .ub-toolgrid{
    grid-template-columns: 1fr;
  }
}

/* Make inner panel look like a "sub card" without changing toolkit */
.ub-panel{
  border-radius: var(--awg-radius);
}

/* ============================== Quick reference KPIs ============================== */
.ub-mini{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
  margin-top: 10px;
}

@media (max-width: 520px){
  .ub-mini{
    grid-template-columns: 1fr;
  }
}

.ub-mini-kpi{
  border: 1px solid var(--ub-border);
  background: var(--ub-surface-2);
  border-radius: 14px;
  padding: 10px 12px;
  min-height: var(--ub-hit);
}

.ub-mini-kpi .k{
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ub-muted);
}

.ub-mini-kpi .v{
  margin-top: 4px;
  font-family: var(--ub-mono);
  font-weight: 950;
  font-size: clamp(14px, 0.95rem + 0.25vw, 16px);
}

/* ============================== Table wrap ============================== */
.ub-table-wrap{
  margin-top: 12px;
  overflow:auto;
  border-radius: var(--ub-radius-2);
}

/* Active row highlight (selected gauge) */
#refTable .ub-row-active td{
  background: rgba(249,58,19,.08);
}

html.ub-theme-dark #refTable .ub-row-active td{
  background: rgba(249,58,19,.14);
}

/* Keep table cells readable on small screens */
#refTable th,
#refTable td{
  vertical-align: top;
}

/* ============================== Work box ============================== */
.ub-work{
  font-family: var(--ub-mono);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ============================== Inputs polish ============================== */
.ub-field select,
.ub-field input{
  border-color: var(--ub-border);
}

/* Ensure selects are tall enough and finger-friendly */
.ub-field select{
  min-height: var(--ub-hit);
}

/* Improve focus visibility on tool-only interactive regions */
.ub-mini-kpi:focus-within,
.ub-table-wrap:focus-within{
  outline: none;
  box-shadow: 0 0 0 4px var(--ub-focus);
  border-radius: var(--ub-radius-2);
}

/* ============================== Responsive niceties ============================== */
/* Mobile Portrait: 320–480 */
@media (max-width: 480px){
  .ub-card{
    padding: 12px;
  }
}

/* Large screens (4K/ultrawide): keep tool from feeling stretched */
@media (min-width: 1441px){
  .ub-toolgrid{
    grid-template-columns: 1.05fr 0.95fr;
  }
}
