/* Compact tool banner matches the Gerber and GLB introduction. */
.bom-page{padding-top:22px}
.bom-heading{display:flex;align-items:center;gap:14px;padding:14px 18px;margin-bottom:12px;border:1px solid #345c8a;border-radius:9px;background:linear-gradient(110deg,#0b203c,#1d4679)}
.bom-banner-icon{display:grid;place-items:center;flex:none;width:38px;height:38px;border:1px solid #729bd14d;border-radius:8px;background:#ffffff0d;color:#a9ceff}
.bom-banner-icon svg{width:23px;height:23px}
.bom-banner-copy{min-width:0}
.bom-heading h1{color:#e4efff;font-size:22px;letter-spacing:-.6px;margin:0 0 3px;line-height:1.25}
.bom-heading h1 span{color:var(--brand)}
.bom-heading p{font-size:11px;line-height:1.5;margin:0;color:#e4efff}
.bom-local{display:flex;align-items:center;gap:6px;margin-left:auto;font-size:10px;color:#e4efff}
.bom-local svg{width:16px;height:16px;flex:none}
.bom-import-panel{padding:12px 16px;margin-bottom:8px}
.bom-import-panel>.grid-three{gap:14px;grid-template-columns:minmax(220px,1.4fr) repeat(2,minmax(0,1fr))}
.bom-import-panel label{font-size:12px;margin-bottom:0}
.bom-import-panel input,.bom-import-panel select{padding:5px 9px;height:34px;font-size:12px;margin-top:3px;border-radius:6px}
.bom-import-panel hr{margin:12px 0}
.bom-import-panel .notice{padding:7px 10px;margin:8px 0;font-size:12px}
.bom-import-panel h2{font-size:19px;margin-bottom:12px}
#bom-edit-mapping[hidden]{display:none}
.bom-import-panel .mapping-grid{gap:10px 14px}
.bom-page .tool-toolbar{gap:6px;margin:8px 0;min-height:34px}
.bom-page .tool-toolbar .button{height:32px;padding:6px 10px;font-size:11px;gap:6px}
.bom-page #bom-search{height:32px;padding:5px 9px;font-size:12px;flex:1 1 150px}
.bom-page .tool-toolbar .check-label{align-items:center;font-size:11px;gap:6px}
.bom-page .tool-toolbar .check-label input{margin:0;width:16px;height:16px}
.bom-page .tool-toolbar .output-email-actions{margin:0;gap:6px}
.bom-page .tool-toolbar .output-email-actions label{display:flex;align-items:center;gap:6px;font-size:11px;margin:0}
.bom-page .tool-toolbar .output-email-actions select{height:32px;margin:0;padding:4px 7px;font-size:11px}
@media(max-width:720px){.bom-heading{flex-wrap:wrap;gap:10px;padding:12px 14px}.bom-banner-copy{flex:1}.bom-heading h1{font-size:20px}.bom-banner-icon{width:32px;height:32px}.bom-local{flex-basis:100%;margin-left:42px;font-size:9px}}
@media(max-width:600px){.bom-page{padding-top:16px}.bom-import-panel{padding:10px 12px}.bom-import-panel>.grid-three{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 12px}.bom-import-panel>.grid-three>label:first-child{grid-column:1/-1}}

/* Compact spreadsheet rows, scoped to the BOM editor. */
#bom-table th,#bom-table td{padding:1px 5px;vertical-align:middle}
#bom-table input:not([type=checkbox]),#bom-table select{padding:2px 5px;line-height:1.2;border-radius:4px}
#bom-table input[type=checkbox]{display:block;margin:0 auto}
#bom-table .bom-row-number{width:42px;min-width:42px;text-align:right;color:var(--muted);font-size:11px;font-weight:400;font-variant-numeric:tabular-nums;background:var(--canvas);border-bottom:1px solid var(--line)}

/* Keep up to twenty component rows visible inside the scroll area. */
.bom-list-panel{padding:0;overflow:hidden}
.bom-list-scroll{max-height:552px;overflow:auto;scrollbar-gutter:stable;margin:0}
.bom-list-panel #bom-empty{padding:20px}
#bom-table{border-collapse:separate;border-spacing:0}
#bom-table thead th{position:sticky;top:0;z-index:1;height:32px;border-bottom:1px solid var(--line);background:var(--canvas)}
#bom-table tbody tr{height:26px}
#bom-table tbody td,#bom-table tbody th{height:26px;white-space:nowrap}
#bom-table input:not([type=checkbox]),#bom-table select{height:22px}
#bom-table .bom-issues{min-width:360px;max-width:360px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bom-templates{display:flex;align-items:center;gap:8px;margin:0 0 20px;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:var(--canvas);flex-wrap:wrap}
.panel .bom-templates h3{margin:0;font-size:13px;letter-spacing:-.02em;white-space:nowrap}
#bom-templates-member:not([hidden]){display:flex;align-items:center;gap:6px;flex:1;min-width:0}
.bom-templates select,.bom-templates input{height:34px;padding:6px 8px;margin:0;font-size:12px;min-width:0;width:140px;flex:1 1 140px}
.bom-templates .button.small{height:34px;padding:7px 9px;font-size:11px;gap:0}
#bom-templates-refresh{flex:none;font-size:18px;padding:5px 9px}
#bom-templates-guest{flex:1;font-size:12px}
#bom-templates-guest a{color:var(--brand);font-weight:600}
#bom-template-status{flex-basis:100%;margin:0;font-size:11px}
#bom-template-status:empty{display:none}
@media(max-width:1050px){#bom-templates-member:not([hidden]){flex-wrap:wrap;flex-basis:100%;order:2}#bom-templates-refresh{margin-left:auto}#bom-template-status{order:3}}
@media(max-width:600px){.bom-templates{padding:10px}.bom-templates input{flex-basis:160px}}

.bom-import-toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);z-index:10000;width:max-content;max-width:calc(100vw - 32px);margin:0;padding:12px 18px;border:1px solid #345c8a;border-radius:10px;background:#173d6b;color:#fff;font-size:13px;line-height:1.5;box-shadow:0 8px 28px #102b4133;pointer-events:none}
.bom-import-toast[hidden]{display:none}

#bom-cost[hidden]{display:none}

.bom-page #bom-output-select{width:210px;max-width:100%;height:32px;padding:4px 8px;font-size:11px}
.bom-output-dialog{width:min(850px,calc(100vw - 28px));max-height:88dvh;overflow:auto;border:1px solid var(--line);border-radius:14px;padding:22px;color:var(--ink);background:white}
.bom-output-dialog::backdrop{background:#0b203c88}
.bom-output-heading{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:16px}
.bom-output-heading h2{font-size:22px;margin:0}
#bom-output-close{font-size:26px;padding:0 6px}
.bom-output-dialog input,.bom-output-dialog select{padding:7px 9px;font-size:12px}
.bom-output-dialog .check-label{margin:12px 0}
.bom-output-dialog .check-label input{margin:3px 0 0}
.bom-output-column-head{display:grid;grid-template-columns:1fr 1fr 120px;gap:8px;margin-top:16px;font-size:11px;color:var(--muted)}
#bom-output-columns{list-style:none;padding:0;margin:6px 0 12px;display:grid;gap:6px}
#bom-output-columns li{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) repeat(3,34px);gap:6px;align-items:center}
#bom-output-columns .button{padding:5px;height:34px;font-size:14px}
.bom-output-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:20px}
.bom-output-dialog .button{font-size:12px;padding:8px 12px;gap:8px}
#bom-output-status{font-size:12px;margin-top:12px}
#bom-output-status:empty,#bom-output-form[hidden],#bom-output-guest[hidden]{display:none}
@media(max-width:600px){.bom-output-dialog{padding:16px}.bom-output-dialog .grid-two{grid-template-columns:1fr;gap:10px}#bom-output-columns li{grid-template-columns:repeat(3,34px) minmax(0,1fr);padding-bottom:9px;border-bottom:1px solid var(--line)}#bom-output-columns li select,#bom-output-columns li input{grid-column:1/-1}.bom-output-column-head{display:none}}

/* Editing, filtering and delivery stay in three compact groups. */
.bom-page .bom-workbar{display:grid;grid-template-columns:auto minmax(200px,1fr) auto;gap:10px;margin:8px 0;padding:6px 8px;border:1px solid var(--line);border-radius:9px;background:var(--canvas)}
.bom-workbar-edit,.bom-workbar-filter,.bom-workbar-export{display:flex;align-items:center;gap:5px;min-width:0}
.bom-workbar-edit,.bom-workbar-filter{padding-right:10px;border-right:1px solid var(--line)}
.bom-page .bom-workbar .button{height:30px;padding:5px 9px;font-size:11px;border-radius:6px}
.bom-page .bom-workbar #bom-search{height:30px;min-width:60px;width:100%;padding:5px 8px;font-size:11px;flex:1 1 120px;border-radius:6px}
.bom-page .bom-workbar .check-label{flex:none;gap:5px;margin:0;white-space:nowrap;font-size:10px}
.bom-page .bom-workbar #bom-output-select{height:30px;width:180px;min-width:110px;max-width:210px;padding:4px 7px;font-size:11px;border-radius:6px}
.bom-page .bom-workbar .bom-workbar-icon{width:30px;padding:5px;flex:none}
.bom-workbar-icon svg{width:17px;height:17px;stroke-width:1.6}
@media(max-width:980px){.bom-page .bom-workbar{grid-template-columns:1fr auto}.bom-workbar-edit{border:0}.bom-workbar-filter{grid-row:2;grid-column:1/-1;border:0;padding:0}.bom-workbar-export{grid-column:2;grid-row:1}}
@media(max-width:600px){.bom-page .bom-workbar{grid-template-columns:minmax(0,1fr);gap:7px;padding:7px}.bom-workbar-edit{flex-wrap:wrap;padding:0}.bom-workbar-filter{grid-row:2;flex-wrap:wrap}.bom-workbar-export{grid-row:3;grid-column:1}.bom-page .bom-workbar #bom-output-select{flex:1;min-width:0;max-width:none;width:120px}.bom-page .bom-workbar .button{padding:5px 8px;font-size:10px}}

/* BOM shares the viewers' unified workspace and fullscreen controls. */
.bom-workspace{display:flex;flex-direction:column;min-width:0;margin-bottom:14px;border:1px solid #d2dff2;border-radius:12px;overflow:hidden;background:white;box-shadow:0 12px 40px #1324420b}
.bom-workspace-titlebar{display:flex;align-items:center;gap:14px;min-height:46px;padding:7px 12px;border-bottom:1px solid var(--line);background:white;flex-shrink:0}
.bom-workspace-name{display:flex;align-items:center;gap:9px;min-width:0}
.bom-workspace-name>svg{width:19px;height:19px;flex:none;color:var(--brand)}
.bom-workspace-name strong{font-size:13px;white-space:nowrap}
#bom-workspace-file{font-size:10px;color:var(--muted);max-width:250px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bom-workspace-hint{margin-left:auto;font-size:10px;color:var(--muted);white-space:nowrap}
#bom-fullscreen{padding:6px 10px;height:30px;gap:6px;font-size:11px;flex:none;margin-left:auto}
#bom-fullscreen svg{width:16px;height:16px}
.bom-workspace .bom-import-panel{border:0;border-bottom:1px solid var(--line);border-radius:0;margin:0;background:var(--canvas);flex-shrink:0}
.bom-page .bom-workspace .bom-workbar{margin:0;border:0;border-bottom:1px solid var(--line);border-radius:0;background:white;flex-shrink:0}
.bom-workspace .bom-list-panel{border:0;border-radius:0;margin:0;min-width:0}
.bom-workspace #bom-cost{margin:0;padding:8px 12px;border-top:1px solid var(--line);background:var(--canvas);flex-shrink:0}
.bom-workspace #bom-cost>span{margin:0;padding:0;border:0;background:transparent;font-size:11px;border-radius:0}
#bom-table input,#bom-table select{scroll-margin:36px 8px 4px}
#bom-table input:focus,#bom-table select:focus{outline:1px solid #87a4cb;outline-offset:-1px;border-color:#87a4cb}
#bom-editor:fullscreen,#bom-editor.is-fullscreen{width:100vw;height:100dvh;max-width:none;margin:0;padding:0;border:0;border-radius:0;overflow:auto;background:white}
#bom-editor.is-fullscreen{position:fixed;inset:0;z-index:10000}
#bom-editor:fullscreen .bom-list-panel,#bom-editor.is-fullscreen .bom-list-panel{display:flex;flex-direction:column;flex:1;min-height:160px;background:white}
#bom-editor:fullscreen .bom-list-scroll,#bom-editor.is-fullscreen .bom-list-scroll{flex:1;min-height:0;max-height:none}
#bom-editor:fullscreen .bom-workspace-titlebar,#bom-editor.is-fullscreen .bom-workspace-titlebar{position:sticky;top:0;z-index:3}
@media(max-width:900px){.bom-workspace-hint{display:none}}
@media(max-width:600px){.bom-workspace-titlebar{gap:8px;padding:7px 9px}.bom-workspace-name{flex-wrap:wrap;gap:3px 7px}.bom-workspace-name strong{font-size:12px}#bom-workspace-file{flex-basis:100%;max-width:180px;font-size:9px}.bom-workspace-name>svg{width:16px;height:16px}#bom-fullscreen{padding:5px 7px;font-size:10px}}

.bom-release{flex:none;white-space:nowrap;font:10px Consolas,monospace;letter-spacing:.2px;color:#526c91;background:#edf4ff;border:1px solid #d2dff2;border-radius:4px;padding:3px 6px}

#bom-table{table-layout:fixed}
#bom-table th{overflow:hidden;text-overflow:ellipsis}
.bom-workbar-filter{flex-wrap:wrap}
@media(max-width:1050px){.bom-page .bom-workbar{grid-template-columns:1fr auto}.bom-workbar-edit{border:0}.bom-workbar-filter{grid-row:2;grid-column:1/-1;border:0;padding:0}.bom-workbar-export{grid-column:2;grid-row:1}}
@media(max-width:600px){.bom-page .bom-workbar{grid-template-columns:minmax(0,1fr)}.bom-workbar-export{grid-row:3;grid-column:1}}

#bom-output-document[hidden]{display:none}
#bom-output-document .grid-two{margin-top:12px}
#bom-output-layout{margin-bottom:10px}

#bom-draft-status{font-size:10px;color:var(--muted)}
#bom-draft-status:empty{display:none}

#bom-table [data-bom-field="unit_price"]{text-align:right;font-variant-numeric:tabular-nums}

#bom-table tbody td{border-bottom:0}
