/* Layout: machine view on the left, CNC unit (screen + MDI keypad) and operator panel on the right.
   Single industrial dark look (deliberately one theme): machine paint greys, LCD light panel, amber accents. */
:root {
  --bg: #121417; --panel: #1d2125; --bezel: #2c3136; --bezel-hi: #3b4147; --ink: #e8ecef; --muted: #9aa3ab;
  --key: #e3e6e9; --key-ink: #15181b; --key-f: #b9c0c7; --accent: #f0a12a; --ok: #34c759; --bad: #ff453a; --warn: #ffcc00;
  --op: #c6cacf; --op-ink: #1d2125; --lcd-bg: #eef0ea; --lcd-ink: #10151a; --lcd-hdr: #1f3f86; --lcd-sel: #ffd84d;
  --f-ui: "Inter", "Segoe UI", Arial, sans-serif; --f-mono: "IBM Plex Mono", Consolas, "Courier New", monospace;
  color-scheme: dark;
}
[hidden] { display: none !important; }
html, body { height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-ui); font-size: 13px; overflow: hidden; }
button { font-family: inherit; cursor: pointer; }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.app { height: 100%; display: flex; flex-direction: column; padding-left: max(8px, env(safe-area-inset-left, 0px)); padding-right: max(8px, env(safe-area-inset-right, 0px)); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; padding-block: 6px; border-bottom: 1px solid #2a2f34; }
.brand b { font-weight: 800; letter-spacing: 0.06em; font-size: 15px; margin-right: 10px; }
.brand span { color: var(--muted); font-size: 12px; }
.tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tb { background: #262b30; color: var(--ink); border: 1px solid #3a4046; border-radius: 4px; padding: 5px 10px; font-size: 12px; font-weight: 500; }
.tb.on { border-color: var(--accent); color: var(--accent); }
.tb.help { background: var(--accent); color: #111; border-color: var(--accent); font-weight: 700; }
.tb.speed select { background: #15181b; color: var(--ink); border: 1px solid #3a4046; border-radius: 3px; margin-left: 4px; }
.sep { width: 1px; height: 20px; background: #3a4046; }
.work { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(430px, 1fr); gap: 8px; padding-block: 8px; }
.machine-view { min-width: 0; min-height: 0; border-radius: 6px; overflow: hidden; border: 6px solid #3a3f45; box-shadow: inset 0 0 0 1px #000, 0 0 0 1px #555; background: #1a1d21; }
#mv { width: 100%; height: 100%; display: block; touch-action: none; }
.cnc { min-width: 0; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }

/* CNC unit: yellow bezel strip, screen, soft keys, vertical blank keys, MDI keypad (as on the machine) */
.cnc-unit { background: linear-gradient(#45494e, #33373b); border-radius: 6px; padding: 8px; display: grid; grid-template-columns: minmax(0, 1fr) 26px 214px; gap: 8px; box-shadow: inset 0 1px 0 #5a5f64, 0 2px 6px rgba(0,0,0,0.5); }
.screen-wrap { min-width: 0; }
.bezel-strip { height: 14px; background: linear-gradient(#f5c400, #d9a900); border-radius: 2px; margin-bottom: 5px; }
.vkeys { display: flex; flex-direction: column; gap: 9px; padding-top: 30px; }
.vkeys span { height: 26px; border-radius: 3px; background: linear-gradient(#3a3e42, #222528); border: 1px solid #111; box-shadow: 0 1px 0 #555; }
.lcd { container-type: inline-size; --c: #9ff3ff; --w: #eaf6f8; --pane: #33475e; --line: #5c7590; background: #1a2532; color: var(--w); font-family: var(--f-mono); font-size: 11.5px; border: 4px solid #0b0d0f; border-radius: 3px; height: 392px; display: flex; flex-direction: column; overflow: hidden; box-shadow: inset 0 0 22px rgba(0,0,0,0.5); }
.lcd.off { background: #050607; }
.lcd .hdr { display: flex; align-items: flex-end; gap: 10px; padding: 3px 6px 2px; background: #141c26; border-bottom: 1px solid #000; }
.lcd .hdr .ht { align-self: flex-start; font-size: 11px; color: var(--w); white-space: nowrap; }
.lcd .hdr .hc { font-size: 11px; color: var(--w); margin-left: auto; padding-bottom: 3px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lcd .hdr .hon { flex: none; white-space: nowrap; color: var(--c); font-size: min(26px, 5.2cqw); line-height: 1; letter-spacing: 0.02em; font-weight: 500; }
.lcd .bd { flex: 1; min-height: 0; overflow: hidden; padding: 3px 5px; background: #24354a; }
.lcd .ttl { color: var(--c); border-bottom: 1px solid var(--line); margin-bottom: 4px; padding-bottom: 2px; }
.lcd .big { padding: 10px 6px; }
.lcd .big .bv { font-size: 30px; line-height: 1.25; font-variant-numeric: tabular-nums; white-space: pre; }
.lcd .big .bv span { display: inline-block; width: 30px; color: var(--c); }
.lcd .quad { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; font-variant-numeric: tabular-nums; }
.lcd .quad b { color: var(--c); font-size: 11px; font-weight: 500; }
.lcd .quad p { margin: 1px 0; font-size: 15px; white-space: pre; }
.lcd .foot { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 11px; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 3px; }
.lcd .prog .pl, .lcd .pc .pl { white-space: pre; line-height: 1.42; padding: 0 3px; overflow: hidden; }
.lcd .prog.small .pl { line-height: 1.3; }
.lcd .pl.exec { background: #39e0e8; color: #062a30; }
.lcd .ctok { background: #39e0e8; color: #062a30; }
.lcd .tbl { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.lcd .tbl th { text-align: left; color: var(--c); font-size: 11px; font-weight: 500; border-bottom: 1px solid var(--line); }
.lcd .tbl td { padding: 0 6px 0 0; white-space: pre; }
.lcd .tbl .cur, .lcd .tbl tr.cur td { background: #39e0e8; color: #062a30; }
.lcd .tbl tr.sel td:first-child { color: var(--c); }
.lcd .tbl .dim { color: #9fb1c2; font-size: 11px; }
.lcd .txt { line-height: 1.5; }
.lcd .alm { color: #ff6b6b; font-weight: 600; margin-top: 4px; }
.lcd .help { color: #ffd166; font-family: var(--f-ui); font-size: 12px; margin: 2px 0 6px; }
.lcd .modal span { display: inline-block; min-width: 46px; margin: 2px; padding: 1px 4px; border: 1px solid var(--line); }
.lcd .grc { width: 100%; height: 280px; display: block; }
/* combined POS screen like the photos */
.lcd .pc { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr auto auto; gap: 3px; height: 100%; }
.lcd .pc > div { background: var(--pane); border: 1px solid #1a2532; min-width: 0; overflow: hidden; }
.lcd .pc .lbl { color: var(--w); font-size: 11px; padding-left: 44%; }
.lcd .pc .lbl.c { text-align: center; padding-left: 0; }
.lcd .pc-abs { grid-column: 1; grid-row: 1 / 3; padding: 1px 6px; }
.lcd .bigx { display: flex; justify-content: space-between; font-size: min(31px, 6.6cqw); line-height: 1.12; color: var(--w); font-variant-numeric: tabular-nums; }
.lcd .bigx b { color: var(--c); font-weight: 400; }
.lcd .pc-f { grid-column: 2; grid-row: 1; padding: 0 5px 2px; }
.lcd .fbig { display: flex; align-items: baseline; gap: 4px; }
.lcd .fbig b { color: var(--c); font-size: 26px; font-weight: 400; line-height: 1; }
.lcd .fbig span { margin-left: auto; font-size: 26px; line-height: 1; }
.lcd .fbig i { font-style: normal; font-size: 9px; }
.lcd .kv { display: flex; justify-content: space-between; font-size: 11px; line-height: 1.35; }
.lcd .pc-mod { grid-column: 1; grid-row: 3; padding: 0 4px 2px; }
.lcd .mr { display: grid; grid-template-columns: 34px 34px 40px 12px 44px 12px 1fr; font-size: 10.5px; line-height: 1.3; }
.lcd .mr span:nth-child(5) { text-align: right; padding-right: 3px; }
.lcd .pc-prog { grid-column: 2; grid-row: 2 / 5; padding: 0 3px; }
.lcd .bc { font-size: 11px; margin-bottom: 2px; }
.lcd .pc-s { grid-column: 1; grid-row: 4; display: grid; grid-template-columns: 14px 1fr 30px 20px; padding: 0 5px; font-size: 11px; background: #2a3b50 !important; }
.lcd .kin { background: #e9ecef; color: #10151a; border-top: 1px solid #000; padding: 1px 6px; display: flex; gap: 10px; align-items: baseline; min-height: 18px; margin: 0 5px; }
.lcd .kin span { font-weight: 500; }
.lcd .kin u { text-decoration: none; animation: blink 1s steps(1) infinite; }
.lcd .kin i { color: #8a4b00; font-style: normal; }
.lcd .kin b { color: #b00020; }
.lcd .kin em { margin-left: auto; font-style: normal; background: #222; color: #fff; padding: 0 4px; }
.lcd .st { background: #1a2532; display: flex; gap: 10px; padding: 2px 6px; font-size: 11px; color: var(--w); }
.lcd .st span { background: #3a4f68; padding: 0 4px; }
.lcd .st .msgb { background: #f5c400; color: #111; }
.lcd .st .sl { margin-left: auto; background: none; }
.blink { color: #ff6b6b; animation: blink 0.8s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.soft { display: grid; grid-template-columns: 16px repeat(5, minmax(0, 1fr)) 14px repeat(5, minmax(0, 1fr)) 16px; gap: 3px; margin-top: 5px; align-items: stretch; }
.soft button { background: linear-gradient(#5d6f84, #3f4f62); color: #eaf6f8; border: 1px solid #1a2532; border-radius: 2px; height: 32px; font-family: var(--f-mono); font-size: 10px; padding: 0 2px; line-height: 1.05; overflow-wrap: anywhere; }
.soft .skn { background: linear-gradient(#7e8c9a, #56626e); color: #9dff9d; font-size: 9px; padding: 0; }
.soft .skm { color: #6fe36f; font-size: 11px; align-self: center; text-align: center; }
.soft .sk.on { background: linear-gradient(#7fd8e6, #3aa6b8); color: #062a30; }
.keypad { display: flex; flex-direction: column; gap: 7px; padding-top: 2px; }
.kp-addr, .kp-func, .kp-cur { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.kp-cur { grid-template-rows: 34px 34px; }
.key { background: linear-gradient(#6a6f75, #45494e); color: #f4f6f8; border: 1px solid #1d2023; border-radius: 4px; height: 33px; padding: 0; position: relative; font-weight: 600; font-size: 15px; box-shadow: 0 2px 0 #18191b, inset 0 1px 0 #8a9096; font-family: var(--f-ui); }
.key:active { transform: translateY(1px); box-shadow: none; }
.key b { position: absolute; left: 6px; top: 4px; font-weight: 600; }
.key i { position: absolute; right: 4px; bottom: 3px; font-size: 9px; font-style: normal; color: #cfd4d9; font-weight: 600; }
.key.eob b { font-size: 9px; top: 6px; }
.key.fk { font-size: 7.5px; line-height: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 3px; gap: 2px; background: linear-gradient(#5b6066, #3c4044); }
.fi { width: 13px; height: 10px; border: 1.3px solid #e6e9ec; border-radius: 2px; display: block; }
.fi-shift, .fi-can, .fi-input, .fi-alter, .fi-insert, .fi-delete { border-radius: 50% 50% 2px 2px; }
.key.ck { font-size: 7.5px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.key.ck b { position: static; font-size: 14px; line-height: 1; }
.key.reset { background: linear-gradient(#6a6f75, #45494e); }

/* operator panel (slate, like the Macpower panel) */
.operator { background: linear-gradient(#34434f, #2a3741); color: #e9eef2; border-radius: 6px; padding: 10px; display: flex; flex-direction: column; gap: 10px; box-shadow: inset 0 1px 0 #4a5a66, 0 2px 6px rgba(0,0,0,0.5); font-family: var(--f-ui); }
.operator.off .led, .operator.off .lamp span { background: #2d2d2d !important; box-shadow: inset 0 0 2px #000 !important; }
.op-top { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.blk { display: grid; grid-template-columns: repeat(var(--n, 3), 44px); grid-auto-rows: 42px; gap: 6px; }
.blk.modes { --n: 5; }
.mk, .dk { position: relative; border-radius: 3px; padding: 12px 1px 2px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 1px; font-size: 8px; font-weight: 700; line-height: 1.05; text-align: center; box-shadow: 0 2px 0 #10161b; }
.mk { background: linear-gradient(#fbfaf5, #dedbd0); color: #1d2125; border: 1px solid #8f8c82; }
.mk.red { background: linear-gradient(#f0463d, #c21c14); color: #fff; border-color: #7b120c; }
.dk { background: linear-gradient(#2b3036, #15181b); color: #f2f4f6; border: 1px solid #000; }
.dk.grn { background: linear-gradient(#2fc24f, #148a2c); color: #eaffea; }
.dk.rd { background: linear-gradient(#ee3b33, #b5150e); color: #fff; }
.mk:active, .dk:active { transform: translateY(2px); box-shadow: none; }
.mk .led, .dk .led { position: absolute; left: 3px; top: 3px; width: 6px; height: 6px; border-radius: 50%; background: #4a2a10; box-shadow: inset 0 0 1px #000; }
.mk.on .led, .dk.on .led { background: #ffb21a; box-shadow: 0 0 6px #ffb21a; }
.dk.grn.on .led { background: #8cff7a; box-shadow: 0 0 6px #8cff7a; }
.ic { width: 15px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.station { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 30px; }
.stl { font-size: 10px; font-weight: 700; letter-spacing: 0.04em; }
.seg { background: #120606; border: 3px solid #2a2f33; border-radius: 3px; padding: 6px 10px; width: 92px; box-shadow: inset 0 0 8px #000; }
.seg svg { width: 100%; display: block; }
.seg polygon { fill: #3a0b08; }
.seg polygon.on { fill: #ff3a24; filter: drop-shadow(0 0 2px #ff3a24); }
.op-mid { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.mpg-box { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.mpg-lbl { display: flex; flex-direction: column; align-items: center; font-size: 9px; font-weight: 700; }
.mpg-lbl .tag { border: 1px solid #c9d1d7; padding: 0 5px; margin-bottom: 1px; }
.mpg-info { font-family: var(--f-mono); font-size: 10px; color: #9ff3ff; min-height: 13px; }
#mpg { width: 150px; height: 150px; display: block; touch-action: none; cursor: grab; }
.jog { display: grid; grid-template-columns: repeat(3, 44px); grid-template-rows: repeat(3, 44px); gap: 12px; }
.jk { position: relative; border-radius: 3px; background: linear-gradient(#2b3036, #15181b); color: #f2f4f6; border: 1px solid #000; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; box-shadow: 0 2px 0 #10161b; }
.jk b { font-size: 22px; font-weight: 400; }
.jk i { font-size: 8px; font-style: normal; font-weight: 700; }
.jk:active { transform: translateY(2px); box-shadow: none; }
.jk.rap { background: linear-gradient(#f6d44a, #d9ab10); color: #2a2000; }
.jk .hl { position: absolute; right: 3px; bottom: 3px; width: 6px; height: 6px; border-radius: 50%; border: 1px solid #9aa3ab; }
.jk .hl.on { background: #7dff6a; border-color: #7dff6a; box-shadow: 0 0 6px #7dff6a; }
.jog [data-jog="X+"] { grid-column: 2; grid-row: 1; }
.jog [data-jog="Z-"] { grid-column: 1; grid-row: 2; }
.jog [data-jog="RAP"] { grid-column: 2; grid-row: 2; }
.jog [data-jog="Z+"] { grid-column: 3; grid-row: 2; }
.jog [data-jog="X-"] { grid-column: 2; grid-row: 3; }
.dial-box { display: flex; flex-direction: column; align-items: center; }
.dl { font-size: 10px; font-weight: 700; letter-spacing: 0.03em; }
.dsub { font-size: 9px; color: #c9d1d7; }
.dial-box canvas { width: 140px; height: 140px; cursor: pointer; }
.op-bot { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: flex-end; }
.bb { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bl { font-size: 9.5px; font-weight: 700; }
.cs, .fh, .rs { width: 50px; height: 50px; border-radius: 50%; border: 4px solid #1b2228; box-shadow: 0 3px 0 #10161b; }
.cs { background: radial-gradient(circle at 40% 35%, #8af19f, #1a8a3a); }
.cs.on { background: radial-gradient(circle at 40% 35%, #d9ffd9, #3ef06a); box-shadow: 0 0 18px #3ef06a, 0 3px 0 #10161b; }
.fh { background: radial-gradient(circle at 40% 35%, #f0c77a, #a8761c 75%); width: 56px; height: 56px; }
.fh.on { box-shadow: 0 0 16px #ffb21a, 0 3px 0 #10161b; }
.rs { background: radial-gradient(circle at 40% 35%, #ffe680, #e0a800); }
.cs:active, .fh:active, .rs:active { transform: translateY(2px); box-shadow: none; }
.kl2 { display: flex; gap: 16px; font-size: 8px; font-weight: 700; }
.lock { width: 40px; height: 40px; border-radius: 50%; background: radial-gradient(circle, #c9ced3, #6e757b); border: 3px solid #23292e; position: relative; }
.lock .kslot { position: absolute; left: 50%; top: 50%; width: 5px; height: 20px; margin: -10px 0 0 -2.5px; background: #20252a; border-radius: 2px; transform: rotate(-40deg); transition: transform 0.2s; }
.lock.on .kslot { transform: rotate(40deg); }
.pwl { display: flex; gap: 10px; font-size: 8px; font-weight: 700; }
.pwb { display: flex; align-items: center; gap: 4px; background: #c9ced3; padding: 3px; border-radius: 3px; }
.pon, .poff { width: 32px; height: 34px; border-radius: 2px; border: 1px solid #222; }
.pon { background: linear-gradient(#3fcf63, #1a8a3a); }
.poff { background: linear-gradient(#ef4b42, #b5150e); }
.pled { width: 14px; height: 30px; border-radius: 2px; background: #5a3a10; }
.pled.on { background: #ff9d1a; box-shadow: 0 0 8px #ff9d1a; }
.estop { width: 84px; height: 84px; border-radius: 50%; background: radial-gradient(circle at 50% 50%, #d81e15 38%, #f5c400 40%, #f5c400 64%, #2a3741 66%); border: 0; color: #1d1d1d; font-weight: 800; font-size: 7px; position: relative; box-shadow: 0 4px 0 #10161b; }
.estop span { position: absolute; inset: 4px; display: flex; align-items: flex-start; justify-content: center; padding-top: 5px; }
.estop.on { filter: brightness(0.8); transform: translateY(3px); box-shadow: none; }
.side { display: flex; flex-wrap: wrap; gap: 8px; border-top: 1px dashed #56666f; padding-top: 8px; }
.sg { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; background: rgba(0,0,0,0.15); border-radius: 4px; padding: 5px 6px; }
.sgl { width: 100%; font-size: 9px; font-weight: 700; color: #c9d1d7; }
.pb { background: linear-gradient(#f7f8f9, #d2d6da); border: 1px solid #727a82; border-radius: 3px; min-height: 28px; padding: 2px 6px; font-size: 9.5px; font-weight: 700; color: #1d2125; line-height: 1.1; display: inline-flex; align-items: center; gap: 4px; box-shadow: 0 2px 0 #10161b; }
.pb:active { transform: translateY(2px); box-shadow: none; }
.pb .led { width: 7px; height: 7px; border-radius: 50%; background: #5a2a2a; flex: none; }
.pb.on .led { background: #ff4d3d; box-shadow: 0 0 6px #ff4d3d; }
.pb.sm { min-height: 24px; }
.lamps { gap: 4px 10px; font-size: 9px; font-weight: 700; }
.lamp { display: flex; align-items: center; gap: 4px; }
.lamp span { width: 10px; height: 10px; border-radius: 50%; background: #3d4a3e; box-shadow: inset 0 0 2px #000; }
.lamp.on span { background: #3ef06a; box-shadow: 0 0 7px #3ef06a; }
.lamp[data-l="al"].on span { background: #ff3b30; box-shadow: 0 0 7px #ff3b30; }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 20; padding: 16px; }
.mbox { background: #1f2327; color: var(--ink); border: 1px solid #3a4046; border-radius: 8px; width: min(980px, 100%); max-height: 92vh; display: flex; flex-direction: column; }
.mhead { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-bottom: 1px solid #333a40; gap: 8px; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.tabs button { background: #2a3035; color: var(--ink); border: 1px solid #3a4046; border-radius: 4px; padding: 5px 10px; font-weight: 600; font-size: 12px; }
.tabs button.on { background: var(--accent); color: #111; border-color: var(--accent); }
.x { background: none; border: 0; color: var(--ink); font-size: 24px; line-height: 1; }
.mbody { overflow-y: auto; padding: 10px 12px 14px; }
.flash { background: #3b2d10; color: #ffd27a; padding: 6px 12px; font-weight: 600; }
.note { color: var(--muted); margin: 4px 0 10px; line-height: 1.5; }
.line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.btn { background: #2f3a45; color: var(--ink); border: 1px solid #4a5763; border-radius: 4px; padding: 6px 10px; font-weight: 600; font-size: 12px; }
.btn.sm { padding: 2px 8px; }
.btn.danger { background: #5a1f1a; border-color: #8a3a32; }
.mbody label { display: inline-flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--muted); margin: 0 8px 6px 0; }
.mbody input, .mbody select, .mbody textarea { background: #121518; color: var(--ink); border: 1px solid #3a4046; border-radius: 3px; padding: 4px 6px; font-family: var(--f-mono); font-size: 12px; }
.mbody textarea { width: 100%; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 10px; }
.strow { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 8px; border: 1px solid #333a40; border-radius: 5px; padding: 6px; margin-bottom: 6px; }
.strow.act { border-color: var(--accent); }
.stno { font-weight: 800; font-size: 16px; color: var(--accent); align-self: center; text-align: center; }
.stmain { display: flex; flex-wrap: wrap; }
.stmain input { width: 120px; }
.ptab { border-collapse: collapse; width: 100%; margin: 8px 0; }
.ptab td, .ptab th { border-bottom: 1px solid #333a40; padding: 4px 6px; text-align: left; }
.confirm { margin-top: 10px; padding: 8px; background: #3a1d1a; border-radius: 4px; }
.help-box { width: min(720px, 100%); }
.help-box h4 { margin: 10px 0 4px; color: var(--accent); }
.help-box li { margin: 3px 0; line-height: 1.5; }
.help-box code { background: #111; padding: 0 4px; border-radius: 3px; font-family: var(--f-mono); }

@media (max-width: 1100px) {
  body { overflow: auto; }
  .app { height: auto; }
  .work { grid-template-columns: minmax(0, 1fr); }
  .machine-view { height: 52vh; min-height: 280px; }
  .cnc { overflow: visible; }
}
@media (max-width: 560px) {
  .cnc-unit { grid-template-columns: minmax(0, 1fr); }
  .lcd { height: 360px; }
  .vkeys { display: none; }
}
@media (prefers-reduced-motion: reduce) { .blink, .lcd .kin u { animation: none; } }
