/* WideMath complex number and phasor calculator (2026-10-13).
   Loaded after wm-tools.css. Every selector is scoped to .wmc (the tool card),
   except the print rules, which only apply on a page that contains .wmc. */

.wmc .wmc-angle, .wmc .wmc-conn { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.wmc .wmc-conn { margin-top: 14px; }
.wmc .wmc-lbl { font-size: .86rem; font-weight: 600; color: var(--wm-text); }
.wmc .wm-seg button { min-height: 42px; padding: 0 14px; font-size: .84rem; letter-spacing: 0; }
.wmc .wm-seg button:focus-visible { outline: 2px solid var(--wm-green-2); outline-offset: -2px; }
.wmc #wmc-hint code, .wmc .wm-note code { font-size: .86rem; }

/* symbol keys under the expression box */
.wmc .wmc-keys { border: 0; padding: 10px 0 0; background: none; gap: 5px; }
.wmc .wmc-keys button { min-width: 44px; min-height: 40px; padding: 0 8px; }

/* every form of the result */
.wmc .wmc-forms { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 8px; margin-top: 12px; }
.wmc .wmc-forms div { background: var(--wm-soft); border: 1px solid var(--wm-line); border-radius: 10px; padding: 9px 12px; min-width: 0; }
.wmc .wmc-forms span { display: block; font-size: .76rem; color: var(--wm-mute); }
.wmc .wmc-forms b { display: block; font: 600 1.02rem/1.4 var(--wm-math); color: var(--wm-ink); overflow-wrap: anywhere; }
.wmc .wm-result b { font-weight: 700; }
.wmc .wmc-alt { color: var(--wm-mute); font-size: 1rem; }
.wmc .wmc-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; align-items: center; }
.wmc .wmc-actions .wm-btn { min-height: 40px; }
.wmc .wmc-copied { font-size: .84rem; color: var(--wm-green); font-weight: 600; }

/* working and the diagrams */
.wmc .wmc-split { align-items: start; }
.wmc .wmc-split details > summary { padding: 6px 0; }
.wmc .wmc-fig { margin: 0 0 14px; }
.wmc .wmc-argand, .wmc .wmc-tri { width: 100%; max-width: 400px; height: auto; display: block; margin: 0 auto; background: #fff; border: 1px solid var(--wm-line); border-radius: 12px; }
.wmc .wmc-tri { max-width: 320px; }
.wmc svg text.t { font: 10px 'Segoe UI', system-ui, sans-serif; fill: #94a3b8; }
.wmc svg text.ax { font: italic 12px var(--wm-math); fill: #64748b; }
.wmc svg text.lb { font: 600 12px 'Segoe UI', system-ui, sans-serif; }
.wmc svg text.th { font: italic 14px var(--wm-math); fill: #15803d; }
.wmc figcaption { display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: center; font: .9rem/1.5 var(--wm-math); color: var(--wm-text); margin-top: 8px; }
.wmc figcaption i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.wmc .wmc-dash { color: var(--wm-mute); width: 100%; text-align: center; font: .8rem 'Segoe UI', system-ui, sans-serif; }
.wmc .wmc-h { font-size: 1rem; margin: 18px 0 6px; padding: 0; border: 0; }
.wmc .wmc-table { font: .95rem var(--wm-math); }
.wmc .wmc-table td, .wmc .wmc-table th { white-space: nowrap; }
.wmc .wmc-table th { text-transform: none; letter-spacing: 0; font: 600 .82rem 'Segoe UI', system-ui, sans-serif; }
.wmc .wmc-principal td { font-weight: 700; color: var(--wm-green); }

/* AC circuit inputs */
.wmc .wmc-in { display: flex; gap: 6px; align-items: center; }
.wmc .wmc-in input { width: 120px; }
.wmc .wmc-in select { width: auto; }
.wmc .wmc-u { font: 1.05rem var(--wm-math); color: var(--wm-mute); min-width: 12px; }
.wmc .wmc-parts { display: flex; flex-direction: column; gap: 10px; margin: 14px 0 10px; }
.wmc .wmc-part { display: grid; grid-template-columns: 170px minmax(90px, 200px) 96px 44px minmax(0, 1fr); gap: 6px; align-items: center; }
.wmc .wmc-part .wm-field { min-height: 42px; font-size: .98rem; }
.wmc .wmc-part input.wm-field { font-family: var(--wm-math); }
.wmc .wmc-part .wmc-pz { font: .95rem var(--wm-math); color: var(--wm-mute); padding-left: 8px; overflow-wrap: anywhere; }
.wmc .wmc-del { justify-content: center; min-height: 42px; font-size: 1.15rem; padding: 0; }
.wmc .wmc-del:disabled { opacity: .4; cursor: not-allowed; }
.wmc [data-k="add"] { min-height: 40px; }
@media (max-width: 600px) {
  .wmc .wmc-part { grid-template-columns: minmax(0, 1fr) 92px 44px; }
  .wmc .wmc-part [data-p="t"] { grid-column: 1 / 3; }
  .wmc .wmc-part [data-p="v"] { grid-column: 1 / 2; grid-row: 2; }
  .wmc .wmc-part [data-p="u"] { grid-column: 2 / 4; grid-row: 2; }
  .wmc .wmc-part .wmc-pz { grid-row: 3; grid-column: 1 / -1; padding-left: 0; margin-top: -2px; font-size: .9rem; }
  .wmc .wmc-in input { width: 100px; }
  .wmc .wm-tabs button { font-size: .78rem; }
}

/* lab and exam sheets: print the tool and the working, not the page chrome */
@media print {
  body:has(.wmc) .nav, body:has(.wmc) .breadcrumb, body:has(.wmc) .wm-examples, body:has(.wmc) footer, body:has(.wmc) .related,
  body:has(.wmc) .author-box, body:has(.wmc) ins.adsbygoogle, body:has(.wmc) .content, body:has(.wmc) .wm-disclaimer { display: none !important; }
  .wmc .wmc-keys, .wmc .wmc-actions, .wmc .wm-tabs, .wmc [data-k="add"], .wmc .wmc-del { display: none !important; }
  .wmc { box-shadow: none; border: 0; }
  .wmc details { display: block; }
  .wmc .wmc-split { grid-template-columns: 1fr; }
}
