/* Tube parts window: 1 Parts -> 2 Material & nesting -> 3 Saved (Oct 2026 restructure) */
html body #tubeModal#tubeModal#tubeModal#tubeModal{padding:0!important;align-items:stretch!important;justify-content:stretch!important}
html body #tubeModal#tubeModal#tubeModal#tubeModal>.panel{width:100vw!important;max-width:100vw!important;min-width:100vw!important;height:100vh!important;height:100dvh!important;max-height:100dvh!important;margin:0!important;border-radius:0!important;border:0!important;padding:0!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;box-sizing:border-box!important;background:#f4f6f9!important}
#tubeModal *{box-sizing:border-box}
#tubeModal .hidden{display:none!important}
#tubeModal .tp-sp{flex:1}
#tubeModal .sub{color:#64748b;font-size:12px}
#tubeModal .num{text-align:right;white-space:nowrap}
#tubeModal .tp-head{display:flex;align-items:center;gap:14px;padding:12px 18px;background:#fff;border-bottom:1px solid #d9dee5;flex:0 0 auto;flex-wrap:wrap}
#tubeModal .tp-head h2{margin:0;font-size:19px;color:#10244b;white-space:nowrap}
#tubeModal .tp-steps{display:flex;gap:6px}
#tubeModal .tp-steps button{border:1px solid #d9dee5;background:#fff;color:#64748b;border-radius:999px;padding:5px 13px;font:inherit;font-size:12.5px;font-weight:600;cursor:pointer;white-space:nowrap}
#tubeModal .tp-steps button.on{background:#1d4ed8;border-color:#1d4ed8;color:#fff}
#tubeModal .tp-steps button.done{background:#ecfdf3;border-color:#bbf7d0;color:#166534}
#tubeModal .tp-addbtns{display:flex;gap:8px;flex-wrap:wrap}
#tubeModal .tp-addbtns label.btn{cursor:pointer;display:inline-flex;align-items:center;margin:0}
#tubeModal .tp-body{flex:1 1 auto;min-height:0;position:relative;display:flex}
#tubeModal .tp-step{flex:1;min-height:0;min-width:0;padding:14px 18px;overflow:auto}
#tubeModal .tp-s1{display:grid;grid-template-columns:minmax(0,1fr) 440px;gap:14px;overflow:hidden}
#tubeModal .tp-card{background:#fff;border:1px solid #d9dee5;border-radius:12px;min-height:0;display:flex;flex-direction:column;overflow:hidden}
#tubeModal .tp-cardhead{display:flex;align-items:center;gap:10px;padding:11px 14px;border-bottom:1px solid #e5e9f0;flex:0 0 auto;min-width:0}
#tubeModal .tp-cardhead b{font-size:14px;color:#10244b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#tubeModal .tp-tablewrap{flex:1;min-height:0;overflow:auto}
/* step 1 list */
#tubeModal table.tp-table{width:100%;border-collapse:collapse;font-size:13px}
#tubeModal table.tp-table th{position:sticky;top:0;z-index:1;background:#f8fafc;font-size:10.5px;letter-spacing:.05em;text-transform:uppercase;color:#64748b;text-align:left;padding:8px 10px;border-bottom:1px solid #e5e9f0;white-space:nowrap}
#tubeModal table.tp-table th.num{text-align:right}
#tubeModal table.tp-table td{padding:9px 10px;border-bottom:1px solid #eef1f5;vertical-align:middle}
#tubeModal table.tp-table td:first-child,#tubeModal table.tp-table th:first-child{width:36px;padding-right:0}
#tubeModal tr.tp-grow td{background:#f1f4f8;padding:10px;border-top:1px solid #e1e6ee}
#tubeModal tr.tp-grow b{font-size:14px;color:#10244b}
#tubeModal tr.tp-grow span{color:#64748b;font-size:12.5px;margin-left:8px}
#tubeModal tr.tp-prow{cursor:pointer}
#tubeModal tr.tp-prow:hover td{background:#f8fafc}
#tubeModal tr.tp-prow.on td{background:#eef4ff}
#tubeModal tr.tp-prow.on td:first-child{box-shadow:inset 3px 0 0 #1d4ed8}
#tubeModal tr.tp-prow.is-saved td{color:#64748b}
#tubeModal .tp-pname{min-width:180px}
#tubeModal .tp-pnm{font-weight:600;color:#10244b}
#tubeModal .tp-pmeta{font-size:12px;color:#94a3b8}
#tubeModal .tp-pwarn{font-size:12px;color:#b45309;margin-top:1px}
#tubeModal .tp-perr{font-size:12px;color:#b91c1c;margin-top:1px}
#tubeModal .tp-src{display:inline-block;font-size:10.5px;font-weight:700;letter-spacing:.04em;border-radius:5px;padding:2px 7px;background:#eef2f7;color:#334155;font-family:ui-monospace,Menlo,Consolas,monospace}
#tubeModal .tp-src-section,#tubeModal .tp-src-manual{background:#e0f2fe;color:#075985}
#tubeModal .tp-src-pack{background:#f3e8ff;color:#6b21a8}
#tubeModal .tp-src-nc1{background:#fef3c7;color:#92400e}
#tubeModal input.tp-qty{width:62px;height:30px;border:1px solid #cfd6df;border-radius:7px;padding:0 8px;font:inherit;font-size:13px;text-align:right}
#tubeModal .tp-x{border:0;background:none;color:#94a3b8;font-size:17px;cursor:pointer;padding:0 4px}
#tubeModal .tp-x:hover{color:#dc2626}
#tubeModal .tp-saved-tag{display:inline-block;font-size:10.5px;font-weight:700;border-radius:6px;padding:1px 7px;background:#dcfce7;color:#166534;vertical-align:1px}
#tubeModal .tp-drop{display:flex;flex-direction:column;align-items:center;gap:3px;margin:12px;padding:12px;border:1.5px dashed #b6c4d8;border-radius:10px;background:#f8fbff;color:#64748b;font-size:12px;cursor:pointer;text-align:center}
#tubeModal .tp-drop b{color:#10244b;font-size:13px}
#tubeModal .tp-drop.tp-drop-big{padding:60px 20px;margin:24px}
#tubeModal .tp-drop.tp-drop-big b{font-size:16px}
#tubeModal .tp-s1.tp-drag .tp-list{outline:3px solid #93c5fd;outline-offset:-3px}
/* step 1 part details */
#tubeModal .tp-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;color:#64748b;text-align:center;padding:24px}
#tubeModal .tp-empty b{color:#10244b;font-size:15px}
#tubeModal .tp-result{flex:1;min-height:0;display:flex;flex-direction:column}
#tubeModal .tp-dbody{flex:1;min-height:0;overflow:auto;padding:12px 14px}
#tubeModal .tp-thumb{background:#f8fafc;border:1px solid #e5e9f0;border-radius:10px;height:190px;padding:6px;display:flex;align-items:center;justify-content:center}
#tubeModal .tp-thumb img,#tubeModal .tp-thumb svg{max-width:100%;max-height:100%;display:block}
#tubeModal .tp-vbtns{display:flex;gap:6px;margin:8px 0}
#tubeModal .tp-vbtns .btn.on{background:#eef4ff!important;border-color:#93b4ef!important;color:#1d4ed8!important}
#tubeModal .tp-chips{display:flex;flex-wrap:wrap;gap:6px;margin:4px 0 10px}
#tubeModal .tp-chip{background:#f6f8fb;border:1px solid #d9dee5;border-radius:7px;padding:3px 9px;font-size:12px;color:#10244b}
#tubeModal .tp-warn{flex-basis:100%;padding:8px 11px;border:1px solid #f3d9a4;background:#fff7e6;color:#7a4b00;border-radius:8px;font-size:12.5px}
#tubeModal .tp-cuts-title{display:flex;justify-content:space-between;gap:8px;font-size:10.5px;font-weight:700;letter-spacing:.06em;color:#64748b;margin:12px 0 6px}
#tubeModal .tp-cut{display:grid;grid-template-columns:18px auto minmax(0,1fr) auto auto;gap:9px;align-items:center;padding:7px 10px;border:1px solid #d9dee5;background:#fff;border-radius:8px;margin-bottom:5px;cursor:pointer;color:#64748b;font-size:13px}
#tubeModal .tp-cut.on{border-color:#cfe9d8;background:#f2fbf5;color:#10244b}
#tubeModal .tp-cut.sub{margin-left:26px}
#tubeModal .tp-cut-l{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#tubeModal .tp-cut b{white-space:nowrap;font-family:ui-monospace,Menlo,Consolas,monospace;font-size:12px}
#tubeModal .tc-kind{font-size:10px;font-weight:800;letter-spacing:.04em;border-radius:5px;padding:2px 6px;background:#eef2f7;color:#334155;white-space:nowrap}
#tubeModal .tc-kind.end{background:#fef3c7;color:#92400e}
#tubeModal .tc-kind.cutout{background:#fee2e2;color:#991b1b}
#tubeModal .tp-link{border:0;background:none;color:#1d4ed8;font:inherit;font-weight:600;font-size:12px;cursor:pointer;padding:0;white-space:nowrap}
#tubeModal .tp-totals{display:flex;gap:16px;flex-wrap:wrap;align-items:center;padding:10px 14px;border-top:1px solid #e5e9f0;background:#f8fafc;font-size:12.5px;flex:0 0 auto}
#tubeModal .tp-totals .sub{margin-left:auto}
/* standard section / manual tube slide-over */
#tubeModal .tp-slide{position:absolute;top:0;right:0;bottom:0;width:min(520px,100%);background:#fff;border-left:1px solid #d9dee5;box-shadow:-12px 0 30px rgba(15,23,42,.12);display:flex;flex-direction:column;z-index:5}
#tubeModal .tp-slidebody{flex:1;min-height:0;overflow:auto;padding:12px 14px}
#tubeModal .tp-slidefoot{display:flex;justify-content:flex-end;gap:8px;padding:10px 14px;border-top:1px solid #e5e9f0}
#tubeModal .tp-profs{display:grid;grid-template-columns:repeat(auto-fill,minmax(52px,1fr));gap:6px;margin-bottom:12px}
#tubeModal .tp-prof{display:flex;flex-direction:column;align-items:center;gap:2px;border:1px solid #d9dee5;background:#fff;border-radius:9px;padding:6px 2px;font:inherit;font-size:11px;font-weight:700;color:#334155;cursor:pointer}
#tubeModal .tp-prof svg{width:26px;height:26px}
#tubeModal .tp-prof.on{border-color:#1d4ed8;background:#eef4ff;color:#1d4ed8;box-shadow:0 0 0 1px #1d4ed8}
#tubeModal .tp-g2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
#tubeModal .tp-span2{grid-column:1/-1}
#tubeModal .tp-f{display:flex;flex-direction:column;gap:4px;min-width:0}
#tubeModal .tp-f span{font-size:10.5px;font-weight:700;letter-spacing:.04em;color:#64748b}
#tubeModal .tp-f input,#tubeModal .tp-f select{height:34px;border:1px solid #cfd6df;border-radius:8px;padding:0 9px;font:inherit;font-size:13px;width:100%;min-width:0;background:#fff}
#tubeModal .tp-holes-head{display:flex;justify-content:space-between;align-items:center;margin:14px 0 6px;font-size:11px;color:#64748b}
#tubeModal .tp-hole{display:grid;grid-template-columns:1.3fr 1fr 1fr .8fr auto;gap:6px;align-items:center;margin-bottom:6px}
#tubeModal .tp-hole select,#tubeModal .tp-hole input{height:30px;border:1px solid #cfd6df;border-radius:7px;padding:0 6px;font:inherit;font-size:12.5px;width:100%;min-width:0}
#tubeModal .tp-hole label{display:flex;align-items:center;gap:4px;font-size:11px;color:#64748b}
#tubeModal .tp-tspreview{margin-top:12px;background:#f8fafc;border:1px solid #e5e9f0;border-radius:10px;padding:8px;text-align:center}
#tubeModal .tp-tspreview:empty{display:none}
#tubeModal .tp-tspreview img{max-width:100%;height:140px;object-fit:contain}
#tubeModal .tp-tsmeta{font-size:12.5px;color:#334155}
/* step 2 */
#tubeModal .tp-nest-body{display:flex;flex-direction:column;gap:12px}
#tubeModal .tp-nest-body>*{flex-shrink:0}
#tubeModal .tp-wait{padding:30px;color:#64748b;text-align:center}
#tubeModal .tp-bulk{display:flex;flex-wrap:wrap;align-items:center;gap:12px;padding:10px 14px;border:1px solid #d9dee5;border-radius:12px;background:#fff}
#tubeModal .tp-bulk label{display:flex;align-items:center;gap:6px;font-size:10.5px;font-weight:800;color:#5b6575;white-space:nowrap}
#tubeModal .tp-bulk input[type=number]{width:76px;height:32px;padding:0 8px;border:1px solid #cfd6df;border-radius:8px;font-size:13px}
#tubeModal .tp-bulk select{height:32px;border:1px solid #cfd6df;border-radius:8px;font-size:13px;max-width:220px}
#tubeModal .tp-bulk .tp-bulk-all{font-size:13px;color:#1b2430;margin-right:auto}
#tubeModal .tp-bulk input[type=checkbox]{width:17px;height:17px}
#tubeModal .tp-nwrap{background:#fff;border:1px solid #d9dee5;border-radius:12px;flex:0 0 auto}
#tubeModal table.tp-nmat{width:100%;border-collapse:collapse;font-size:12.5px}
#tubeModal table.tp-nmat th{font-size:10.5px;text-transform:uppercase;letter-spacing:.03em;color:#64748b;text-align:left;padding:8px 6px;background:#f8fafc;border-bottom:1px solid #e3e7ee;white-space:nowrap}
#tubeModal table.tp-nmat th.num{text-align:right}
#tubeModal table.tp-nmat td{padding:8px 6px;border-bottom:1px solid #eef1f5;vertical-align:middle}
#tubeModal table.tp-nmat tr.off>td{opacity:.55}
#tubeModal table.tp-nmat input[type=number]{width:58px;height:30px;padding:0 6px;border:1px solid #cfd6df;border-radius:7px;font-size:12.5px}
#tubeModal table.tp-nmat select{height:30px;border:1px solid #cfd6df;border-radius:7px;font-size:12.5px;max-width:170px!important;background:#fff}
#tubeModal table.tp-nmat input[data-nk=kerf],#tubeModal table.tp-nmat input[data-nk=trim],#tubeModal table.tp-nmat input[data-np=tubePierce]{width:46px}
#tubeModal table.tp-nmat input[data-nk=cost],#tubeModal table.tp-nmat input[data-nk=len]{width:76px}
#tubeModal#tubeModal#tubeModal table.tp-nmat .req{border:1px solid #dc2626!important;background:#fef2f2!important;box-shadow:0 0 0 1px #dc2626 inset}
#tubeModal table.tp-nmat input.req::placeholder{color:#dc2626}
#tubeModal table.tp-nmat input[type=checkbox]{width:16px;height:16px}
#tubeModal .tp-nname{min-width:140px}
#tubeModal .tp-nname b{font-size:13.5px;color:#10244b;white-space:nowrap}
#tubeModal .tp-nstock{min-width:190px}
#tubeModal .tp-ok{font-size:11px;color:#16a34a;font-weight:700;margin-top:2px}
#tubeModal .tp-bad{font-size:11px;color:#dc2626;font-weight:600;margin-top:2px}
#tubeModal td.tp-nbars{min-width:170px;width:18%}
#tubeModal .tp-mbar{margin:2px 0}
#tubeModal .tp-mbar{display:flex}#tubeModal .tp-mtrack{flex:1 1 auto;display:flex;height:9px;border-radius:2px;overflow:hidden;border:1px solid #f1c4c4;background:#fff}
#tubeModal .tp-mtrack i{display:block;height:100%;border-right:1px solid #fff}
#tubeModal tr.tp-ndetail td{background:#fafbfc}
#tubeModal .tp-bars{display:flex;flex-direction:column;gap:6px;padding:4px 0 8px}
#tubeModal .tp-bar{display:flex;align-items:center;gap:8px}
#tubeModal .tp-bno{width:22px;text-align:right;font-size:11px;font-weight:800;color:#64748b}
#tubeModal .tp-btrack{flex:1 1 auto;display:flex;height:26px;border:1px solid #94a3b8;border-radius:4px;overflow:hidden;background:#f1f5f9}
#tubeModal .tp-btrack i{display:block;height:100%;flex:0 0 auto;position:relative}
#tubeModal .tp-bpc{border-right:1px solid rgba(255,255,255,.6)}
#tubeModal .tp-bpc span,#tubeModal .tp-boff span{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:10.5px;font-weight:800;color:#fff;overflow:hidden;white-space:nowrap}
#tubeModal .tp-bkerf{background:#0f172a}
#tubeModal .tp-btrim{background:#64748b}
#tubeModal .tp-boff,#tubeModal .tp-boff-sw{background:repeating-linear-gradient(45deg,#fecaca 0 6px,#fee2e2 6px 12px)}
#tubeModal .tp-boff span{color:#991b1b}
#tubeModal .tp-nleg{display:flex;gap:14px;flex-wrap:wrap;font-size:12px;color:#475569}
#tubeModal .tp-nleg i{display:inline-block;width:12px;height:12px;border-radius:3px;margin-right:5px;vertical-align:-2px}
#tubeModal table.tp-ptable{width:100%;border-collapse:collapse;font-size:13px}
#tubeModal table.tp-ptable th,#tubeModal table.tp-ptable td{padding:7px 12px;border-bottom:1px solid #eef1f5;text-align:left}
#tubeModal table.tp-ptable th{font-size:10.5px;letter-spacing:.04em;text-transform:uppercase;color:#64748b;background:#f8fafc}
#tubeModal table.tp-ptable .num{text-align:right}
#tubeModal table.tp-ptable tfoot td{font-size:14px;border-bottom:0}
#tubeModal .tp-addlen{display:block;margin-top:3px;font-size:11px}
#tubeModal tr.tp-nlens td{background:#f8fafc;padding-top:6px;padding-bottom:10px}
#tubeModal .tp-lens,#tubeModal .tp-choices{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
#tubeModal .tp-choices{margin-top:8px}
#tubeModal .tp-lens-t{font-size:10.5px;font-weight:800;letter-spacing:.05em;color:#64748b;min-width:96px}
#tubeModal .tp-xlen{display:inline-flex;align-items:center;gap:5px;background:#fff;border:1px solid #d9dee5;border-radius:9px;padding:4px 6px;font-size:12px;color:#64748b}
#tubeModal .tp-xlen select{max-width:230px!important}
#tubeModal .tp-xlen input[data-xc]{width:84px!important}#tubeModal .tp-xlen input[data-xl]{width:72px!important}
#tubeModal .tp-choice{display:flex;flex-direction:column;align-items:flex-start;gap:1px;border:1px solid #d9dee5;background:#fff;border-radius:10px;padding:6px 12px;font:inherit;cursor:pointer;text-align:left;position:relative}
#tubeModal .tp-choice b{font-size:13px;color:#10244b}
#tubeModal .tp-choice span{font-size:11.5px;color:#64748b}
#tubeModal .tp-choice i{position:absolute;top:-8px;right:8px;font-style:normal;font-size:10px;font-weight:800;background:#16a34a;color:#fff;border-radius:6px;padding:1px 6px}
#tubeModal .tp-choice.on{border-color:#1d4ed8;background:#eef4ff;box-shadow:0 0 0 1px #1d4ed8}
#tubeModal .tp-choice:disabled{opacity:.5;cursor:not-allowed}
#tubeModal .tp-blen{width:44px;font-size:11px;font-weight:700;color:#334155;white-space:nowrap}
/* step 3 */
#tubeModal .tp-saved{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:12px}
#tubeModal .tp-scard{background:#fff;border:1px solid #d9dee5;border-radius:12px;padding:10px 12px;display:flex;flex-direction:column;gap:3px;min-width:0}
#tubeModal .tp-scard>b{color:#10244b;font-size:13.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#tubeModal .tp-sthumb{height:130px;background:#f8fafc;border:1px solid #e5e9f0;border-radius:9px;display:flex;align-items:center;justify-content:center;margin-bottom:6px;padding:4px}
#tubeModal .tp-sthumb img,#tubeModal .tp-sthumb svg{max-width:100%;max-height:100%}
#tubeModal .tp-srow{display:flex;justify-content:space-between;align-items:center;margin-top:4px}
/* footer */
#tubeModal .tp-foot{display:flex;align-items:center;gap:10px;padding:10px 18px;background:#fff;border-top:1px solid #d9dee5;flex:0 0 auto;flex-wrap:wrap}
#tubeModal .tp-sum{font-size:13px;color:#64748b}
#tubeModal .tp-sum b{color:#10244b}
#tubeModal .tp-cust{display:flex;align-items:center;gap:6px;font-size:12px;color:#64748b}
#tubeModal .tp-cust input{height:34px;border:1px solid #cfd6df;border-radius:8px;padding:0 9px;font:inherit;font-size:13px;width:200px}
@media(max-width:1100px){#tubeModal .tp-s1{grid-template-columns:minmax(0,1fr) 360px}}
@media(max-width:860px){
  #tubeModal .tp-s1{grid-template-columns:1fr;overflow:auto}
  #tubeModal .tp-card{overflow:visible}
  #tubeModal .tp-step{padding:10px}
  #tubeModal .tp-head{padding:10px 12px}
  #tubeModal .tp-cust input{width:140px}
}
