/* Battery-bank instrument. No CDN utilities are needed by the tool. */
body.bb-page main { max-width:1120px; margin:auto; padding:0 24px 48px; }
.bb-page .page-head { padding:30px 0 24px; }
.bb-page .page-head .t-h1 { margin:16px 0 12px; }
.bb-page .page-head .lede { max-width:76ch; margin:0; font-size:1rem; line-height:1.6; }
.bb-page .page-head .stamp-row { margin-top:12px; }
/* Local fallbacks for the existing header when the Tailwind CDN is offline. */
.bb-page #site-header .nav-inner > div { display:flex; align-items:center; justify-content:space-between; min-height:60px; }
.bb-page #mobile-menu.hidden { display:none; }
.bb-page #mobile-menu-btn { display:none; align-items:center; justify-content:center; width:44px; height:44px; padding:10px; background:transparent; color:var(--paper); border:1px solid var(--hairline); border-radius:2px; }
.bb-page #mobile-menu-btn svg { width:24px; height:24px; }
.bb-page #mobile-menu a { display:block; min-height:44px; padding:8px 24px; }
.bb-page #mobile-menu summary { min-height:44px; padding:8px 24px; }
.bb-page #mobile-menu { max-height:calc(100dvh - 62px); overflow:auto; }
.bb-page .nav-dd:last-child .nav-menu { left:auto; right:0; }
.bb-page :is(button,a,summary,input,select):focus-visible { outline:2px solid var(--orange-ink) !important; outline-offset:3px; }
.bb-page #site-header :is(button,a,summary):focus-visible { outline-color:var(--paper) !important; }
#batteryTool { margin-bottom:26px; }
#batteryTool *, #batteryTool *::before, #batteryTool *::after { box-sizing:border-box; }
#batteryTool [hidden] { display:none !important; }
#batteryTool :is(button,a,summary) { touch-action:manipulation; }
#batteryTool :is(button,.bb-action,summary) { min-height:44px; }
#batteryTool button { cursor:pointer; }
#batteryTool .label { font-size:.69rem; letter-spacing:.07em; color:var(--ink-2); }
#batteryTool .well .suffix { color:var(--ink-2); }
#batteryTool :is(.bb-number,output,input,select,.bb-mono,.bb-battery,.bb-topology) { font-family:var(--ff-mono); font-variant-numeric:tabular-nums; }
.bb-presets { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:16px; }
.bb-presets .label { flex-basis:100%; }
#batteryTool .bb-presets button { padding:8px 12px; text-transform:none; letter-spacing:0; }
#batteryTool .bb-presets button[aria-pressed="true"] { background:var(--paper-raised); color:var(--ink); border-color:var(--green); box-shadow:inset 0 -3px var(--green); }
#batteryTool .panel { grid-template-columns:minmax(0, .85fr) minmax(0, 1.3fr); box-shadow:none; }
#batteryTool .panel-head { padding:14px 22px; background:var(--green-black); gap:16px; }
#batteryTool .controls { min-width:0; padding:24px; }
#batteryTool .readout { min-width:0; padding:24px; gap:16px; }
#batteryTool h2.bb-heading { font-family:var(--ff-display); font-size:1.55rem; margin:0 0 6px; line-height:1.1; }
.bb-help { font-size:.82rem; color:var(--ink-2); line-height:1.55; margin:0 0 20px; }
.bb-input-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:16px; }
#batteryTool .field { min-width:0; margin-bottom:0; }
#batteryTool label.label { display:block; min-height:18px; margin-bottom:6px; }
#batteryTool .well { height:48px; padding:0 10px; flex-wrap:nowrap; }
#batteryTool .well:focus-within { outline:2px solid var(--orange-ink); outline-offset:2px; }
#batteryTool .well input { width:100%; min-width:0; height:44px; font-size:1rem; }
#batteryTool .well input:focus-visible { outline:0 !important; }
#batteryTool select { width:100%; height:48px; padding:0 32px 0 12px; font-size:1rem; }
#batteryTool .field-note { display:block; min-height:32px; font-family:var(--ff-body); color:var(--ink-3); font-size:.75rem; line-height:1.4; }
#batteryTool .field.err .field-note { color:var(--danger-ink); }
#batteryTool .field.err :is(.well,select) { border-color:var(--danger-ink) !important; }
.bb-chemistry { border:0; margin:16px 0; padding:0; min-width:0; }
.bb-chemistry legend { margin-bottom:8px; }
#batteryTool .seg { display:flex; }
#batteryTool .seg button { flex:1; min-width:0; padding:10px 6px; font-size:.78rem; }
#batteryTool .seg button:focus-visible { outline-offset:-4px; }
.bb-control-actions { display:grid; gap:12px; margin-top:18px; }
#batteryTool .bb-control-actions button { width:100%; }
#assumeTag { font-size:.77rem; color:var(--ink-2); line-height:1.55; }
#batteryTool .bb-headline { display:flex; align-items:baseline; flex-wrap:wrap; gap:8px; margin:4px 0 0; line-height:1.1; }
.bb-headline .bb-number { font-size:clamp(2.5rem,5vw,3.6rem); font-weight:500; letter-spacing:-.04em; overflow-wrap:anywhere; }
.bb-headline .bb-unit { font-family:var(--ff-mono); font-size:1rem; }
#batteryTool .verdict { margin:12px 0 0; background:transparent; font-size:.7rem; letter-spacing:0; text-transform:none; padding:6px 10px; line-height:1.5; }
#batteryTool .verdict.caution { color:var(--caution-ink); border-color:var(--caution-ink); }
#batteryTool .verdict.fails { color:var(--danger-ink); border-color:var(--danger-ink); }
.bb-verdict-area { min-height:122px; }
.bb-reason { font-size:.83rem; color:var(--ink-2); margin:10px 0 0; line-height:1.55; min-height:65px; }
.bb-bank { display:flex; flex-direction:column; border:1px solid var(--hairline); border-radius:2px; height:310px; padding:16px; }
#bankDrawing { min-height:168px; }
#bankDrawing.bb-bank-compact { min-height:112px; }
.bb-bank-title { display:flex; justify-content:space-between; align-items:baseline; flex-wrap:wrap; gap:4px 16px; margin-bottom:12px; }
.bb-topology { font-size:1.8rem; color:var(--green); font-weight:500; line-height:1.2; }
.bb-string { display:grid; grid-template-columns:repeat(var(--series),minmax(0,1fr)); gap:12px; position:relative; padding:8px 0; }
.bb-string::before { content:""; position:absolute; left:8px; right:8px; top:50%; border-top:2px solid var(--hairline-strong); }
.bb-battery { position:relative; z-index:1; display:flex; align-items:center; justify-content:center; min-height:40px; border:1px solid var(--green); border-radius:2px; background:var(--paper-raised); font-size:.7rem; }
.bb-battery::before { content:""; position:absolute; width:10px; height:3px; top:-4px; left:calc(50% - 5px); background:var(--green); }
#bankReadout[data-state="caution"] .bb-topology { color:var(--caution-ink); }
#bankReadout[data-state="caution"] .bb-battery { border-color:var(--caution-ink); }
#bankReadout[data-state="caution"] .bb-battery::before { background:var(--caution-ink); }
.bb-bank-caption { margin:12px 0 0; color:var(--ink-2); font-size:.78rem; line-height:1.55; }
.bb-bank-placeholder { display:grid; place-content:center; text-align:center; color:var(--danger-ink); font-size:.9rem; }
#batteryTool .sub-plates { grid-template-columns:repeat(2,minmax(0,1fr)); margin:0; }
#batteryTool .sub-plates .sp { min-width:0; padding:12px; }
#batteryTool .sub-plates .v { display:block; font-size:1.13rem; overflow-wrap:anywhere; }
.bb-math { border-top:1px solid var(--hairline); }
.bb-math summary { display:flex; align-items:center; gap:10px; cursor:pointer; color:var(--green); font-weight:600; font-size:.88rem; }
.bb-math summary::before { content:"+"; font-family:var(--ff-mono); }
.bb-math[open] summary::before { content:"−"; }
.bb-math summary::-webkit-details-marker { display:none; }
.bb-math ol { padding-left:20px; margin:6px 0 16px; }
.bb-math li { margin-bottom:12px; font-size:.8rem; }
.bb-equation { display:block; font-family:var(--ff-mono); margin-top:3px; overflow-wrap:anywhere; }
.bb-math p { font-size:.78rem; line-height:1.55; }
.bb-math a { color:var(--green); text-underline-offset:3px; }
.bb-toolbar { display:flex; gap:10px; flex-wrap:wrap; align-items:center; margin:18px 0 0; }
#copyStatus { color:var(--green); font-size:.8rem; min-height:24px; flex-basis:100%; }
.bb-share { margin-top:8px; }
.bb-share input { width:100%; padding:12px; }
.bb-summary { display:none; }
.bb-parts-gate { margin-top:20px; }
.bb-parts-gate[data-blocked="true"] .oga-calculator-routing { display:none; }
.bb-parts-message { padding:18px; border:1px solid var(--hairline); background:var(--paper-raised); color:var(--danger-ink); font-size:.85rem; }
#batteryTool .oga-calculator-routing { margin:0 !important; padding:20px; border:1px solid var(--hairline); background:var(--paper-raised); border-radius:2px; }
#batteryTool .oga-calculator-routing h2 { font-size:1.45rem; margin:0; }
#batteryTool .oga-calculator-routing > p { font-size:.84rem; line-height:1.6; }
#batteryTool [data-oga-calculator-diagram-link] { display:inline-flex; align-items:center; min-height:44px; padding:10px 12px; border:1px solid var(--hairline-strong); color:var(--green); text-decoration:none; font-size:.85rem; }
.bb-page [aria-disabled="true"] { cursor:default; }
@media (max-width:1050px) {
  .bb-page #site-header nav[aria-label="Main navigation"] { display:none; }
  .bb-page #mobile-menu-btn { display:flex; }
  .bb-page .brand .sub { display:none; }
}
@media (max-width:900px) {
  body.bb-page main { padding:0 16px 32px; }
  .bb-page .page-head { padding:22px 0 18px; }
  .bb-page .page-head .t-h1 { font-size:2rem; max-width:20ch; }
  .bb-page .page-head .lede { font-size:.9rem; }
  #batteryTool .panel { display:flex; flex-direction:column; }
  #batteryTool .panel-head { padding:12px 16px; }
  #batteryTool .panel-head #liveTag { display:none; }
  #batteryTool .controls, #batteryTool .readout { padding:20px 16px; }
  #batteryTool .controls { border-right:0; border-bottom:1px solid var(--hairline); }
  .bb-input-grid { grid-template-columns:1fr; gap:12px; }
  #batteryTool .field-note { min-height:18px; }
  .bb-summary { display:flex; justify-content:space-between; align-items:center; gap:12px; position:sticky; top:62px; z-index:20; background:var(--paper-raised); border:1px solid var(--hairline-strong); border-top:3px solid var(--gold); padding:10px 12px; margin-bottom:16px; }
  .bb-summary a { display:inline-flex; align-items:center; min-height:44px; color:var(--green); font-size:.75rem; padding:10px 0 10px 10px; white-space:nowrap; }
  .bb-summary strong { font-weight:500; display:block; font-family:var(--ff-mono); font-variant-numeric:tabular-nums; font-size:.98rem; }
  .bb-summary span { display:block; font-size:.72rem; color:var(--ink-2); }
  .bb-summary[data-state="fails"] strong { color:var(--danger-ink); }
  #bankReadout, #bankForm, .bb-parts-gate { scroll-margin-top:160px; }
  #batteryTool .readout { gap:14px; }
  .bb-verdict-area { min-height:150px; }
  .bb-bank { padding:12px; height:330px; }
  .bb-string { gap:9px; }
  .bb-battery { font-size:.65rem; }
  #batteryTool .bb-toolbar button { flex:1 1 140px; padding:10px; font-size:.71rem; }
  #batteryTool .oga-calculator-routing { padding:16px; }
}
@media (prefers-reduced-motion:reduce) { #batteryTool * { animation:none !important; transition:none !important; scroll-behavior:auto !important; } }
@media print {
  .bb-page main { max-width:none; padding:0; }
  .bb-page .page-head { padding:0 0 12px; }
  #batteryTool .panel { display:block; border-color:#777; }
  #batteryTool .panel-head { color:#000; background:#fff; padding:10px; }
  #batteryTool .panel-head .label { color:#000 !important; }
  #batteryTool .controls { border:0; border-bottom:1px solid #777; padding:12px; }
  #batteryTool .bb-input-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
  #batteryTool .readout { display:block; padding:16px; }
  .bb-verdict-area { min-height:0; }
  .bb-bank { min-height:0; height:auto; margin:16px 0; break-inside:avoid; }
  #batteryTool :is(.panel,.readout,.controls,.bb-bank,.sp,.bb-battery) { background:#fff; }
  #batteryTool .well:focus-within { outline:0; }
  #batteryTool .sub-plates { grid-template-columns:repeat(3,minmax(0,1fr)); break-inside:avoid; }
  .bb-summary,.bb-toolbar,.bb-presets,.bb-control-actions,.bb-share { display:none !important; }
  .bb-page .tool-embed,.bb-page .cta-box { display:none !important; }
  .bb-math { margin-top:16px; }
}
