/* BOM rows stay aligned at desktop widths; compact cards below tablet width. */
.bom-workbench{padding:20px;--bom-gap:12px}
.bom-entry-heading,.bom-entry-footer,.bom-result-heading,.bom-review-footer{display:flex;align-items:center;justify-content:space-between;gap:var(--bom-gap);flex-wrap:wrap}
.bom-entry-heading h2,.bom-result-heading h2{margin:0;font-size:18px}
.bom-entry-heading{margin-bottom:14px}.bom-entry-heading .actions{margin:0;gap:8px}
.bom-workbench .bom-entry{gap:10px}.bom-workbench .bom-entry>label{margin:0;gap:8px;font-size:13px}
.bom-workbench .bom-entry textarea{min-height:100px;max-height:230px;padding:10px 12px;line-height:1.5;font-size:14px}
.bom-entry-footer{align-items:flex-end}.bom-workbench .bom-set-count{display:grid;gap:6px;font-size:12px;width:100px;flex-shrink:0;margin:0}
.bom-entry-footer>p{flex:1;min-width:180px;line-height:1.6}.bom-entry-footer .actions{margin:0}
.bom-file-note{display:flex;gap:12px;flex-wrap:wrap;padding:12px 0;font-size:12px;color:var(--muted)}.bom-file-note strong{color:var(--ink)}
.bom-source-conflicts{padding:12px;border:1px solid var(--line);border-left:3px solid var(--blue);border-radius:8px}
.bom-source-conflicts h3{font-size:14px;margin:0 0 8px}.bom-source-conflicts article{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:8px 0;border-top:1px solid var(--line)}
.bom-source-conflicts p{margin:4px 0;font-size:12px}.bom-source-conflicts .actions{margin:0;gap:8px}
.bom-result-heading{margin:20px 0 12px}.bom-result-heading p{font-size:12px;margin:6px 0 0}
.bom-review-scroll{max-height:65vh;overflow:auto;border:1px solid var(--line);border-radius:10px;scrollbar-gutter:stable;overscroll-behavior:contain}
#bom-result .bom-review-table{width:100%;min-width:760px;border-collapse:collapse;table-layout:fixed;white-space:normal}
#bom-result .bom-review-table th{position:sticky;top:0;z-index:1;background:var(--paper);font-size:12px;padding:12px;text-align:left}
#bom-result .bom-review-table th:nth-child(1){width:26%}#bom-result .bom-review-table th:nth-child(2){width:16%}#bom-result .bom-review-table th:nth-child(3){width:18%}#bom-result .bom-review-table th:nth-child(4){width:40%}
#bom-result .bom-review-table td{vertical-align:top;padding:14px 12px;white-space:normal;overflow-wrap:anywhere;min-width:0;font-size:13px}
#bom-result .bom-review-table td>strong{font-size:14px;line-height:1.5;display:block}
.bom-row-spec{font-size:12px;color:var(--muted);margin-top:6px}.bom-row-spec span,.bom-row-model{display:block;margin-top:4px}
.bom-quantities{margin:0;display:grid;gap:8px}.bom-quantities div{display:grid;gap:3px}.bom-quantities dt{font-size:11px;color:var(--muted)}.bom-quantities dd{margin:0;font-variant-numeric:tabular-nums;font-weight:600}
.bom-quantity-controls{display:flex;flex-direction:column;align-items:flex-start;gap:8px}
.bom-workbench input,.bom-workbench select{box-sizing:border-box;border:1px solid var(--line);border-radius:7px;background:var(--white);color:var(--ink);font:inherit;padding:9px 10px;min-height:38px;max-width:100%}
.bom-quantity-controls input{width:100%;max-width:108px;min-width:0}.bom-quantity-controls button{margin:0;font-size:12px;padding:4px 0;white-space:normal;text-align:left;min-height:28px}
.bom-shortage{display:block;margin-top:8px;font-size:12px;color:var(--muted)}.bom-shortage.is-short{color:#c34250}
.bom-match-state{display:inline-flex;font-size:11px;border:1px solid var(--line);border-radius:5px;padding:3px 6px;margin-bottom:8px;color:var(--muted)}.bom-match-state.is-matched{color:var(--blue);background:var(--blue-pale);border-color:transparent}
.bom-allocation{display:grid;gap:4px;margin:0 0 10px;line-height:1.5}.bom-allocation strong{font-size:13px}.bom-allocation small{color:var(--muted);font-size:11px}
.bom-issues{margin:0 0 8px;padding-left:18px;font-size:12px;color:#c34250;line-height:1.6}
.bom-alternatives summary{font-size:12px;font-weight:500;line-height:1.6}.bom-alternatives[open] summary{margin-bottom:8px}
#bom-result .bom-alternative-label{display:grid;gap:6px;margin:0;font-size:11px;color:var(--muted)}.bom-alternative-label select{width:100%;min-width:0;font-size:12px}
.bom-candidate-reason{font-size:11px;line-height:1.6;color:var(--muted);margin:8px 0 0}
.bom-review-footer{padding:14px 0 0;align-items:flex-start}.bom-review-footer>p{font-size:12px;flex:1;min-width:200px;margin:0;line-height:1.6}.bom-review-footer .actions{margin:0;gap:8px}
@media(max-width:1100px){.bom-review-footer .actions{width:100%;justify-content:flex-end}}
@media(max-width:800px){.bom-workbench{padding:14px}.bom-entry-heading{align-items:flex-start}.bom-entry-heading .actions{width:100%}.bom-entry-footer>p{min-width:150px}.bom-entry-footer>.actions{width:100%;justify-content:flex-end}.bom-review-scroll{max-height:65vh;border:0;border-radius:0}#bom-result .bom-review-table,#bom-result .bom-review-table tbody,#bom-result .bom-review-table tr{display:block;width:100%;min-width:0}#bom-result .bom-review-table thead{display:none}#bom-result .bom-review-table tr{box-sizing:border-box;padding:12px;border:1px solid var(--line);border-radius:8px;margin:0 0 10px}#bom-result .bom-review-table td{display:block;padding:8px 0;border:0;width:auto}#bom-result .bom-review-table td::before{display:block;content:attr(data-label);font-size:11px;color:var(--muted);margin-bottom:6px}.bom-quantities{grid-template-columns:repeat(2,minmax(0,1fr))}.bom-quantity-controls{flex-direction:row;align-items:center;flex-wrap:wrap}.bom-quantity-controls input{width:100px}.bom-review-footer .actions{justify-content:flex-start;flex-wrap:wrap}.bom-alternative-label select{max-width:100%}}
