/* FabForge Laser styles (Build 3). Written from scratch. Uses the shared app, formulas and tank styles. */
.lp-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.lp-main, .lp-one { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.lp-card { display: flex; flex-direction: column; gap: 12px; }
.lp-card .card-h, #lpTypes .card-h, .card .card-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-h h2 { font-size: 18px; text-transform: uppercase; letter-spacing: .04em; margin: 0; flex: 1; }
.card-h .num { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--amber); color: var(--amber); display: inline-grid; place-items: center; font-weight: 800; font-size: 14px; flex: none; }
.lp-card details { border-top: 1px solid var(--line); padding-top: 4px; }
.lp-card summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; gap: 8px; }
.lp-h3 { margin: 6px 0 2px; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--amber2); }
.lp-src { margin: 0; font-size: 13px; color: var(--muted); }
.lp-notes { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--muted); }
.lp-notes li.warn { color: var(--amber2); }
.lp-thk { margin-top: -4px; }
.lp-thk .chip { min-height: 38px; }
.lp-ro { display: flex; align-items: center; min-height: 44px; padding: 0 10px; color: var(--muted); font-size: 14px; }
/* parts */
.lp-parts { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.lp-part { border: 1px solid var(--line2); border-radius: 10px; padding: 10px; background: var(--bg); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.lp-part header { display: flex; align-items: center; gap: 8px; }
.lp-part header .num { width: 24px; height: 24px; border-radius: 50%; background: var(--amber); color: #15120a; display: inline-grid; place-items: center; font-weight: 800; font-size: 12px; flex: none; }
.lp-ph { flex: 1; min-width: 0; }
.lp-ph .fld { margin: 0; }
.lp-thumb { width: 64px; height: 48px; flex: none; background: #14171b; border: 1px solid var(--line); border-radius: 6px; }
.lp-thumb .th-fill { fill: #3b4047; stroke: var(--amber); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.lp-thumb .th-mark { fill: none; stroke: var(--blue); stroke-width: 1; vector-effect: non-scaling-stroke; }
.lp-part .fx-in { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lp-part p { margin: 0; }
.lp-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-top: 1px solid var(--line); padding-top: 10px; }
.lp-add .fld { min-width: 180px; margin: 0; }
.lp-file { cursor: pointer; position: relative; }
.lp-file:focus-within { outline: 3px solid var(--amber2); outline-offset: 2px; }
.btn.danger { border-color: var(--red); color: var(--red); }
/* nest and backplot */
.lp-canvas { background: #0d0f12; border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.lp-svg { display: block; width: 100%; height: auto; max-height: 560px; }
.lp-sheet { fill: #16191d; stroke: #5a616a; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.lp-used { fill: rgba(255,176,0,.04); stroke: #8a6a1d; stroke-dasharray: 6 4; stroke-width: 1; vector-effect: non-scaling-stroke; }
.lp-seam { stroke: #2e343c; stroke-dasharray: 4 4; stroke-width: 1; vector-effect: non-scaling-stroke; }
.lp-cut { fill: none; stroke: #ffb000; stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.lp-hole { fill: none; stroke: #ffd77a; stroke-width: 1.3; vector-effect: non-scaling-stroke; }
.lp-open { fill: none; stroke: #ff8a3d; stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.lp-small { stroke: var(--red); }
.lp-lead { fill: none; stroke: #46c25a; stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.lp-mark { fill: none; stroke: #5aa2e6; stroke-width: 1; vector-effect: non-scaling-stroke; }
.lp-pierce { fill: #f0605a; }
.lp-rapid { fill: none; stroke: #6b737d; stroke-width: .8; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; opacity: .7; }
.lp-num { fill: #e8eaed; font-family: var(--sans); font-weight: 800; text-anchor: middle; dominant-baseline: middle; opacity: .55; }
.lp-head { fill: #fff; stroke: #f0605a; stroke-width: 2; vector-effect: non-scaling-stroke; }
#lpBp path { fill: none; vector-effect: non-scaling-stroke; }
#lpBp .bp-cut { stroke: #ffffff; stroke-width: 2.2; }
#lpBp .bp-rapid { stroke: #f0605a; stroke-width: 1; stroke-dasharray: 2 3; }
#lpBp .bp-travel { stroke: #c792ea; stroke-width: 1.4; }
.lp-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); }
.lp-legend i { display: inline-block; width: 18px; height: 4px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.lg-cut { background: #ffb000; } .lg-hole { background: #ffd77a; } .lg-lead { background: #46c25a; } .lg-mark { background: #5aa2e6; }
.lg-pierce { background: #f0605a; width: 8px !important; height: 8px !important; border-radius: 50% !important; }
.lg-rapid { background: repeating-linear-gradient(90deg, #6b737d 0 4px, transparent 4px 7px); } .lg-bp { background: #fff; }
/* G-code, gates, approval */
.lp-status { font-size: 12px; font-weight: 800; letter-spacing: .08em; padding: 4px 10px; border-radius: 6px; border: 2px solid; white-space: nowrap; }
.lp-status.s-draft { color: var(--amber2); border-color: var(--amber); background: var(--amberbg); }
.lp-status.s-simulated { color: #fff; border-color: var(--blue); background: var(--bluebg); }
.lp-status.s-approved { color: var(--green); border-color: var(--green); background: var(--greenbg); }
.lp-status.s-released { color: #0c1a0e; border-color: var(--green); background: var(--green); }
.lp-gates { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; counter-reset: g; }
.lp-gates li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line2); border-radius: 8px; font-weight: 700; font-size: 14px; color: var(--muted); background: var(--bg); min-width: 0; }
.lp-gates li span { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; border: 2px solid var(--line2); font-size: 12px; flex: none; }
.lp-gates li.done { color: var(--green); border-color: rgba(70,194,90,.5); }
.lp-gates li.done span { background: var(--green); border-color: var(--green); color: #0c1a0e; }
.lp-gates li.now { color: var(--text); border-color: var(--amber); background: var(--amberbg); }
.lp-gates li.now span { border-color: var(--amber); color: var(--amber2); }
.lp-play { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lp-code { margin: 0; max-height: 300px; overflow: auto; background: #0d0f12; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: 12.5px/1.45 var(--mono); color: #fff; white-space: pre; }
.lp-ex { display: flex; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.lp-never { margin: 0; font-size: 13px; color: var(--amber2); font-weight: 700; }
.lp-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.lp-checks li { display: flex; align-items: flex-start; gap: 10px; padding: 6px 8px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); font-size: 14px; }
.lp-checks li > span { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 12px; }
.lp-checks li.ok > span { background: var(--green); color: #0c1a0e; } .lp-checks li.warn > span { background: var(--amber); color: #15120a; } .lp-checks li.bad > span { background: var(--red); color: #1a0d0c; }
.lp-checks li.bad { border-color: rgba(240,96,90,.6); }
.lp-checks.man li { align-items: center; min-height: 44px; }
.lp-checks.man input { width: 24px; height: 24px; accent-color: var(--amber); flex: none; margin: 0; }
.lp-checks.man label { cursor: pointer; flex: 1; }
.lp-sign { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; border-top: 1px solid var(--line); padding-top: 10px; }
.lp-sign .fx-in { flex: 1 1 340px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
/* right column */
.lp-ai { gap: 10px; }
.lp-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lp-aih { margin-top: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
/* other sections */
.lp-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.lp-type { border: 1px solid var(--line2); border-radius: 10px; padding: 12px; background: var(--bg); display: flex; flex-direction: column; gap: 8px; }
.lp-type.on { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber) inset; }
.lp-type header { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.lp-type h3 { margin: 0; font-size: 16px; flex: 1; }
.lp-nm { font-family: var(--mono); font-size: 12.5px; color: var(--amber2); }
.lp-type .tk-row b { font-family: var(--sans); font-weight: 600; font-size: 12.5px; }
.lp-type .btn { margin-top: auto; align-self: flex-start; }
.lp-tr { border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; background: var(--bg); }
.lp-tr + .lp-tr { margin-top: 8px; }
.lp-tr summary { cursor: pointer; font-weight: 700; min-height: 48px; display: flex; align-items: center; }
.lp-tr2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding-bottom: 10px; }
.lp-rtab td, .lp-rtab th { white-space: nowrap; }
.lp-rtab tr.lp-edge td { color: var(--amber2); }
.lp-each td, .lp-each th { white-space: nowrap; }
caption { text-align: left; color: var(--muted); font-size: 13px; padding: 4px 0; }
@media (max-width: 1100px) {
  .lp-grid { grid-template-columns: 1fr; }
  .lp-ai { position: static; max-height: none; }
}
@media (max-width: 760px) {
  .lp-parts { grid-template-columns: 1fr; }
  .lp-gates { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lp-tr2 { grid-template-columns: 1fr; }
  .lp-svg { max-height: 420px; }
  .lp-code { max-height: 240px; font-size: 12px; }
}
@media print {
  .lp-ai, .lp-add, .lp-play, .lp-ex, .lp-set, .lp-sign .btn { display: none !important; }
  .lp-grid { display: block; }
  .lp-code { max-height: none; overflow: visible; color: #000; background: #fff; }
}

/* ---------- Mark & engrave (mark.js) ---------- */
.mk-sub { margin: 4px 0 10px; }
.mk-sub .pill.small { min-height: 44px; }
.mk-verdict { border-radius: var(--r); padding: 10px 12px; margin: 8px 0; border: 1px solid var(--line); font-size: 15px; }
.mk-verdict b { margin-right: 6px; text-transform: uppercase; letter-spacing: .04em; }
.q-g { background: var(--greenbg); color: var(--text); } .q-g b, td.q-g .mk-cell { color: var(--green); }
.q-o { background: var(--amberbg); } .q-o b, td.q-o .mk-cell { color: var(--amber2); }
.q-p { background: var(--panel2); } .q-p b, td.q-p .mk-cell { color: var(--muted); }
.q-n { background: var(--bg2); } .q-n b, td.q-n .mk-cell { color: var(--dim); }
.q-x { background: var(--redbg); } .q-x b, td.q-x .mk-cell { color: var(--red); font-weight: 800; }
.mk-q { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid var(--line); }
.mk-legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.mk-modes { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.mk-modes .chip { min-height: 44px; }
.mk-modes .chip.dim { opacity: .55; }
.mk-how { margin: 6px 0; font-size: 14.5px; }
.mk-tips { font-size: 13.5px; }
.fx-in.mk-tpl { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.fx-in.mk-wide { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.mk-tpl input { font-family: var(--mono); }
.mk-tok summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; }
.mk-tok code, .mk-list code, .mk-data { font-family: var(--mono); background: var(--bg2); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.mk-list { margin: 8px 0; line-height: 2; overflow-wrap: anywhere; }
.mk-data { word-break: break-all; }
.mk-codebox { display: grid; grid-template-columns: 150px 1fr; gap: 12px; align-items: start; margin-top: 8px; }
.mk-sym { background: #fff; border-radius: 6px; padding: 6px; border: 1px solid var(--line); }
.mk-symsvg { width: 100%; height: auto; display: block; image-rendering: pixelated; }
.mk-gs1 td { font-size: 13px; }
.mk-prevbar { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.mk-prevbar .btn.small { min-width: 44px; min-height: 44px; }
.mk-prev { background: var(--bg2); border-radius: var(--r); padding: 10px; border: 1px solid var(--line); }
.mk-prev.small { padding: 6px; margin-bottom: 8px; }
.mk-svg { width: 100%; height: auto; display: block; max-height: 340px; }
.mk-plate { fill: #d9dde3; stroke: #7d8794; stroke-width: .25; }
.mk-quiet { fill: #eef1f4; }
.mk-svg .mk-code { fill: #15181c; }
.mk-svg .mk-text { stroke: #15181c; stroke-width: 1.4px; vector-effect: non-scaling-stroke; }
.mk-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; }
.mk-checks li { display: grid; grid-template-columns: 22px 1fr; gap: 4px; padding: 6px 8px; border-radius: 6px; background: var(--panel2); }
.mk-checks li.ok { background: var(--greenbg); } .mk-checks li.ok span { color: var(--green); font-weight: 800; }
.mk-checks li.bad { background: var(--redbg); } .mk-checks li.bad span { color: var(--red); font-weight: 800; }
.mk-checks li.warn { background: var(--amberbg); } .mk-checks li.warn span { color: var(--amber2); font-weight: 800; }
.mk-checks li.info span { color: #fff; font-weight: 800; }
.mk-compat th, .mk-compat td { white-space: nowrap; text-align: center; padding: 0; }
.mk-compat th[scope="row"] { text-align: left; padding: 6px 8px; white-space: normal; min-width: 170px; }
.mk-compat thead th { padding: 6px 8px; font-size: 13px; }
.mk-compat thead th.on, .mk-compat tr.on th { color: var(--amber); }
.mk-cell { display: block; width: 100%; min-height: 40px; padding: 4px 8px; background: none; border: 0; font: inherit; font-size: 13px; cursor: pointer; }
.mk-cell:focus-visible { outline: 3px solid var(--amber); outline-offset: -3px; }
.mk-warn { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--amberbg); color: var(--amber2); font-size: 12px; font-weight: 800; }
@media (max-width: 760px) { .mk-codebox { grid-template-columns: 110px 1fr; } .fx-in.mk-tpl, .fx-in.mk-wide { grid-template-columns: 1fr; } }
@media print { .mk-sub, .mk-prevbar { display: none; } }

.mk-now { margin-left: .5em; font-size: .9em; padding: .1em .4em; border-radius: 4px; background: var(--chip, rgba(127,127,127,.12)); word-break: break-all; }
