/* WideMath BA II Plus style financial calculator (2026-10-13).
   Every selector is scoped to .wm-baii. The keypad is an original drawing:
   slate body, WideMath green for 2ND and its labels, a plain grey-green
   screen. Only the key ORDER and labels follow the device. */

.wm-baii { --bx-body: #111827; --bx-key: #374151; --bx-key-op: #4b5563; --bx-num: #e5e7eb; --bx-2nd: #86efac; --bx-lcd: #dfe6d6; }
.wm-baii .bx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wm-baii .wm-tabs { flex-wrap: wrap; }
@media (max-width: 520px) {
  .wm-baii .wm-tabs { flex-wrap: wrap; }
  .wm-baii .wm-tabs button { flex: 1 1 auto; padding: 9px 8px; }
}

/* ---- keypad tab ----------------------------------------------------------- */
.wm-baii .bx-kp { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 820px) { .wm-baii .bx-kp { grid-template-columns: minmax(0, 1fr); } }
.wm-baii .bx-calc { background: var(--bx-body); border-radius: 22px; padding: 14px 14px 16px; box-shadow: 0 10px 28px rgba(15,23,42,.22), inset 0 1px 0 rgba(255,255,255,.06);
  width: 100%; max-width: 380px; margin: 0 auto; position: relative; outline: none; }
.wm-baii .bx-calc:focus-visible { box-shadow: 0 0 0 3px #4ade80, 0 10px 28px rgba(15,23,42,.22); }
.wm-baii .bx-screen { background: var(--bx-lcd); border-radius: 10px; padding: 6px 12px 8px; color: #0f172a; box-shadow: inset 0 2px 5px rgba(0,0,0,.28); min-height: 78px; }
.wm-baii .bx-ind { display: flex; flex-wrap: wrap; gap: 0 8px; font: 700 10px/1.5 'Segoe UI', system-ui, sans-serif; letter-spacing: .02em; }
.wm-baii .bx-ind span { color: rgba(15,23,42,.16); }
.wm-baii .bx-ind span.on { color: #0f172a; }
.wm-baii .bx-line { display: flex; align-items: baseline; gap: 6px; margin-top: 4px; font-family: Consolas, 'Cascadia Mono', 'SF Mono', ui-monospace, monospace; }
.wm-baii .bx-lbl { font-size: 1.02rem; font-weight: 700; white-space: nowrap; min-width: 1em; }
.wm-baii .bx-val { flex: 1; text-align: right; font-size: 1.85rem; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: clip; font-variant-numeric: tabular-nums; }
.wm-baii .bx-exp { font-size: .62em; vertical-align: super; margin-left: .35em; }
.wm-baii .bx-mark { width: 14px; font-size: 1.05rem; font-weight: 700; }
.wm-baii .bx-msg { margin: 8px 2px 0; min-height: 0; font-size: .82rem; line-height: 1.4; color: #cbd5e1; }
.wm-baii .bx-msg.err { color: #fecaca; }
.wm-baii .bx-msg:empty { display: none; }
.wm-baii .bx-keys { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-rows: auto; gap: 4px 7px; margin-top: 12px; }
.wm-baii .bx-k { appearance: none; border: 0; background: none; padding: 0; margin: 0; cursor: pointer; display: flex; flex-direction: column; align-items: stretch; min-width: 0; -webkit-tap-highlight-color: transparent; }
.wm-baii .bx-k .s2 { display: block; height: 14px; font: 700 9.5px/14px 'Segoe UI', system-ui, sans-serif; color: var(--bx-2nd); text-align: center; white-space: nowrap; overflow: hidden; letter-spacing: .01em; transition: color 120ms, text-shadow 120ms; }
.wm-baii .bx-k .p { display: flex; align-items: center; justify-content: center; min-height: 40px; height: 100%; border-radius: 9px; background: var(--bx-key); color: #f9fafb;
  font: 700 .84rem/1 'Segoe UI', system-ui, sans-serif; box-shadow: 0 2px 0 #030712, inset 0 1px 0 rgba(255,255,255,.08); transition: transform 60ms, box-shadow 60ms, background 120ms; white-space: nowrap; }
.wm-baii .bx-k.num .p { background: var(--bx-num); color: #111827; font-size: 1.12rem; box-shadow: 0 2px 0 #6b7280, inset 0 1px 0 #fff; }
.wm-baii .bx-k.op .p { background: var(--bx-key-op); font-size: 1.15rem; }
.wm-baii .bx-k.k2nd .p { background: #16a34a; color: #fff; }
.wm-baii .bx-k.eq { align-self: stretch; }
.wm-baii .bx-k.eq .p { background: #15803d; color: #fff; font-size: 1.3rem; }
.wm-baii .bx-k:hover .p { filter: brightness(1.12); }
.wm-baii .bx-k:active .p, .wm-baii .bx-k.lit .p { transform: translateY(2px); box-shadow: 0 0 0 2px #4ade80; }
.wm-baii .bx-k:focus-visible { outline: none; }
.wm-baii .bx-k:focus-visible .p { box-shadow: 0 0 0 3px #4ade80; }
.wm-baii .bx-calc.is2nd .bx-k .s2 { color: #dcfce7; text-shadow: 0 0 8px rgba(134,239,172,.9); }
.wm-baii .bx-calc.is2nd .bx-k.k2nd .p { box-shadow: 0 0 0 2px #dcfce7; }
@media (max-width: 380px) {
  .wm-baii .bx-calc { padding: 12px 10px 14px; border-radius: 18px; }
  .wm-baii .bx-keys { gap: 3px 5px; }
  .wm-baii .bx-k .p { font-size: .78rem; }
  .wm-baii .bx-k .s2 { font-size: 8.8px; }
  .wm-baii .bx-val { font-size: 1.6rem; }
}

.wm-baii .bx-side { display: grid; gap: 12px; min-width: 0; }
.wm-baii .bx-side .wm-card { padding: 14px 16px; }
.wm-baii .bx-h { margin: 0 0 8px; padding: 0; border: 0; font-size: .95rem; font-weight: 700; color: #0f172a; }
.wm-baii .bx-h4 { margin: 18px 0 6px; font-size: .95rem; color: #0f172a; }
.wm-baii .bx-mode { margin: 0 0 4px; font-size: .9rem; color: #0f172a; }
.wm-baii .bx-help { margin: 0; font-size: .9rem; line-height: 1.55; color: #475569; }
.wm-baii .bx-tape { margin: 0; line-height: 2; font-size: .9rem; word-break: break-word; }
.wm-baii kbd, .wm-baii .bx-tape kbd { display: inline-block; padding: 1px 7px; margin: 1px 0; border: 1px solid #cbd5e1; border-bottom-width: 2px; border-radius: 6px; background: #fff;
  font: 700 .76rem/1.6 'Segoe UI', system-ui, sans-serif; color: #1e293b; white-space: nowrap; }
.wm-baii .bx-n { font: 700 .92rem/1.6 Consolas, ui-monospace, monospace; color: #0f172a; }
.wm-baii .bx-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.wm-baii .bx-actions .wm-btn { min-height: 40px; }
.wm-baii .bx-drills { display: flex; flex-wrap: wrap; gap: 6px; }
.wm-baii .bx-drills .wm-chip { min-height: 40px; }

/* compact two-column tables (stored values, schedules) */
/* the article stylesheet uppercases every th; labels like CFo and I/Y must keep their case */
.wm-baii th { text-transform: none; letter-spacing: 0; font-size: .84rem; }
.wm-baii table.bx-t { border: 0; border-radius: 0; }
.wm-baii .bx-vars table.bx-t th { background: none; border-bottom: 1px solid #e2e8f0; padding: 5px 8px; }
.wm-baii table.bx-t { width: 100%; border-collapse: collapse; font-size: .88rem; margin: 0; }
.wm-baii table.bx-t th, .wm-baii table.bx-t td { padding: 5px 8px; border-bottom: 1px solid #e2e8f0; text-align: left; }
.wm-baii .bx-vars table.bx-t td { text-align: right; font-family: Consolas, ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.wm-baii .bx-vars table.bx-t th { font-weight: 700; color: #334155; width: 40%; }
.wm-baii .bx-vars tr.cur th, .wm-baii .bx-vars tr.cur td { background: #f0fdf4; color: #15803d; }
.wm-baii table.bx-num td { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wm-baii table.bx-num th { text-align: right; white-space: nowrap; }
.wm-baii table.bx-num td:first-child, .wm-baii table.bx-num th:first-child { text-align: left; }
.wm-baii .bx-scroll { max-height: 420px; overflow: auto; border: 1px solid #e2e8f0; border-radius: 10px; }
.wm-baii .bx-scroll table.bx-t thead th { position: sticky; top: 0; background: #f8fafc; z-index: 1; }

/* ---- forms ----------------------------------------------------------------- */
.wm-baii .bx-intro { margin: 0 0 12px; }
.wm-baii .bx-tvm { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { .wm-baii .bx-tvm { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .wm-baii .bx-tvm { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.wm-baii .bx-tv { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.wm-baii .bx-tv label { font-size: .86rem; color: #334155; line-height: 1.3; }
.wm-baii .bx-tv label b { font-size: .95rem; color: #0f172a; }
.wm-baii .bx-tv label span { display: block; font-size: .76rem; color: #64748b; }
.wm-baii .bx-tv .wm-field, .wm-baii .bx-f .wm-field { font-size: 1.02rem; padding: 9px 10px; min-height: 42px; }
.wm-baii .bx-solve { justify-content: center; min-height: 40px; }
.wm-baii .bx-solve[aria-pressed="true"] { background: #15803d; border-color: #15803d; color: #fff; }
.wm-baii .wm-field.bx-solved { background: #f0fdf4; border-color: #86efac; color: #15803d; font-weight: 700; }
.wm-baii .bx-row2 { margin-top: 14px; }
.wm-baii .bx-f { display: flex; flex-direction: column; gap: 5px; font-size: .86rem; font-weight: 600; color: #334155; flex: 1 1 170px; min-width: 0; position: relative; }
.wm-baii .bx-f > span { line-height: 1.3; }
.wm-baii .bx-f .wm-seg { align-self: flex-start; flex-wrap: wrap; }
.wm-baii .bx-f .wm-seg button { min-height: 40px; padding: 0 12px; font-size: .8rem; letter-spacing: 0; }
.wm-baii .bx-unit { position: absolute; right: 10px; bottom: 11px; font-style: normal; font-size: .78rem; color: #94a3b8; pointer-events: none; font-weight: 400; }
.wm-baii .bx-f select.wm-field { min-height: 42px; }
.wm-baii .wm-result b { font-weight: 700; }
.wm-baii .bx-sub { display: block; font: .9rem/1.5 'Segoe UI', system-ui, sans-serif; color: #475569; margin-top: 4px; }
.wm-baii .wm-stat-cards b { font-size: 1.05rem; }
.wm-baii .bx-steps { margin-top: 14px; }
.wm-baii .bx-steps > summary { min-height: 32px; display: list-item; }
.wm-baii .wm-steps .m { overflow-wrap: anywhere; }
.wm-baii .bx-seq { margin-top: 14px; padding: 12px 14px; border: 1px dashed #cbd5e1; border-radius: 12px; background: #f8fafc; }
.wm-baii .bx-seq-h { margin: 0 0 6px; font-size: .86rem; font-weight: 700; color: #0f172a; }
.wm-baii .bx-seq-keys { margin: 0; line-height: 2.1; }
.wm-baii .bx-seq .wm-note { margin-top: 6px; }
.wm-baii .bx-callout { margin: 12px 0 0; }
.wm-baii .bx-cft td, .wm-baii .bx-cft th { vertical-align: middle; }
.wm-baii .bx-cft .wm-field { min-width: 96px; min-height: 40px; }
.wm-baii .bx-cft th[scope="row"] { font-family: Consolas, ui-monospace, monospace; }
.wm-baii .bx-x { min-width: 40px; min-height: 40px; justify-content: center; font-size: 1.1rem; }
.wm-baii .bx-panel { margin-top: 2px; }

@media (max-width: 860px) { .wm-baii .wm-row > .bx-f { flex-basis: 140px; } }

@media print {
  .wm-baii .no-print, .wm-baii .bx-actions, .wm-baii .bx-calc, .wm-baii .bx-drills { display: none !important; }
  .wm-baii details { display: block; }
  .wm-baii .bx-scroll { max-height: none; overflow: visible; border: 0; }
}
