/* Solid-state synthesis batch calculator (docs/SMALL_TOOLS.md). Classes carry the batch- prefix (docs/LAYOUT.md); colours from theme.css tokens only.
   The skeleton (sm-*) comes from small.css. The lab sheet (.batch-sheet) is hidden on screen and is the only thing printed: it is black on white
   paper in both themes (tokens --paper and --stage-black, which do not change with the theme). */
.batch-ex{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:6px 0 0;font-size:12.5px;color:var(--muted)}
.batch-chip{padding:2px 9px;border:1px solid var(--line2);border-radius:99px;background:var(--panel2);color:var(--ink2);font:inherit;font-size:12.5px;line-height:18px}
.batch-chip:hover{background:var(--panel3);color:var(--ink)}
.batch-cop{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0 0 10px;font-size:12.5px;color:var(--muted)}
.batch-cop .batch-chip sub{font-size:.78em}
.batch-covered{background:var(--panel)}
.batch-cov{margin:2px 0 0;font-size:13px;line-height:1.45;color:var(--ink2)}
.batch-res>.batch-warn{margin:0 0 14px}
.batch-eq{margin:16px 0 0;padding:10px 12px;border:1px solid var(--line);border-radius:9px;background:var(--panel2)}
.batch-eq .batch-h{margin:0 0 6px}
.batch-eqt{margin:0;font-size:15px;line-height:1.7;color:var(--ink);overflow-wrap:anywhere}
.batch-co{font-weight:600}
.batch-arrow{margin:0 4px;color:var(--muted)}
.batch-eqn{margin:6px 0 0;display:flex;flex-wrap:wrap;gap:2px 16px}
.batch-eqnote b{font-weight:600;color:var(--ink2)}
.batch-amt{display:flex;gap:6px;min-width:0}
.batch-amt input{flex:1 1 80px}
.batch-amt select{flex:0 0 86px;width:86px}
.batch-page .sm-tool input[type=text],.batch-page .sm-tool select{height:32px;line-height:1.2}   /* facet.css fixes inputs at 26 px: too low for the padding of the small-tool fields */
.batch-h{margin:20px 0 6px;font-size:13px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.batch-h:first-child{margin-top:0}

/* one block per element of the target */
.batch-els{display:grid;gap:8px;margin:12px 0 0}
.batch-el{display:grid;grid-template-columns:104px minmax(0,1fr) 168px;gap:8px 14px;align-items:start;padding:10px 12px;border:1px solid var(--line);border-radius:9px;background:var(--panel2);min-width:0}
.batch-eh{display:flex;flex-direction:column;gap:2px;min-width:0}
.batch-eh b{font-size:18px;line-height:1.2;color:var(--ink)}
.batch-sups{display:flex;flex-direction:column;gap:8px;min-width:0}
.batch-sup{display:flex;flex-wrap:wrap;align-items:flex-end;gap:8px;min-width:0}
.batch-lab{display:flex;flex-direction:column;gap:3px;min-width:0}
.batch-lab>span{font-size:11.5px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--muted);white-space:nowrap}
.batch-lab.batch-pre{flex:1 1 200px}
.batch-lab.batch-oth{flex:1 1 150px}
.batch-lab.batch-pur,.batch-lab.batch-shr{flex:0 0 78px}
.batch-add{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.batch-x{flex:0 0 auto;height:30px;width:30px;padding:0}
.batch-exc{display:flex;flex-direction:column;gap:5px;min-width:0}
.batch-use{align-self:flex-start;padding:1px 8px;border:1px solid var(--line2);border-radius:99px;background:var(--panel);color:var(--ink2);font:inherit;font-size:12px;line-height:18px}
.batch-use:hover{background:var(--panel3);color:var(--ink)}
.batch-foot{margin:10px 0 0}

/* results */
.batch-res{margin:20px 0 0;padding:16px 0 0;border-top:1px solid var(--line)}
.batch-warns{display:grid;gap:6px;margin:0 0 14px}
.batch-warns .sm-err{margin:0}
.batch-warn,.batch-note{margin:0;padding:7px 11px;border-radius:8px;font-size:13px;line-height:1.45;color:var(--ink)}
.batch-warn{border:1px solid color-mix(in srgb, var(--warn) 50%, transparent);background:color-mix(in srgb, var(--warn) 10%, transparent)}
.batch-note{border:1px solid var(--line);background:var(--panel2);color:var(--ink2)}
.batch-sub{margin:0 0 8px;font-size:13.5px;color:var(--ink2)}
.batch-weigh td.batch-m{font-weight:600;color:var(--ink)}
.batch-weigh tr.batch-tot td{border-top:1px solid var(--line2);font-weight:600;color:var(--ink)}
.batch-weigh td.batch-zero{color:var(--muted)}
.batch-two{display:grid;grid-template-columns:minmax(0,3fr) minmax(0,2fr);gap:14px;margin:18px 0 0}
.batch-card{padding:12px 14px;border:1px solid var(--line);border-radius:9px;background:var(--panel2);min-width:0}
.batch-card .batch-h{margin:0 0 8px}
.batch-card .sm-tblwrap{border:0}
.batch-card .sm-table th{background:none}
.batch-loss{font-size:28px;font-weight:600;letter-spacing:-.01em;color:var(--ink);line-height:1.2}
.batch-lossc{margin:4px 0 0;font-size:13px;color:var(--ink2);line-height:1.5}
.batch-gnote{margin:6px 0 0;font-size:12.5px;color:var(--muted);line-height:1.45}
.batch-bal{margin:16px 0 0;border:1px solid var(--line);border-radius:9px;background:var(--panel)}
.batch-bal>summary{padding:8px 12px;cursor:pointer;font-size:13px;font-weight:600;color:var(--ink2)}
.batch-bal[open]>summary{border-bottom:1px solid var(--line)}
.batch-bal .sm-tblwrap{border:0}
.batch-bal td.batch-off{color:var(--danger);font-weight:600}
.batch-nb{margin:12px 0 0;font-size:13px;color:var(--muted);line-height:1.5}

/* recipes */
.batch-rec{margin:22px 0 0;padding:16px 0 0;border-top:1px solid var(--line)}
.batch-list{margin:10px 0 0;padding:0;list-style:none;display:grid;gap:6px}
.batch-list li{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;padding:6px 10px;border:1px solid var(--line);border-radius:8px;background:var(--panel2)}
.batch-list .batch-rn{font-weight:600;color:var(--ink);min-width:0;overflow-wrap:anywhere}
.batch-list .batch-rf{flex:1 1 140px;min-width:0;color:var(--muted);font-size:12.5px;overflow-wrap:anywhere}

/* the lab sheet: not shown on screen */
.batch-sheet{display:none}

@media (max-width:860px){
  .batch-el{grid-template-columns:minmax(0,1fr)}
  .batch-eh{flex-direction:row;align-items:baseline;gap:10px}
  .batch-two{grid-template-columns:minmax(0,1fr)}
}
@media (max-width:560px){
  .batch-lab.batch-pre,.batch-lab.batch-oth{flex-basis:100%}
}

@media print{
  @page{margin:14mm}
  html,body.sm-body{background:var(--paper) !important;color:var(--stage-black) !important;overflow:visible !important;height:auto !important}
  body.sm-body>*:not(.batch-sheet){display:none !important}
  .batch-sheet{display:block !important;margin:0;padding:0;background:var(--paper);color:var(--stage-black);font-family:system-ui,-apple-system,"Segoe UI",Arial,sans-serif;font-size:11pt;line-height:1.4}
  .batch-sheet h1{margin:0 0 10pt;font-size:18pt;font-weight:600;color:var(--stage-black)}
  .batch-sheet table{width:100%;border-collapse:collapse;margin:0 0 10pt;font-variant-numeric:tabular-nums}
  .batch-sheet th,.batch-sheet td{padding:5pt 6pt;border:1px solid var(--stage-black);text-align:left;vertical-align:top;color:var(--stage-black);background:none;font-size:11pt;font-family:inherit;position:static}
  .batch-sheet th{font-weight:600}
  .batch-sheet tr:hover td,.batch-sheet tr:hover th{background:none !important}
  .batch-sheet td.batch-r{text-align:right;white-space:nowrap}
  .batch-sheet td.batch-blank{min-width:34mm;height:9mm}
  .batch-sheet .batch-sheet-tot td{font-weight:600}
  .batch-sheet .batch-notes{height:48mm;margin:0 0 10pt;border:1px solid var(--stage-black);padding:5pt 6pt}
  .batch-sheet .batch-notes b{font-weight:600}
  .batch-sheet .batch-sign{display:flex;gap:16mm;margin:18pt 0 10pt}
  .batch-sheet .batch-sign span{flex:1;border-top:1px solid var(--stage-black);padding-top:3pt;font-size:10pt}
  .batch-sheet .batch-small{margin:0 0 6pt;font-size:9.5pt}
  .batch-sheet sub{font-size:.75em}
}
