/* WideMath nursing dosage calculator (/nursing-dosage-calculator/, 2026-10-13).
   Every selector is scoped to .wmd (the tool card) so nothing leaks into other
   tools. Builds on the shared classes in wm-tools.css (wm-card, wm-tabs, wm-seg,
   wm-field, wm-result, wm-steps, wm-error, wm-note). */

.wmd { position: relative; }
.wmd .wm-tabs { margin-bottom: 10px; }
.wmd .wm-tabs button { min-height: 40px; }

/* rounding rules drawer */
.wmd .wmd-rules { margin: 0 0 14px; border: 1px solid var(--wm-line); border-radius: 10px; padding: 9px 12px; background: var(--wm-soft); }
.wmd .wmd-rules > summary { font-size: .88rem; line-height: 1.5; min-height: 26px; }
.wmd .wmd-rules > summary span { font-weight: 400; color: var(--wm-text); }
.wmd .wmd-rgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 14px; margin-top: 10px; }
.wmd .wmd-rules .wm-note { font-size: .84rem; }
.wmd .wmd-rules select.wm-field { min-height: 42px; }

/* fields */
.wmd .wmd-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 12px 16px; align-items: start; }
.wmd .wmd-box { border: 1px solid var(--wm-line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.wmd .wmd-kg { display: flex; flex-direction: column; gap: 10px; }
.wmd .wmd-h { margin: 0; font-weight: 700; color: var(--wm-ink); font-size: .95rem; }
.wmd .wmd-h span { font-weight: 400; color: var(--wm-mute); }
.wmd .wmd-l { display: flex; flex-direction: column; gap: 5px; font-size: .86rem; font-weight: 600; color: var(--wm-text); min-width: 0; }
.wmd .wmd-l[hidden], .wmd .wmd-kg[hidden] { display: none; }
.wmd .wmd-pair { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.wmd .wmd-pair .wm-field { min-height: 42px; }
.wmd .wmd-pair input.wm-field { width: 8.5em; flex: 0 1 8.5em; font: 1.05rem var(--wm-math); padding: 8px 10px; }
.wmd .wmd-pair input.wm-field.wmd-s { width: 5em; flex-basis: 5em; }
.wmd .wmd-pair select.wm-field { width: auto; max-width: 100%; font-size: .92rem; padding: 8px 6px; }
.wmd .wmd-u { font-size: .9rem; color: var(--wm-mute); font-weight: 600; }
.wmd .wmd-hint { margin: 0; font-size: .82rem; color: var(--wm-mute); line-height: 1.45; }
.wmd .wm-field:focus-visible { outline: 2px solid var(--wm-green-2); outline-offset: 2px; }
.wmd .wmd-seg { margin-bottom: 14px; flex-wrap: wrap; }
.wmd .wmd-seg button { min-height: 40px; padding: 0 12px; font-size: .8rem; letter-spacing: 0; }
.wmd .wmd-ivf { grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.wmd .wmd-ivf .wmd-wide { grid-column: 1 / -1; }
/* the shared example chips are 31 px tall; on this page make every chip a 40 px tap target */
body:has(.wmd) .wm-chip { min-height: 40px; }

/* results */
.wmd .wm-out { margin-top: 16px; transition: opacity var(--wm-mid); }
.wmd .wm-out.wmd-stale { opacity: .45; }
.wmd .wmd-res b { font-size: 1.55rem; }
.wmd .wmd-res .wmd-sub { display: block; font: .86rem/1.5 'Segoe UI', system-ui, sans-serif; color: var(--wm-mute); margin-top: 2px; }
.wmd .wmd-res .wmd-fin { display: block; font: 1rem/1.5 'Segoe UI', system-ui, sans-serif; color: var(--wm-text); }
.wmd .wmd-res .wmd-fin b { font: 700 1.15rem var(--wm-math); }
.wmd .wmd-warn { margin: 10px 0 0; padding: 9px 12px; border: 1px solid #fde68a; background: #fffbeb; color: #78350f; border-radius: 10px; font-size: .9rem; line-height: 1.5; }
.wmd .wmd-tip { margin: 8px 0 0; padding: 8px 12px; border-left: 3px solid var(--wm-green-2); background: var(--wm-green-bg); font-size: .88rem; color: var(--wm-text); border-radius: 0 8px 8px 0; }

/* the three methods, side by side on wide screens */
.wmd .wmd-methods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.wmd .wmd-m { border: 1px solid var(--wm-line); border-radius: 12px; padding: 10px 12px 6px; background: #fff; min-width: 0; margin-top: 12px; }
.wmd .wmd-methods .wmd-m { margin-top: 0; }
.wmd .wmd-m > summary { font-size: .95rem; min-height: 28px; padding: 2px 0; }
.wmd .wmd-m .wm-steps { margin-top: 8px; }
.wmd .wmd-m .wm-steps li { padding: 8px 4px 10px 22px; }
.wmd .wmd-m .wm-steps .m { font-size: .98rem; }
@media (max-width: 980px) { .wmd .wmd-methods { grid-template-columns: 1fr; } }

/* fractions and cancelled units in dimensional analysis */
.wmd .wmd-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 2px; }
.wmd .wmd-fr { display: inline-flex; flex-direction: column; align-items: stretch; vertical-align: middle; text-align: center; margin: 0 2px; line-height: 1.35; white-space: nowrap; }
.wmd .wmd-fr > span:first-child { border-bottom: 1.5px solid currentColor; padding: 0 4px 1px; }
.wmd .wmd-fr > span:last-child { padding: 1px 4px 0; }
.wmd .wmd-op { padding: 0 3px; color: var(--wm-mute); }
.wmd .wmd-x { text-decoration: line-through; text-decoration-color: #dc2626; text-decoration-thickness: 2px; color: var(--wm-mute); }

/* practice */
.wmd .wmd-prow { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; }
.wmd .wmd-prow .wm-btn { min-height: 42px; padding: 8px 14px; font-size: .88rem; }
.wmd .wmd-score { margin: 0 0 10px; font-size: .9rem; color: var(--wm-text); font-weight: 600; }
.wmd .wmd-prob { margin: 14px 0; padding: 14px 16px; border: 1px solid var(--wm-line); border-left: 4px solid var(--wm-green-2); border-radius: 10px; background: var(--wm-soft); font-size: 1.04rem; line-height: 1.6; color: var(--wm-ink); }
.wmd .wmd-prob p { margin: 0; }
.wmd .wmd-fb { margin-top: 12px; padding: 10px 14px; border-radius: 10px; font-size: .95rem; line-height: 1.5; border: 1px solid; }
.wmd .wmd-fb.ok { background: var(--wm-green-bg); border-color: var(--wm-green-line); color: #14532d; }
.wmd .wmd-fb.near { background: #fffbeb; border-color: #fde68a; color: #78350f; }
.wmd .wmd-fb.no { background: var(--wm-err-bg); border-color: #fecaca; color: #7f1d1d; }
.wmd [data-k="psol"] .wmd-res { margin-top: 14px; }

/* alligation grid */
.wmd .wmd-alres { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 320px); gap: 14px; align-items: start; }
@media (max-width: 760px) { .wmd .wmd-alres { grid-template-columns: 1fr; } }
.wmd .wmd-gfig { margin: 0; max-width: 320px; }
.wmd .wmd-grid3 { position: relative; width: 100%; aspect-ratio: 300 / 160; border: 1px solid var(--wm-line); border-radius: 12px; background: #fff; }
.wmd .wmd-grid3 svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.wmd .wmd-grid3 line { stroke: #94a3b8; stroke-width: 1.6; stroke-dasharray: 4 4; }
.wmd .wmd-grid3 > span { position: absolute; transform: translate(-50%, -50%); text-align: center; font: 700 1.05rem/1.1 var(--wm-math); color: var(--wm-ink); background: #fff; padding: 2px 4px; }
.wmd .wmd-grid3 > span small { display: block; font: 600 .68rem 'Segoe UI', system-ui, sans-serif; color: var(--wm-mute); }
.wmd .wmd-grid3 .a { left: 17%; top: 20%; } .wmd .wmd-grid3 .b { left: 83%; top: 20%; color: var(--wm-green); }
.wmd .wmd-grid3 .c { left: 50%; top: 50%; } .wmd .wmd-grid3 .d { left: 17%; top: 80%; } .wmd .wmd-grid3 .e { left: 83%; top: 80%; color: var(--wm-green); }
.wmd .wmd-gfig figcaption { margin-top: 6px; font-size: .78rem; color: var(--wm-mute); line-height: 1.4; }

.wmd .wmd-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--wm-line); }
.wmd .wmd-bar .wm-btn { min-height: 40px; }

@media (max-width: 520px) {
  .wmd .wmd-pair input.wm-field { width: 7em; flex-basis: 7em; }
  .wmd .wmd-res b { font-size: 1.35rem; }
  .wmd .wm-tabs button { font-size: .78rem; padding: 9px 2px; }
  .wmd .wmd-seg { display: grid; grid-template-columns: repeat(3, 1fr); }
  .wmd .wmd-seg button + button { border-left: 1px solid var(--wm-line); }
}

/* print: the tool and its working, no site chrome or ads */
@media print {
  body:has(.wmd) .nav, body:has(.wmd) .breadcrumb, body:has(.wmd) .wm-examples, body:has(.wmd) ins.adsbygoogle,
  body:has(.wmd) footer, body:has(.wmd) .related, body:has(.wmd) .author-box, body:has(.wmd) .content { display: none !important; }
  .wmd { border: 0; box-shadow: none; padding: 0; }
  .wmd .wm-tabs, .wmd .wmd-bar, .wmd .wmd-seg, .wmd .wmd-rules { display: none; }
  .wmd .wmd-methods { grid-template-columns: 1fr; }
  .wmd .wmd-m { break-inside: avoid; }
}
