/* WindFire machine gallery, machine editor tabs, post library / editor and rotary settings (Claude; Windfire Admin).
   Shared by the NC Viewer (css/style.css variables) and WindFire CAM (cam.css maps its variables to the same names). */
.mgdlg, .pedlg { width: min(1320px, 97vw); max-width: 97vw !important; height: min(880px, 94vh); max-height: 94vh !important; padding: 0 !important; display: flex; flex-direction: column; overflow: hidden; }
.mgdlg:not([open]), .pedlg:not([open]) { display: none; }
.mg-head, .pe-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.mg-head h3, .pe-head h3 { margin: 0; white-space: nowrap; }
.mg-q { flex: 1; min-width: 120px; font-size: 14px; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); }
.mg-q:focus { outline: 2px solid var(--acc); }
.mg-x, .pe-x { background: none; border: 0; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; padding: 2px 8px; } .pe-sp { flex: 1; }
.mg-chips { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.mg-cg { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; } .mg-cl { font-size: 11px; color: var(--muted); margin-right: 2px; }
.mg-chip, .mg-maker { font-size: 12px; padding: 3px 10px; border-radius: 13px; background: var(--btn); border: 1px solid var(--line); color: var(--fg); cursor: pointer; }
.mg-chip[aria-pressed="true"] { background: var(--sel); border-color: var(--acc); }
.mg-camonly { font-size: 12px; color: var(--muted); display: inline-flex; gap: 4px; align-items: center; }
.mg-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 400px; }
.mg-grid { overflow-y: auto; padding: 4px 14px 14px; overscroll-behavior: contain; }
.mg-gh { position: sticky; top: 0; z-index: 2; background: var(--panel); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 2px 6px; }
.mg-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.mg-card { position: relative; border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); padding: 8px 9px 9px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; transition: border-color .12s, transform .12s, box-shadow .12s; }
.mg-card:hover { border-color: var(--acc); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.mg-card.sel { border-color: var(--acc); box-shadow: 0 0 0 2px var(--acc) inset; }
.mg-card.nocam { opacity: .62; }
.mg-pic { position: relative; height: 128px; border-radius: 7px; background: radial-gradient(ellipse at 50% 35%, rgba(120,150,190,.22), rgba(0,0,0,0) 70%), var(--bg); display: flex; align-items: center; justify-content: center; color: var(--muted); overflow: hidden; }
.mg-pic .mg-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.mg-pic.has3d > .mg-ico { display: none; }
.mg-kind { position: absolute; left: 6px; bottom: 5px; font-size: 10.5px; padding: 1px 7px 1px 5px; border-radius: 9px; background: rgba(0,0,0,.55); color: #e8edf3; display: inline-flex; gap: 4px; align-items: center; }
.mg-kind .mg-ico { width: 12px; height: 12px; }
.mg-star { position: absolute; right: 4px; top: 3px; background: rgba(0,0,0,.35); border: 0; color: #ffd166; font-size: 17px; line-height: 1; border-radius: 6px; padding: 2px 5px; cursor: pointer; }
.mg-star[aria-pressed="false"] { color: #cfd6de; }
.mg-name { font-weight: 600; font-size: 13px; line-height: 1.25; }
.mg-fits { font-size: 11.5px; color: var(--fg); opacity: .85; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; } .mg-fits span, .mg-dim { color: var(--muted); }
.mg-badges { display: flex; flex-wrap: wrap; gap: 3px; }
.mg-b { font-size: 10.5px; padding: 0 6px; border-radius: 8px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.mg-b.ax { border-color: var(--acc); color: var(--acc); } .mg-b.my { border-color: #3fb950; color: #3fb950; } .mg-b.soon { border-color: #d29922; color: #d29922; }
.mg-specs { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mg-empty { padding: 30px; text-align: center; color: var(--muted); }
.mg-detail { border-left: 1px solid var(--line); overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.mg-prev { height: 260px; border-radius: 10px; background: radial-gradient(ellipse at 50% 30%, rgba(120,150,190,.25), rgba(0,0,0,0) 70%), var(--bg); flex: 0 0 auto; cursor: grab; }
.mg-dh h4 { margin: 2px 0; font-size: 15px; } .mg-dk { font-size: 11.5px; color: var(--muted); display: inline-flex; gap: 5px; align-items: center; }
.mg-fitsl { font-size: 12px; margin: 0; } .mg-warn { color: #d29922; font-size: 12px; margin: 0; } .mg-hint { color: var(--muted); }
.mg-spec { width: 100%; border-collapse: collapse; font-size: 12px; } .mg-spec th { text-align: left; color: var(--muted); font-weight: 500; padding: 3px 8px 3px 0; vertical-align: top; width: 38%; } .mg-spec td { padding: 3px 0; }
.mg-spec tr + tr { border-top: 1px solid var(--line); }
.mg-post { display: flex; gap: 6px; align-items: center; font-size: 12px; flex-wrap: wrap; } .mg-post select { flex: 1; min-width: 140px; }
.mg-dact { display: flex; gap: 6px; flex-wrap: wrap; }
.mg-foot { display: flex; gap: 8px; align-items: center; padding: 8px 14px; border-top: 1px solid var(--line); } .mg-sp { flex: 1; } .mg-count { font-size: 12px; color: var(--muted); }
.mgdlg button.pri, .pedlg button.pri { background: var(--acc); border-color: var(--acc); color: #fff; }
.mgdlg button:disabled, .pedlg button:disabled { opacity: .45; cursor: default; }
@media (max-width: 900px) { .mg-body { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; } .mg-detail { border-left: 0; border-top: 1px solid var(--line); max-height: 45vh; } .mg-prev { height: 180px; } .mg-cards { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); } .mg-pic { height: 96px; } }
@media (prefers-reduced-motion: reduce) { .mg-card { transition: none; } .mg-card:hover { transform: none; } }

/* machine editor tabs (v1.9.10) */
.medtabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--line); margin: 4px 0 10px; }
.medtabs button { background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 6px 10px; color: var(--muted); cursor: pointer; }
.medtabs button.on { color: var(--fg); border-bottom-color: var(--acc); }
.medro { font-size: 12px; padding: 5px 9px; border-radius: 7px; background: rgba(255,122,26,.12); border: 1px solid rgba(255,122,26,.35); margin: 0 0 6px; }
.medsec textarea { background: var(--panel2); color: var(--fg); border: 1px solid var(--line); border-radius: 5px; }

/* rotary axis settings form */
.ro-scroll { overflow-x: auto; }
.ro-tab th small { display: block; font-weight: 400; color: var(--muted); font-size: 10.5px; }
.ro-tab td select { max-width: 210px; } .ro-tab input[type=number] { width: 74px; } .ro-mm { display: inline-flex; gap: 3px; margin-left: 4px; }
.ro-lim { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; }
.ro-lim legend { font-weight: 600; } .ro-lim input[type=number] { width: 70px; } .ro-lim p { flex-basis: 100%; margin: 2px 0; }
.ro-linear { font-size: 12.5px; } .ro-linear label { margin-right: 10px; }

/* post library and editor */
.pe-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 230px minmax(0, 1fr) minmax(300px, 38%); }
.pe-lib { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; padding: 8px; gap: 6px; }
.pe-q { padding: 6px 8px; border-radius: 7px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); }
.pe-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.pe-gh { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 4px 2px; }
.pe-it { text-align: left; background: none; border: 1px solid transparent; border-radius: 6px; padding: 5px 7px; cursor: pointer; color: var(--fg); display: flex; flex-direction: column; }
.pe-it small { color: var(--muted); font-size: 10.5px; } .pe-it:hover { background: var(--btn); } .pe-it.on { background: var(--sel); border-color: var(--acc); }
.pe-libact { display: flex; flex-direction: column; gap: 4px; }
.pe-edit { overflow-y: auto; padding: 10px 12px; min-width: 0; }
.pe-top { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.pe-name { font-size: 15px; font-weight: 600; padding: 5px 8px; border-radius: 7px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); }
.pe-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; } .pe-var { max-width: 260px; }
.pe-ro-note { margin: 0; font-size: 12px; padding: 5px 9px; border-radius: 7px; background: rgba(255,122,26,.12); border: 1px solid rgba(255,122,26,.35); }
.pe-notes { font-size: 12px; margin: 0; }
.pe-cols { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 10px; }
.pe-secs { display: flex; flex-direction: column; gap: 1px; }
.pe-sec { text-align: left; background: none; border: 0; border-left: 2px solid transparent; padding: 5px 8px; color: var(--muted); cursor: pointer; border-radius: 0; }
.pe-sec.on { color: var(--fg); border-left-color: var(--acc); background: var(--btn); }
.pe-fields { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.pe-f { display: grid; grid-template-columns: minmax(130px, 40%) 1fr; gap: 8px; align-items: center; font-size: 12.5px; }
.pe-in { display: flex; gap: 4px; min-width: 0; } .pe-in input[type=text], .pe-in textarea { flex: 1; min-width: 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.pe-in input, .pe-in select, .pe-in textarea, .pe-blk textarea { background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: 5px; padding: 3px 6px; }
.pe-pre { max-width: 110px; }
.pe-ck { font-size: 12.5px; display: flex; gap: 6px; align-items: center; }
.pe-blk { display: flex; flex-direction: column; gap: 3px; } .pe-blk textarea { width: 100%; font: 12px/1.35 ui-monospace, Menlo, Consolas, monospace; resize: vertical; } .pe-blk textarea[readonly] { opacity: .7; }
.pe-prev { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; padding: 8px; gap: 6px; }
.pe-ph { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 12px; } .pe-ph select { max-width: 220px; }
.pe-probs { max-height: 34%; overflow-y: auto; font-size: 12px; } .pe-probs ul { margin: 0; padding-left: 4px; list-style: none; } .pe-probs li { padding: 2px 0; }
.pe-problem { color: #f85149; } .pe-warning { color: #d29922; } .pe-info { color: var(--muted); } .pe-probs .ok { color: #3fb950; margin: 0; } .pe-probs .bad { color: #f85149; margin: 0; }
.pe-out { flex: 1; min-height: 120px; width: 100%; box-sizing: border-box; background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: 6px; font: 12px/1.35 ui-monospace, Menlo, Consolas, monospace; padding: 6px; resize: none; }
@media (max-width: 1100px) { .pe-body { grid-template-columns: 200px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 40%; } .pe-prev { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); } .pe-cols { grid-template-columns: 1fr; } .pe-secs { flex-direction: row; flex-wrap: wrap; } }
@media (max-width: 700px) { .pe-body { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr) 40%; } .pe-lib { border-right: 0; max-height: 30vh; } }

/* the NC Viewer's machine editor and machine search inside WindFire CAM (same rules as css/style.css) */
body.wfcam .mf { display: grid; grid-template-columns: 150px 1fr; gap: 6px 10px; align-items: center; }
body.wfcam .mf input[type=number], body.wfcam .mf input[type=text] { width: 90px; background: var(--panel2); border: 1px solid var(--line); border-radius: 5px; padding: 3px 5px; color: var(--fg); }
body.wfcam .mf .trip, body.wfcam .trip { display: flex; gap: 4px; }
body.wfcam .rt { width: 100%; border-collapse: collapse; margin: 8px 0; } body.wfcam .rt td, body.wfcam .rt th { padding: 3px; text-align: left; font-size: 12px; }
body.wfcam .rt input { width: 80px; background: var(--panel2); border: 1px solid var(--line); border-radius: 5px; padding: 2px 4px; color: var(--fg); }
body.wfcam .muted { color: var(--muted); font-size: 12px; }
body.wfcam dialog.medlg { max-width: min(1180px, 97vw); width: 1180px; max-height: 94vh; }
body.wfcam dialog.medlg button, body.wfcam dialog.medlg select, body.wfcam .mgdlg button, body.wfcam .mgdlg select, body.wfcam .pedlg button, body.wfcam .pedlg select, body.wfcam .rodlg select { background: var(--btn); border: 1px solid var(--line); border-radius: 6px; padding: 4px 9px; color: var(--fg); cursor: pointer; font: inherit; }
body.wfcam dialog.medlg menu { display: flex; justify-content: flex-end; gap: 6px; padding: 0; margin: 12px 0 0; }
body.wfcam .rodlg { max-width: min(1100px, 96vw); }
body.wfcam dialog.medlg { max-width: min(1180px, 97vw); width: 1180px; }
body.wfcam .medtop { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 10px; }
body.wfcam .medcols { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 14px; }
body.wfcam @media (max-width: 900px) { .medcols { grid-template-columns: minmax(0, 1fr); } }
body.wfcam .medview { height: 320px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
body.wfcam .medsl { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin-top: 8px; }
body.wfcam .medslr { display: flex; align-items: center; gap: 6px; font-size: 12px; } .medslr input { flex: 1; min-width: 60px; } .medslr output { width: 46px; text-align: right; font-variant-numeric: tabular-nums; }
body.wfcam .medtip { font-size: 12px; margin-top: 6px; }
body.wfcam .medscroll { overflow-x: auto; }
body.wfcam .medax input[type=number] { width: 62px; } .medax .alet { width: 26px; text-align: center; } .medax select { max-width: 130px; } .medax .trip input { width: 54px; }
body.wfcam .medax .nowrap { white-space: nowrap; } .medax .ib { padding: 2px 6px; }
body.wfcam .medax .alet { min-width: 30px; padding: 2px 0 !important; }
body.wfcam .medmsg { margin: 8px 0 0; font-size: 13px; } .medmsg.bad { color: #e5534b; } .medmsg.ok { color: #3fb950; }
body.wfcam .medpw { font-size: 12px; } body.wfcam .medpw:not(:empty) { color: #e5534b; } body.wfcam #medTpl { max-width: 260px; }
body.wfcam .trip3 { display: inline-flex; gap: 3px; white-space: nowrap; } .medax .trip3 input { width: 52px; }
body.wfcam #summary label.chk { white-space: nowrap; cursor: pointer; color: var(--fg); pointer-events: auto; }
body.wfcam #summary input[data-ch] { vertical-align: -2px; margin: 0 2px 0 0; }
body.wfcam .medinfo { border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; margin: 6px 0 10px; font-size: 12.5px; }
body.wfcam .medinfo summary { cursor: pointer; font-weight: 600; }
body.wfcam .medinfo ul { margin: 2px 0 6px 18px; padding: 0; }
body.wfcam .medinfo p { margin: 6px 0 2px; }
body.wfcam .vfy { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 9px; background: #e8a33c33; color: #b8741a; }
body.wfcam input.vfy-f { box-shadow: inset 3px 0 0 #e8a33c; }
body.wfcam #medFind { margin-right: 8px; }
body.wfcam .msp { position: fixed; z-index: 40; background: var(--panel); color: var(--fg); border: 1px solid var(--line); border-radius: 10px; padding: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.35); display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
body.wfcam .msp[hidden] { display: none; }
body.wfcam .msp.msp-full { left: 6px !important; right: 6px; width: auto !important; border-radius: 10px; }
body.wfcam .msp-in { position: absolute; left: 0; top: calc(100% + 4px); width: min(540px, 86vw); max-height: 60vh; }
body.wfcam .msp-in.msp-full { position: fixed; top: 8px; max-height: calc(100dvh - 16px); }
body.wfcam .medstart { position: relative; display: inline-block; }
body.wfcam .msx { display: flex; flex-direction: column; gap: 6px; min-height: 0; flex: 1 1 auto; }
body.wfcam .msx-q { width: 100%; box-sizing: border-box; font-size: 14px; padding: 7px 9px; border-radius: 7px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); }
body.wfcam .msx-q:focus { outline: 2px solid var(--acc); outline-offset: 0; }
body.wfcam .msx-chips { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
body.wfcam .msx-cg { display: inline-flex; flex-wrap: wrap; gap: 3px; align-items: center; }
body.wfcam .msx-cl { font-size: 11px; color: var(--muted); margin-right: 2px; }
body.wfcam .msx-chip { font-size: 11.5px; padding: 2px 8px; border-radius: 12px; background: var(--btn); border: 1px solid var(--line); color: var(--fg); cursor: pointer; }
body.wfcam .msx-chip[aria-pressed="true"], select.msx-chip.on { background: var(--sel); border-color: var(--acc); }
select.msx-chip { max-width: 190px; padding-right: 4px; }
body.wfcam .msx-count { font-size: 11px; color: var(--muted); }
body.wfcam .msx-list { overflow-y: auto; min-height: 80px; max-height: 52vh; border-top: 1px solid var(--line); padding-top: 2px; overscroll-behavior: contain; }
body.wfcam .msp-full .msx-list { max-height: none; flex: 1 1 auto; }
body.wfcam .msx-in .msx-list { max-height: 190px; }
body.wfcam .msx-gh { position: sticky; top: 0; z-index: 1; background: var(--panel); font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 6px 6px 2px; }
body.wfcam .msx-row { padding: 5px 8px; border-radius: 6px; cursor: pointer; display: flex; flex-direction: column; gap: 1px; }
body.wfcam .msx-row.act { background: var(--sel); }
body.wfcam .msx-row.cur { box-shadow: inset 3px 0 0 var(--acc); }
body.wfcam .msx-l1 { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; }
body.wfcam .msx-n { font-size: 13px; min-width: 0; }
body.wfcam .msx-cur { color: var(--muted); font-size: 11px; }
body.wfcam .msx-bs { display: inline-flex; gap: 3px; flex: 0 0 auto; }
body.wfcam .msx-badge { font-size: 10px; padding: 0 5px; border-radius: 8px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
body.wfcam .msx-fit { font-size: 11.5px; color: var(--fg); opacity: .9; }
body.wfcam .msx-fit.msx-dim { color: var(--muted); opacity: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.wfcam .msx-fl { color: var(--muted); }
body.wfcam .msx mark { background: rgba(255,122,26,.28); color: inherit; border-radius: 2px; padding: 0 1px; }
body.wfcam .msx-empty { padding: 14px 8px; color: var(--muted); text-align: center; }
body.wfcam .msx-empty button { margin-left: 6px; }
body.wfcam .msp-foot { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; border-top: 1px solid var(--line); padding-top: 6px; font-size: 12px; }
body.wfcam .msp-foot select { max-width: 200px; }
body.wfcam .msp-flip { display: inline-flex; gap: 6px; align-items: center; }
body.wfcam #suggest .sg-pick .msx { width: 100%; }
body.wfcam #suggest .sg-pick > .sg-lbl { flex: 0 0 auto; font-size: 12px; opacity: .85; }
body.wfcam #suggest .sg-pick > .msx { flex: 0 0 auto; }
body.wfcam .mgdlg button.pri, body.wfcam .pedlg button.pri { background: var(--acc); border-color: var(--acc); color: #fff; }
body.wfcam dialog.medlg { overflow: auto; }
