/* Three-phase power calculator (/three-phase-power-calculator/), added
   2026-10-13. Every selector is scoped to .wm-3ph (the tool's card).
   Inputs on the left, live result on the right; one column under 860 px.
   Tap targets are at least 40 px. */

.wm-3ph .wm-3ph-top { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.wm-3ph .wm-tabs { margin-bottom: 0; }
.wm-3ph .wm-tabs button { min-height: 40px; }
.wm-3ph .wm-3ph-bar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.wm-3ph .wm-3ph-g { display: flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 600; color: var(--wm-mute); }
.wm-3ph .wm-3ph-g .wm-seg button { min-height: 40px; min-width: 52px; font-size: .82rem; letter-spacing: 0; }
.wm-3ph .wm-3ph-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 22px; align-items: start; }
.wm-3ph .wm-3ph-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; align-items: end; }
.wm-3ph .wm-3ph-fld { display: flex; flex-direction: column; justify-content: flex-end; gap: 5px; font-size: .86rem; font-weight: 600; color: var(--wm-text); min-width: 0; }
.wm-3ph .wm-3ph-fld.wide { grid-column: 1 / -1; }
.wm-3ph .wm-3ph-fld .lab { line-height: 1.3; }
.wm-3ph .wm-3ph-sect { grid-column: 1 / -1; margin: 8px 0 0; padding-top: 12px; border-top: 1px dashed var(--wm-line); font-size: .84rem; font-weight: 700; color: var(--wm-green); }
.wm-3ph .wm-3ph-in { display: flex; align-items: stretch; border: 1px solid var(--wm-line); border-radius: 8px; background: #fff; overflow: hidden; }
.wm-3ph .wm-3ph-in:focus-within { outline: 2px solid var(--wm-green-2); outline-offset: 1px; }
.wm-3ph .wm-3ph-in .wm-field { border: 0; border-radius: 0; font: 1.05rem var(--wm-math); padding: 8px 10px; min-height: 42px; flex: 1 1 auto; width: 100%; min-width: 0; outline: none; }
.wm-3ph .wm-3ph-in .wm-field:focus-visible { outline: none; }
.wm-3ph .wm-3ph-in .u { display: flex; align-items: center; padding: 0 10px; background: var(--wm-soft); border-left: 1px solid var(--wm-line); color: var(--wm-mute); font-size: .88rem; font-weight: 600; white-space: nowrap; }
.wm-3ph .wm-3ph-in:has([aria-invalid="true"]) { border-color: var(--wm-err); background: var(--wm-err-bg); }
.wm-3ph .wm-3ph-fld > select.wm-field { min-height: 42px; font-size: .95rem; cursor: pointer; }
.wm-3ph .wm-3ph-fld .wm-3ph-seg { display: flex; width: 100%; }
.wm-3ph .wm-3ph-fld .wm-3ph-seg button { flex: 1 1 0; min-height: 40px; font-size: .84rem; letter-spacing: 0; padding: 0 6px; }

.wm-3ph .wm-out { margin-top: 0; }
.wm-3ph .wm-result b { font-weight: 700; }
.wm-3ph .wm-3ph-sub { font: .95rem 'Segoe UI', system-ui, sans-serif; color: var(--wm-mute); }
.wm-3ph .wm-stat-cards { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
.wm-3ph .wm-3ph-tri { display: block; width: 100%; max-width: 440px; height: auto; margin: 14px 0 0; }
.wm-3ph .wm-3ph-work { margin-top: 14px; }
.wm-3ph .wm-3ph-work > summary { padding: 8px 0; }
.wm-3ph .wm-steps .m { font-size: .95rem; overflow-wrap: anywhere; }
.wm-3ph .wm-note { line-height: 1.5; }
.wm-3ph .wm-3ph-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.wm-3ph .wm-3ph-actions .wm-btn { min-height: 40px; }

/* line / phase table and the bank-step table */
.wm-3ph .wm-3ph-tbl { margin: 14px 0 0; }
.wm-3ph .wm-3ph-tbl table { font-size: .9rem; }
.wm-3ph .wm-3ph-tbl caption { caption-side: top; text-align: left; font-size: .84rem; font-weight: 600; color: var(--wm-text); padding: 0 0 6px; }
.wm-3ph .wm-3ph-tbl th { text-transform: none; letter-spacing: 0; font-size: .8rem; padding: 8px 10px; }
.wm-3ph .wm-3ph-tbl td { padding: 8px 10px; font-variant-numeric: tabular-nums; }
.wm-3ph .wm-3ph-tbl td:nth-child(2) { white-space: nowrap; }
.wm-3ph .wm-3ph-tbl tbody th { background: transparent; border-bottom: 1px solid #f1f5f9; font-weight: 600; color: var(--wm-text); }
.wm-3ph .wm-3ph-row-danger td { background: #fef2f2 !important; color: #991b1b; }
.wm-3ph .wm-3ph-row-warn td { background: #fffbeb !important; color: #92400e; }

/* resonance verdict */
.wm-3ph .wm-3ph-resbox { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--wm-line); }
.wm-3ph .wm-3ph-ok, .wm-3ph .wm-3ph-warn, .wm-3ph .wm-3ph-danger { border-radius: 10px; padding: 10px 14px; font-size: .92rem; line-height: 1.5; }
.wm-3ph .wm-3ph-ok { background: var(--wm-green-bg); border: 1px solid var(--wm-green-line); color: #14532d; }
.wm-3ph .wm-3ph-warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.wm-3ph .wm-3ph-danger { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

@media (max-width: 860px) {
  .wm-3ph .wm-3ph-grid { grid-template-columns: 1fr; gap: 16px; }
}
@media (max-width: 520px) {
  .wm-3ph .wm-3ph-top { flex-direction: column; align-items: stretch; }
  .wm-3ph .wm-3ph-bar { justify-content: flex-start; flex-wrap: nowrap; gap: 10px; }
  /* the buttons (50 Hz, 60 Hz, kW, hp) say what they are; labels stay for screen readers */
  .wm-3ph .wm-3ph-g > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 400px) {
  .wm-3ph .wm-3ph-fields { gap: 10px; }
  .wm-3ph .wm-3ph-in .u { padding: 0 7px; }
  .wm-3ph .wm-3ph-fld .wm-3ph-seg button { font-size: .78rem; padding: 0 3px; }
  .wm-3ph .wm-3ph-g { gap: 6px; }
  .wm-3ph .wm-3ph-g .wm-seg button { min-width: 46px; }
}

/* long link examples in the article must wrap on a 360 px phone */
body:has(.wm-3ph) .content code { overflow-wrap: anywhere; }

/* print: the tool and its working, without the site chrome */
@media print {
  body:has(.wm-3ph) .nav, body:has(.wm-3ph) .breadcrumb, body:has(.wm-3ph) .wm-examples, body:has(.wm-3ph) footer,
  body:has(.wm-3ph) .related, body:has(.wm-3ph) .author-box, body:has(.wm-3ph) ins.adsbygoogle, body:has(.wm-3ph) .content { display: none !important; }
  .wm-3ph .wm-3ph-actions, .wm-3ph .wm-tabs button[aria-selected="false"] { display: none !important; }
  .wm-3ph { box-shadow: none; border-color: #cbd5e1; }
  .wm-3ph .wm-3ph-grid { grid-template-columns: 1fr 1fr; }
}
