/* Battery calculator (/battery-calculator/), added 2026-10-13.
   Every selector is scoped to .wm-bat (the tool's card), so nothing here
   can touch another tool. Layout: inputs on the left, live result on the
   right; one column under 860 px. Tap targets are at least 40 px. */

.wm-bat .wm-tabs { margin-bottom: 16px; }
.wm-bat .wm-tabs button { min-height: 40px; }
.wm-bat .wm-bat-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 22px; align-items: start; }
.wm-bat .wm-bat-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; align-items: end; }
.wm-bat .wm-bat-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-bat .wm-bat-fld.wide { grid-column: 1 / -1; }
.wm-bat .wm-bat-fld .lab { line-height: 1.3; }
.wm-bat .wm-bat-in { display: flex; align-items: stretch; border: 1px solid var(--wm-line); border-radius: 8px; background: #fff; overflow: hidden; }
.wm-bat .wm-bat-in:focus-within { outline: 2px solid var(--wm-green-2); outline-offset: 1px; }
.wm-bat .wm-bat-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-bat .wm-bat-in .wm-field:focus-visible { outline: none; }
.wm-bat .wm-bat-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-bat .wm-bat-in select.wm-bat-unit { flex: 0 0 auto; width: auto; border-left: 1px solid var(--wm-line); background: var(--wm-soft); font: 600 .88rem 'Segoe UI', system-ui, sans-serif; color: var(--wm-text); padding: 0 4px 0 8px; cursor: pointer; }
.wm-bat .wm-bat-in:has([aria-invalid="true"]) { border-color: var(--wm-err); background: var(--wm-err-bg); }
.wm-bat .wm-bat-fld > select.wm-field { min-height: 42px; font-size: .95rem; cursor: pointer; }
.wm-bat .wm-bat-check { flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; min-height: 40px; cursor: pointer; }
.wm-bat .wm-bat-check input { width: 20px; height: 20px; margin: 0; accent-color: var(--wm-green); flex: none; }
.wm-bat .wm-bat-check input:focus-visible { outline: 2px solid var(--wm-green-2); outline-offset: 2px; }
.wm-bat .wm-bat-seg { display: flex; width: 100%; }
.wm-bat .wm-bat-seg button { flex: 1 1 0; min-height: 40px; font-size: .84rem; letter-spacing: 0; padding: 0 6px; }

.wm-bat .wm-out { margin-top: 0; }
.wm-bat .wm-result b { font-weight: 700; }
.wm-bat .wm-bat-sub { font: .95rem 'Segoe UI', system-ui, sans-serif; color: var(--wm-mute); }
.wm-bat .wm-stat-cards { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
.wm-bat .wm-bat-gauge { display: block; width: 100%; max-width: 300px; height: auto; margin: 14px 0 0; }
.wm-bat .wm-bat-layout { display: block; width: 100%; max-width: 620px; height: auto; margin: 14px 0 0; border: 1px solid var(--wm-line); border-radius: 10px; background: #fff; }
.wm-bat .wm-bat-work { margin-top: 14px; }
.wm-bat .wm-bat-work > summary { padding: 8px 0; }
.wm-bat .wm-steps .m { font-size: .95rem; overflow-wrap: anywhere; }
.wm-bat .wm-note { line-height: 1.5; }
.wm-bat .wm-bat-warn { color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 8px 10px; }
.wm-bat .wm-bat-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.wm-bat .wm-bat-actions .wm-btn, .wm-bat .wm-note .wm-btn { min-height: 40px; }

/* appliance list */
.wm-bat .wm-bat-apps { margin-top: 14px; }
.wm-bat .wm-bat-apps .table-wrap { margin: 0 0 10px; overflow-x: auto; }
.wm-bat .wm-bat-apps table { width: 100%; border-collapse: collapse; font-size: .88rem; border: 0; }
.wm-bat .wm-bat-apps th { text-transform: none; letter-spacing: 0; background: transparent; border-bottom: 1px solid var(--wm-line); font-size: .78rem; color: var(--wm-mute); font-weight: 600; padding: 4px 3px; text-align: left; }
.wm-bat .wm-bat-apps td { padding: 3px; border: 0; background: transparent; }
.wm-bat .wm-bat-apps td .wm-field { min-height: 40px; padding: 6px 7px; font-size: .92rem; }
.wm-bat .wm-bat-apps td:first-child { min-width: 84px; }
.wm-bat .wm-bat-apps td:nth-child(2), .wm-bat .wm-bat-apps td:nth-child(3), .wm-bat .wm-bat-apps td:nth-child(4) { width: 62px; }
.wm-bat .wm-bat-apps td:nth-child(2) .wm-field, .wm-bat .wm-bat-apps td:nth-child(3) .wm-field, .wm-bat .wm-bat-apps td:nth-child(4) .wm-field { width: 62px; }
.wm-bat .wm-bat-apps td .wm-field[aria-invalid="true"] { border-color: var(--wm-err); background: var(--wm-err-bg); }
.wm-bat .wm-bat-del { width: 40px; height: 40px; border: 0; background: transparent; color: #94a3b8; font-size: 20px; cursor: pointer; border-radius: 8px; }
.wm-bat .wm-bat-del:hover { color: var(--wm-err); background: var(--wm-err-bg); }
.wm-bat .wm-bat-del:focus-visible { outline: 2px solid var(--wm-green-2); outline-offset: 1px; }
.wm-bat .wm-bat-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 860px) {
  .wm-bat .wm-bat-grid { grid-template-columns: 1fr; gap: 16px; }
}
@media (max-width: 400px) {
  .wm-bat .wm-bat-fields { gap: 10px; }
  .wm-bat .wm-bat-in .u { padding: 0 7px; }
  .wm-bat .wm-bat-seg button { font-size: .78rem; padding: 0 3px; }
}

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

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