dsh-3d-magic-house 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/client.js CHANGED
@@ -163,7 +163,50 @@ window.__ModuleLoader__.load({
163
163
  'doneEmpty': '还没有完成的作品。打完一件,在清单里点「完成」,这里就会记下来。',
164
164
  'doneAgain': '再挑一个',
165
165
  'starsBig': '颗',
166
- 'flowAllDone': '五步都走完了,厉害!'
166
+ 'flowAllDone': '五步都走完了,厉害!',
167
+ 'page.overview': '总览',
168
+ 'page.ideas': '灵感',
169
+ 'page.design': '设计',
170
+ 'page.projects': '作品',
171
+ 'page.printer': '打印机',
172
+ 'nav.label': '工坊页面',
173
+ 'overview.heading': '总览',
174
+ 'overview.nowHeading': '现在在做',
175
+ 'overview.noActive': '还没选作品。去「灵感」挑一个,或者直接写一件。',
176
+ 'overview.nextHeading': '下一步',
177
+ 'overview.next': '去',
178
+ 'overview.stats': '工坊数据',
179
+ 'overview.stars': '星星',
180
+ 'overview.projects': '作品',
181
+ 'overview.done': '已完成',
182
+ 'overview.printing': '打印中',
183
+ 'overview.recent': '最近完成',
184
+ 'overview.recentEmpty': '还没有完成的作品。',
185
+ 'overview.goDesign': '去量尺寸',
186
+ 'overview.goQueue': '去排队',
187
+ 'overview.device': '设备',
188
+ 'overview.noPrinter': '打印机未连接',
189
+ 'overview.connect': '去连接',
190
+ 'overview.size': '尺寸',
191
+ 'overview.noSize': '还没量尺寸',
192
+ 'ideas.filter': '难度',
193
+ 'ideas.all': '全部',
194
+ 'design.console': '设计台',
195
+ 'design.viewport': '视口',
196
+ 'design.scale': '比例 1:1',
197
+ 'design.target': '目标',
198
+ 'design.current': '当前',
199
+ 'projects.count': '件',
200
+ 'projects.board': '清单',
201
+ 'printer.console': '设备控制台',
202
+ 'printer.online': '在线',
203
+ 'printer.offline': '离线',
204
+ 'printer.ring': '进度',
205
+ 'printer.layer': '层',
206
+ 'printer.noJob': '当前没有打印任务',
207
+ 'printer.signal': '信号',
208
+ 'printer.updated': '更新于',
209
+ 'printer.source': '局域网 MQTT · 只读'
167
210
  }
168
211
 
169
212
  var EN = {
@@ -305,7 +348,50 @@ window.__ModuleLoader__.load({
305
348
  'doneEmpty': 'Nothing finished yet. When a print is done, mark it Done in the list and it lands here.',
306
349
  'doneAgain': 'Pick another',
307
350
  'starsBig': '',
308
- 'flowAllDone': 'All five steps done. Nice work!'
351
+ 'flowAllDone': 'All five steps done. Nice work!',
352
+ 'page.overview': 'Overview',
353
+ 'page.ideas': 'Ideas',
354
+ 'page.design': 'Design',
355
+ 'page.projects': 'Projects',
356
+ 'page.printer': 'Printer',
357
+ 'nav.label': 'Workshop pages',
358
+ 'overview.heading': 'Overview',
359
+ 'overview.nowHeading': 'In progress',
360
+ 'overview.noActive': 'Nothing picked yet. Choose one in Ideas, or type one in.',
361
+ 'overview.nextHeading': 'Next step',
362
+ 'overview.next': 'Go to',
363
+ 'overview.stats': 'Workshop data',
364
+ 'overview.stars': 'Stars',
365
+ 'overview.projects': 'Projects',
366
+ 'overview.done': 'Finished',
367
+ 'overview.printing': 'Printing',
368
+ 'overview.recent': 'Recently finished',
369
+ 'overview.recentEmpty': 'Nothing finished yet.',
370
+ 'overview.goDesign': 'Size it',
371
+ 'overview.goQueue': 'Queue it',
372
+ 'overview.device': 'Device',
373
+ 'overview.noPrinter': 'Printer not connected',
374
+ 'overview.connect': 'Connect',
375
+ 'overview.size': 'Size',
376
+ 'overview.noSize': 'No size yet',
377
+ 'ideas.filter': 'Level',
378
+ 'ideas.all': 'All',
379
+ 'design.console': 'Design desk',
380
+ 'design.viewport': 'Viewport',
381
+ 'design.scale': 'scale 1:1',
382
+ 'design.target': 'target',
383
+ 'design.current': 'now',
384
+ 'projects.count': 'items',
385
+ 'projects.board': 'Board',
386
+ 'printer.console': 'Device console',
387
+ 'printer.online': 'online',
388
+ 'printer.offline': 'offline',
389
+ 'printer.ring': 'progress',
390
+ 'printer.layer': 'layer',
391
+ 'printer.noJob': 'No job right now',
392
+ 'printer.signal': 'signal',
393
+ 'printer.updated': 'updated',
394
+ 'printer.source': 'LAN MQTT · read-only'
309
395
  }
310
396
 
311
397
  var STAGES = ['idea', 'design', 'printing', 'done']
@@ -595,45 +681,122 @@ window.__ModuleLoader__.load({
595
681
  }, props.children)
596
682
  }
597
683
 
598
- function Section(props) {
599
- return h('section', { className: 'mh-section', id: props.id, 'data-step': props.step || undefined },
600
- h('div', { className: 'mh-sectionHead' },
601
- props.step ? h('span', { className: 'mh-stepNo', 'aria-hidden': true }, props.step) : null,
602
- h('h2', { className: 'mh-h2' }, props.title),
603
- props.hint ? h('span', { className: 'mh-hint' }, props.hint) : null),
604
- props.children)
684
+ var PAGES = ['overview', 'ideas', 'design', 'projects', 'printer']
685
+ var PAGE_STORE = 'mh-page'
686
+
687
+ /** Remember the last page so reopening the panel lands where the child left off. */
688
+ function storedPage() {
689
+ try {
690
+ var value = typeof window !== 'undefined' && window.localStorage ? window.localStorage.getItem(PAGE_STORE) : null
691
+ return PAGES.indexOf(value) >= 0 ? value : 'overview'
692
+ } catch (error) {
693
+ return 'overview'
694
+ }
695
+ }
696
+
697
+ function rememberPage(page) {
698
+ try {
699
+ if (typeof window !== 'undefined' && window.localStorage) window.localStorage.setItem(PAGE_STORE, page)
700
+ } catch (error) {
701
+ // A blocked storage keeps the page for this render only.
702
+ }
703
+ }
704
+
705
+ function sizeLabel(size) {
706
+ if (!size || typeof size.w !== 'number') return ''
707
+ return T('shape.' + size.shape) + ' ' + size.w + '×' + size.d + '×' + size.h + ' mm'
708
+ }
709
+
710
+ var NAV_ICON_PATHS = {
711
+ overview: ['M20.5 15.5a9 9 0 1 0-17 0', 'M12 12.5l4.2-4.2', 'M12 12.5a1.1 1.1 0 1 0 0-.01'],
712
+ ideas: ['M9.5 18h5', 'M10.5 21h3', 'M12 3a6 6 0 0 0-3.4 10.9V16h6.8v-2.1A6 6 0 0 0 12 3z'],
713
+ design: ['M21 16V8a2 2 0 0 0-1-1.7l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.7l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z', 'M3.3 7 12 12l8.7-5', 'M12 22V12'],
714
+ projects: ['M4 6.5h16', 'M4 12h16', 'M4 17.5h9'],
715
+ printer: ['M7.5 8V4.5h9V8', 'M5 8h14a2 2 0 0 1 2 2v5.5a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V10a2 2 0 0 1 2-2z', 'M7.5 17.5V21h9v-3.5']
605
716
  }
606
717
 
607
- /** A sub-block inside one numbered step: no number, smaller heading. */
608
- function Block(props) {
609
- return h('section', { className: 'mh-block' },
610
- h('div', { className: 'mh-blockHead' },
611
- h('h3', { className: 'mh-h3' }, props.title),
612
- props.hint ? h('span', { className: 'mh-hint' }, props.hint) : null),
613
- props.children)
718
+ function NavIcon(props) {
719
+ var paths = NAV_ICON_PATHS[props.name] || []
720
+ return h('svg', {
721
+ className: 'mh-navIcon',
722
+ width: 15,
723
+ height: 15,
724
+ viewBox: '0 0 24 24',
725
+ fill: 'none',
726
+ stroke: 'currentColor',
727
+ strokeWidth: 1.6,
728
+ strokeLinecap: 'round',
729
+ strokeLinejoin: 'round',
730
+ 'aria-hidden': true
731
+ }, paths.map(function (d, index) { return h('path', { key: index, d: d }) }))
614
732
  }
615
733
 
616
- /** The five-step rail: where the child is in the pipeline. */
617
- function StepRail(props) {
618
- return h('nav', { className: 'mh-rail', 'aria-label': T('flowHeading'), 'data-testid': 'mh-rail' },
619
- props.steps.map(function (item, index) {
620
- var state = item.done ? 'done' : item.id === props.current ? 'current' : 'todo'
734
+ /** Page tabs: one task per page, the current one lit. */
735
+ function Nav(props) {
736
+ return h('nav', { className: 'mh-nav', role: 'tablist', 'aria-label': T('nav.label'), 'data-testid': 'mh-nav' },
737
+ PAGES.map(function (page) {
738
+ var active = props.page === page
621
739
  return h('button', {
622
- key: item.id,
740
+ key: page,
623
741
  type: 'button',
624
- className: 'mh-railStep',
625
- 'data-state': state,
626
- 'aria-current': state === 'current' ? 'step' : undefined,
627
- onClick: function () { props.onJump(item.id) }
742
+ role: 'tab',
743
+ className: 'mh-tab',
744
+ 'aria-selected': active,
745
+ 'data-state': active ? 'active' : props.done[page] ? 'done' : 'idle',
746
+ onClick: function () { props.onNavigate(page) }
628
747
  },
629
- h('span', { className: 'mh-railNo' }, String(index + 1)),
630
- h('span', { className: 'mh-railLabel' }, item.label))
748
+ h('span', { className: 'mh-tabNo' }, String(PAGES.indexOf(page) + 1)),
749
+ h(NavIcon, { name: page }),
750
+ h('span', { className: 'mh-tabLabel' }, T('page.' + page)),
751
+ props.done[page] ? h('span', { className: 'mh-tabTick', 'aria-hidden': true }, '✓') : null)
631
752
  }))
632
753
  }
633
754
 
634
- function sizeLabel(size) {
635
- if (!size || typeof size.w !== 'number') return ''
636
- return T('shape.' + size.shape) + ' ' + size.w + '×' + size.d + '×' + size.h + ' mm'
755
+ function Kicker(props) {
756
+ return h('span', { className: 'mh-kicker' }, props.children)
757
+ }
758
+
759
+ /** A number with its unit, always on the monospace step. */
760
+ function Metric(props) {
761
+ return h('div', { className: 'mh-metric' },
762
+ h('span', { className: 'mh-metricLabel' }, props.label),
763
+ h('span', { className: 'mh-metricValue' },
764
+ h('span', { className: 'mh-num' }, props.value),
765
+ props.unit ? h('span', { className: 'mh-metricUnit' }, props.unit) : null))
766
+ }
767
+
768
+ /** Radial progress, painted as a conic gradient so it needs no animation frame. */
769
+ function Ring(props) {
770
+ var value = Math.max(0, Math.min(100, Math.round(props.value || 0)))
771
+ var degrees = value * 3.6
772
+ return h('div', {
773
+ className: 'mh-ring',
774
+ style: { background: 'conic-gradient(var(--mh-accent) ' + degrees + 'deg, rgba(122,132,148,0.22) ' + degrees + 'deg)' },
775
+ role: 'img',
776
+ 'aria-label': (props.label || '') + ' ' + value + '%'
777
+ }, h('div', { className: 'mh-ringInner' },
778
+ h('span', { className: 'mh-ringValue' },
779
+ h('span', { className: 'mh-num' }, String(value)),
780
+ h('span', { className: 'mh-ringPct' }, '%')),
781
+ props.caption ? h('span', { className: 'mh-ringCaption' }, props.caption) : null))
782
+ }
783
+
784
+ /** One temperature with a target tick on the scale. */
785
+ function TempBar(props) {
786
+ var value = typeof props.value === 'number' ? props.value : 0
787
+ var target = typeof props.target === 'number' ? props.target : null
788
+ var max = Math.max(300, value, target === null ? 0 : target)
789
+ return h('div', { className: 'mh-temp' },
790
+ h('div', { className: 'mh-tempHead' },
791
+ h(Kicker, null, props.label),
792
+ h('span', { className: 'mh-tempValue' },
793
+ h('span', { className: 'mh-num' }, value < 100 ? value.toFixed(1) : String(Math.round(value))),
794
+ h('span', { className: 'mh-tempUnit' }, '℃'))),
795
+ h('div', { className: 'mh-tempTrack' },
796
+ h('div', { className: 'mh-tempFill', style: { width: Math.min(100, (value / max) * 100) + '%' } }),
797
+ target !== null
798
+ ? h('div', { className: 'mh-tempTarget', style: { left: Math.min(100, (target / max) * 100) + '%' } })
799
+ : null))
637
800
  }
638
801
 
639
802
  function StageButtons(props) {
@@ -783,33 +946,6 @@ window.__ModuleLoader__.load({
783
946
  })))
784
947
  }
785
948
 
786
- function SafetyCard() {
787
- return h('div', { className: 'mh-card mh-safetyCard' },
788
- h('ul', { className: 'mh-safety' },
789
- ['safety1', 'safety2', 'safety3', 'safety4'].map(function (key) {
790
- return h('li', { key: key }, T(key))
791
- })))
792
- }
793
-
794
- /** Step 5: what got finished, and the star total. */
795
- function DoneCard(props) {
796
- var done = (props.projects || []).filter(function (project) { return project.status === 'done' })
797
- return h('div', { className: 'mh-card' },
798
- h('div', { className: 'mh-starRow' },
799
- h('span', { className: 'mh-starBig' }, T('star') + ' ' + props.stars + ' ' + T('starsBig')),
800
- h('span', { className: 'mh-spacer' }),
801
- h(Button, { onClick: function () { props.onJump('1') } }, T('doneAgain'))),
802
- h('h3', { className: 'mh-h3' }, T('doneHeading')),
803
- done.length === 0
804
- ? h('p', { className: 'mh-hint' }, T('doneEmpty'))
805
- : h('ul', { className: 'mh-doneList' }, done.slice().reverse().map(function (project) {
806
- return h('li', { key: project.id, className: 'mh-doneRow' },
807
- h('span', { className: 'mh-emoji', 'aria-hidden': true }, project.emoji || '🧩'),
808
- h('span', { className: 'mh-doneTitle' }, project.title),
809
- h('span', { className: 'mh-hint' }, project.doneAt ? String(project.doneAt).slice(0, 10) : ''))
810
- })))
811
- }
812
-
813
949
  // ── 3D view ────────────────────────────────────────────────────────────
814
950
  // A small software renderer: no three.js, no CDN, no WebGL. Faces are
815
951
  // projected, shaded and painted back-to-front on a 2D canvas.
@@ -962,7 +1098,7 @@ window.__ModuleLoader__.load({
962
1098
 
963
1099
  function cameraAt(state) {
964
1100
  var pitch = Math.max(0.06, Math.min(1.45, state.pitch))
965
- var targetZ = 92
1101
+ var targetZ = typeof state.targetZ === 'number' ? state.targetZ : 92
966
1102
  var cp = Math.cos(pitch)
967
1103
  var sp = Math.sin(pitch)
968
1104
  var eye = [
@@ -1046,26 +1182,26 @@ window.__ModuleLoader__.load({
1046
1182
  painted.sort(function (a, b) { return b.depth - a.depth })
1047
1183
  for (var p = 0; p < painted.length; p += 1) ops.push(painted[p])
1048
1184
 
1049
- // Progress sketch: a translucent column at the printed height.
1185
+ // Progress: one glowing plane at the printed height, not a second solid.
1050
1186
  if (options.progress !== null && options.progress !== undefined && options.progress > 0) {
1051
1187
  var height = Math.max(1, (design.h * Math.min(100, options.progress)) / 100)
1052
- var ghost = boxMesh(design.w / 2, design.d / 2, height)
1053
- var ghostOps = []
1054
- for (var g = 0; g < ghost.length; g += 1) {
1055
- var ghostPoints = []
1056
- var ghostDepth = 0
1057
- var ghostVisible = true
1058
- for (var v = 0; v < ghost[g].length; v += 1) {
1059
- var gp = projectPoint(ghost[g][v], camera, view)
1060
- if (gp === null) { ghostVisible = false; break }
1061
- ghostPoints.push([gp.x, gp.y])
1062
- ghostDepth += gp.depth
1063
- }
1064
- if (!ghostVisible) continue
1065
- ghostOps.push({ kind: 'poly', points: ghostPoints, depth: ghostDepth / ghost[g].length, fill: 'rgba(47,158,143,0.34)', stroke: 'rgba(24,110,99,0.55)', width: 1 })
1188
+ var grow = 1.1
1189
+ var plane = [
1190
+ [-design.w / 2 * grow, -design.d / 2 * grow, height],
1191
+ [design.w / 2 * grow, -design.d / 2 * grow, height],
1192
+ [design.w / 2 * grow, design.d / 2 * grow, height],
1193
+ [-design.w / 2 * grow, design.d / 2 * grow, height]
1194
+ ]
1195
+ var planePoints = []
1196
+ var planeVisible = true
1197
+ for (var v = 0; v < plane.length; v += 1) {
1198
+ var pp = projectPoint(plane[v], camera, view)
1199
+ if (pp === null) { planeVisible = false; break }
1200
+ planePoints.push([pp.x, pp.y])
1201
+ }
1202
+ if (planeVisible) {
1203
+ ops.push({ kind: 'poly', points: planePoints, fill: 'rgba(61,219,196,0.16)', stroke: 'rgba(61,219,196,0.8)', width: 1.5 })
1066
1204
  }
1067
- ghostOps.sort(function (a, b) { return b.depth - a.depth })
1068
- for (var q = 0; q < ghostOps.length; q += 1) ops.push(ghostOps[q])
1069
1205
 
1070
1206
  // Nozzle marker above the current layer.
1071
1207
  var nozzle = projectPoint([0, 0, height + 14], camera, view)
@@ -1135,13 +1271,17 @@ window.__ModuleLoader__.load({
1135
1271
 
1136
1272
  function Model3DCard(props) {
1137
1273
  var [design, setDesign] = useState({ shape: 'box', w: 80, d: 60, h: 40 })
1138
- var [camera, setCamera] = useState({ yaw: -0.85, pitch: 0.44, distance: 640 })
1274
+ var [camera, setCamera] = useState({ yaw: -0.85, pitch: 0.44, zoom: 1 })
1139
1275
  var [dragging, setDragging] = useState(false)
1140
1276
  var [tick, setTick] = useState(0)
1141
1277
  var canvasRef = useRef(null)
1142
1278
  var dragRef = useRef(null)
1143
1279
  var progress = typeof props.progress === 'number' ? props.progress : null
1144
1280
  var active = props.active || null
1281
+ // Frame the design itself: the build volume then reads as the chamber around it.
1282
+ var fitSpan = Math.max(20, design.w, design.d, design.h)
1283
+ var distance = Math.max(300, Math.min(1100, fitSpan * 3.4)) * camera.zoom
1284
+ var targetZ = design.h * 0.5
1145
1285
 
1146
1286
  useEffect(function () {
1147
1287
  var canvas = canvasRef.current
@@ -1160,12 +1300,12 @@ window.__ModuleLoader__.load({
1160
1300
  context.clearRect(0, 0, width, height)
1161
1301
  var ops = buildScene({
1162
1302
  view: { width: width, height: height },
1163
- camera: camera,
1303
+ camera: { yaw: camera.yaw, pitch: camera.pitch, distance: distance, targetZ: targetZ },
1164
1304
  design: design,
1165
1305
  progress: progress
1166
1306
  })
1167
1307
  drawOps(context, ops)
1168
- }, [camera.yaw, camera.pitch, camera.distance, design.shape, design.w, design.d, design.h, progress, tick])
1308
+ }, [camera.yaw, camera.pitch, camera.zoom, design.shape, design.w, design.d, design.h, progress, tick])
1169
1309
 
1170
1310
  useEffect(function () {
1171
1311
  if (typeof ResizeObserver !== 'function') return
@@ -1183,7 +1323,7 @@ window.__ModuleLoader__.load({
1183
1323
  event.preventDefault()
1184
1324
  var delta = event.deltaY > 0 ? 1.08 : 0.92
1185
1325
  setCamera(function (current) {
1186
- return Object.assign({}, current, { distance: Math.max(280, Math.min(1500, current.distance * delta)) })
1326
+ return Object.assign({}, current, { zoom: Math.max(0.45, Math.min(2.6, current.zoom * delta)) })
1187
1327
  })
1188
1328
  }
1189
1329
  canvas.addEventListener('wheel', onWheel, { passive: false })
@@ -1228,12 +1368,22 @@ window.__ModuleLoader__.load({
1228
1368
  var fits = design.w <= BED_SIZE && design.d <= BED_SIZE && design.h <= BED_SIZE
1229
1369
  var over = Math.max(design.w, design.d, design.h) - BED_SIZE
1230
1370
 
1231
- var preset = function (yaw, pitch, distance) {
1232
- setCamera({ yaw: yaw, pitch: pitch, distance: distance })
1371
+ var preset = function (yaw, pitch, zoom) {
1372
+ setCamera({ yaw: yaw, pitch: pitch, zoom: zoom })
1233
1373
  }
1234
1374
 
1235
1375
  return h('div', { className: 'mh-card mh-3d' },
1236
- h('div', { className: 'mh-canvasWrap', 'data-testid': 'magic-canvas-wrap' },
1376
+ h('div', { className: 'mh-canvasWrap mh-viewport', 'data-testid': 'magic-canvas-wrap' },
1377
+ h('span', { className: 'mh-corner mh-cornerTL', 'aria-hidden': true }),
1378
+ h('span', { className: 'mh-corner mh-cornerTR', 'aria-hidden': true }),
1379
+ h('span', { className: 'mh-corner mh-cornerBL', 'aria-hidden': true }),
1380
+ h('span', { className: 'mh-corner mh-cornerBR', 'aria-hidden': true }),
1381
+ h('div', { className: 'mh-hudTop' },
1382
+ h(Kicker, null, T('design.viewport')),
1383
+ h('span', { className: 'mh-hudTag' }, T('design.scale'))),
1384
+ h('div', { className: 'mh-hudBottom' },
1385
+ h('span', { className: 'mh-hudTag' }, '256 × 256 × 256 mm')),
1386
+ h('span', { className: 'mh-scanline', 'aria-hidden': true }),
1237
1387
  h('canvas', {
1238
1388
  ref: canvasRef,
1239
1389
  className: 'mh-canvas',
@@ -1259,9 +1409,9 @@ window.__ModuleLoader__.load({
1259
1409
  }, T('shape.' + shape))
1260
1410
  })),
1261
1411
  h('span', { className: 'mh-seg' },
1262
- h('button', { type: 'button', onClick: function () { preset(-0.85, 0.44, 640) } }, T('view3dIso')),
1263
- h('button', { type: 'button', onClick: function () { preset(-1.5707963, 0.18, 620) } }, T('view3dFront')),
1264
- h('button', { type: 'button', onClick: function () { preset(-1.5707963, 1.4499, 640) } }, T('view3dTop')))),
1412
+ h('button', { type: 'button', onClick: function () { preset(-0.85, 0.44, 1) } }, T('view3dIso')),
1413
+ h('button', { type: 'button', onClick: function () { preset(-1.5707963, 0.18, 1) } }, T('view3dFront')),
1414
+ h('button', { type: 'button', onClick: function () { preset(-1.5707963, 1.4499, 1) } }, T('view3dTop')))),
1265
1415
  h('div', { className: 'mh-3dRow' },
1266
1416
  ['w', 'd', 'h'].map(function (key, index) {
1267
1417
  var label = index === 0 ? T('view3dLength') : index === 1 ? T('view3dWidth') : T('view3dHeight')
@@ -1296,6 +1446,7 @@ window.__ModuleLoader__.load({
1296
1446
 
1297
1447
 
1298
1448
  // ── printer card ───────────────────────────────────────────────────────
1449
+ /** The device page: a read-only console over the printer's LAN telemetry. */
1299
1450
  function PrinterCard(props) {
1300
1451
  var printer = props.printer
1301
1452
  var view = printer.view
@@ -1320,82 +1471,97 @@ window.__ModuleLoader__.load({
1320
1471
  })
1321
1472
  }
1322
1473
 
1323
- var statusRow = h('div', { className: 'mh-printerRows' },
1324
- h('div', { className: 'mh-3dRow' },
1325
- h('span', { className: 'mh-pill', 'data-state': linkState }, T('link.' + linkState)),
1326
- config ? h('span', null, config.host + ' · ' + config.serial) : null,
1474
+ var field = function (key, label, placeholder, kind) {
1475
+ return h('label', { className: 'mh-field' },
1476
+ h(Kicker, null, label),
1477
+ h('input', {
1478
+ className: 'mh-input mh-inputConsole',
1479
+ type: kind || 'text',
1480
+ inputMode: key === 'host' ? 'decimal' : undefined,
1481
+ placeholder: placeholder,
1482
+ value: form[key],
1483
+ onChange: function (event) {
1484
+ var value = event.target.value
1485
+ setForm(function (current) {
1486
+ var next = Object.assign({}, current)
1487
+ next[key] = value
1488
+ return next
1489
+ })
1490
+ }
1491
+ }))
1492
+ }
1493
+
1494
+ if (showForm) {
1495
+ return h('section', { className: 'mh-console mh-device' },
1496
+ h('div', { className: 'mh-consoleHead' },
1497
+ h(Kicker, null, T('printer.console')),
1498
+ h('span', { className: 'mh-dot', 'data-on': 'false' }),
1499
+ h('span', { className: 'mh-consoleState' }, T('link.' + linkState))),
1500
+ printer.problem ? h('p', { className: 'mh-consoleHint mh-consoleWarn', role: 'alert' }, printer.problem) : null,
1501
+ localProblem ? h('p', { className: 'mh-consoleHint mh-consoleWarn', role: 'alert' }, localProblem) : null,
1502
+ h('div', { className: 'mh-form mh-formConsole' },
1503
+ field('host', T('printerHost'), T('printerHostPh')),
1504
+ field('serial', T('printerSerial'), T('printerSerialPh')),
1505
+ field('code', T('printerCode'), T('printerCodePh'), 'password')),
1506
+ h('div', { className: 'mh-cardActions' },
1507
+ h(Button, { variant: 'primary', disabled: printer.busy, onClick: submit }, T('printerSave')),
1508
+ config !== null ? h(Button, { onClick: function () { setEditing(false) } }, T('printerCancel')) : null),
1509
+ h('p', { className: 'mh-consoleHint' }, T('printerSetup')),
1510
+ h('p', { className: 'mh-consoleFootNote' }, T('printer.source')))
1511
+ }
1512
+
1513
+ var tempRow = print === null
1514
+ ? null
1515
+ : h('div', { className: 'mh-temps' },
1516
+ h(TempBar, { label: T('printerNozzle'), value: print.nozzle, target: print.nozzleTarget }),
1517
+ h(TempBar, { label: T('printerBed'), value: print.bed, target: print.bedTarget }),
1518
+ h(TempBar, { label: T('printerChamber'), value: print.chamber, target: null }))
1519
+
1520
+ return h('section', { className: 'mh-console mh-device' },
1521
+ h('div', { className: 'mh-consoleHead' },
1522
+ h(Kicker, null, T('printer.console')),
1523
+ h('span', { className: 'mh-dot', 'data-on': linkState === 'connected' ? 'true' : 'false' }),
1524
+ h('span', { className: 'mh-consoleState' }, T('link.' + linkState)),
1327
1525
  h('span', { className: 'mh-spacer' }),
1328
- h(Button, { onClick: function () { void printer.post({ action: 'reconnect' }) } }, T('printerReconnect')),
1329
- h(Button, { onClick: function () { void printer.post({ action: 'disconnect' }) } }, T('printerDisconnect')),
1330
- h(Button, { onClick: function () { setEditing(true) } }, T('printerEdit'))),
1331
- linkState !== 'connected' && linkDetail !== '' ? h('p', { className: 'mh-hint' }, linkDetail) : null,
1526
+ h('span', { className: 'mh-consoleHost mh-num' }, config.host + ' · ' + config.serial)),
1527
+ printer.problem ? h('p', { className: 'mh-consoleHint mh-consoleWarn', role: 'alert' }, printer.problem) : null,
1528
+ linkState !== 'connected' && linkDetail !== ''
1529
+ ? h('p', { className: 'mh-consoleHint' }, linkDetail)
1530
+ : null,
1332
1531
  print === null
1333
- ? h('p', { className: 'mh-hint' }, T('printerWaiting'))
1334
- : h('div', { className: 'mh-printerLive' },
1335
- h('div', { className: 'mh-3dRow' },
1336
- h('b', null, T('state.' + (print.state || 'unknown'))),
1337
- print.job ? h('span', { className: 'mh-hint' }, T('printerJob') + ': ' + print.job) : null,
1338
- print.wifi ? h('span', { className: 'mh-hint' }, print.wifi) : null),
1339
- typeof print.progress === 'number'
1340
- ? h('div', { className: 'mh-3dRow' },
1341
- h('div', { className: 'mh-meter', role: 'progressbar', 'aria-valuemin': 0, 'aria-valuemax': 100, 'aria-valuenow': print.progress },
1342
- h('div', { className: 'mh-meterFill', style: { width: print.progress + '%' } })),
1343
- h('span', { className: 'mh-hint' }, print.progress + '%'),
1344
- typeof print.remainingMinutes === 'number'
1345
- ? h('span', { className: 'mh-hint' }, T('printerRemaining') + ' ' + print.remainingMinutes + ' ' + T('printerMinute'))
1346
- : null)
1347
- : null,
1348
- h('div', { className: 'mh-hud' },
1349
- print.nozzle !== null ? h('span', null, T('printerNozzle') + ' ', h('b', null, print.nozzle + '℃')) : null,
1350
- print.bed !== null ? h('span', null, T('printerBed') + ' ', h('b', null, print.bed + '℃')) : null,
1351
- print.chamber !== null ? h('span', null, T('printerChamber') + ' ', h('b', null, print.chamber + '℃')) : null,
1352
- typeof print.layer === 'number' && typeof print.layers === 'number'
1353
- ? h('span', null, T('printerLayer') + ' ', h('b', null, print.layer + '/' + print.layers))
1354
- : null,
1355
- print.error > 0 ? h('span', { className: 'mh-warn' }, 'E' + print.error) : null),
1356
- h('p', { className: 'mh-hint' }, T('printerReports') + ' ' + (view.reports || 0) + ' ' + T('printerReportsUnit'))))
1357
-
1358
- return h('div', { className: 'mh-card' },
1359
- h('div', { className: 'mh-printerRows' },
1360
- printer.problem
1361
- ? h('p', { className: 'mh-banner', role: 'alert' }, printer.problem)
1362
- : null,
1363
- localProblem ? h('p', { className: 'mh-banner', role: 'alert' }, localProblem) : null,
1364
- showForm
1365
- ? h('div', { className: 'mh-form' },
1366
- h('label', { className: 'mh-field' },
1367
- h('span', null, T('printerHost')),
1368
- h('input', {
1369
- className: 'mh-input',
1370
- type: 'text',
1371
- inputMode: 'decimal',
1372
- placeholder: T('printerHostPh'),
1373
- value: form.host,
1374
- onChange: function (event) { setForm(function (current) { return Object.assign({}, current, { host: event.target.value }) }) }
1375
- })),
1376
- h('label', { className: 'mh-field' },
1377
- h('span', null, T('printerSerial')),
1378
- h('input', {
1379
- className: 'mh-input',
1380
- type: 'text',
1381
- placeholder: T('printerSerialPh'),
1382
- value: form.serial,
1383
- onChange: function (event) { setForm(function (current) { return Object.assign({}, current, { serial: event.target.value }) }) }
1384
- })),
1385
- h('label', { className: 'mh-field' },
1386
- h('span', null, T('printerCode')),
1387
- h('input', {
1388
- className: 'mh-input',
1389
- type: 'password',
1390
- placeholder: T('printerCodePh'),
1391
- value: form.code,
1392
- onChange: function (event) { setForm(function (current) { return Object.assign({}, current, { code: event.target.value }) }) }
1532
+ ? h('div', { className: 'mh-deviceBody' },
1533
+ h('p', { className: 'mh-consoleHint' }, T('printerWaiting')))
1534
+ : h('div', { className: 'mh-deviceBody' },
1535
+ h(Ring, {
1536
+ value: typeof print.progress === 'number' ? print.progress : 0,
1537
+ label: T('printer.ring'),
1538
+ caption: T('state.' + (print.state || 'unknown'))
1539
+ }),
1540
+ h('div', { className: 'mh-deviceInfo' },
1541
+ h(Kicker, null, T('printerJob')),
1542
+ h('div', { className: 'mh-deviceJob' }, print.job || T('printer.noJob')),
1543
+ h('div', { className: 'mh-hudRow' },
1544
+ h(Metric, {
1545
+ label: T('printerLayer'),
1546
+ value: typeof print.layer === 'number' ? print.layer + '/' + (typeof print.layers === 'number' ? print.layers : '–') : '—'
1547
+ }),
1548
+ h(Metric, {
1549
+ label: T('printerRemaining'),
1550
+ value: typeof print.remainingMinutes === 'number' ? String(print.remainingMinutes) : '—',
1551
+ unit: T('printerMinute')
1552
+ }),
1553
+ h(Metric, {
1554
+ label: T('printerReports'),
1555
+ value: String(view.reports || 0)
1393
1556
  })),
1394
- h('div', { className: 'mh-cardActions' },
1395
- h(Button, { variant: 'primary', disabled: printer.busy, onClick: submit }, T('printerSave')),
1396
- config !== null ? h(Button, { onClick: function () { setEditing(false) } }, T('printerCancel')) : null),
1397
- h('p', { className: 'mh-hint' }, T('printerSetup')))
1398
- : statusRow))
1557
+ print.error > 0 ? h('p', { className: 'mh-consoleHint mh-consoleWarn' }, 'E' + print.error) : null),
1558
+ tempRow),
1559
+ h('div', { className: 'mh-consoleFoot' },
1560
+ h('span', { className: 'mh-consoleFootNote' }, T('printer.source')),
1561
+ h('span', { className: 'mh-spacer' }),
1562
+ h(Button, { onClick: function () { void printer.post({ action: 'reconnect' }) } }, T('printerReconnect')),
1563
+ h(Button, { onClick: function () { void printer.post({ action: 'disconnect' }) } }, T('printerDisconnect')),
1564
+ h(Button, { onClick: function () { setEditing(true) } }, T('printerEdit'))))
1399
1565
  }
1400
1566
 
1401
1567
  // ── the panel ─────────────────────────────────────────────────────────
@@ -1403,6 +1569,8 @@ window.__ModuleLoader__.load({
1403
1569
  var workshop = useWorkshop()
1404
1570
  var printer = usePrinter()
1405
1571
  var [spin, setSpin] = useState(null)
1572
+ var [page, setPage] = useState(storedPage())
1573
+ var [level, setLevel] = useState(0)
1406
1574
  var state = workshop.state
1407
1575
  var projects = state && Array.isArray(state.projects) ? state.projects : []
1408
1576
  var activeId = state && state.activeId ? state.activeId : null
@@ -1416,6 +1584,12 @@ window.__ModuleLoader__.load({
1416
1584
  var cards = workshop.ideas && Array.isArray(workshop.ideas.cards) ? workshop.ideas.cards : []
1417
1585
  var printerLink = printer.view && printer.view.link ? printer.view.link.state : 'unconfigured'
1418
1586
  var livePrint = printer.view ? printer.view.print : null
1587
+ var doneProjects = projects.filter(function (project) { return project.status === 'done' })
1588
+
1589
+ var navigate = function (next) {
1590
+ rememberPage(next)
1591
+ setPage(next)
1592
+ }
1419
1593
 
1420
1594
  var doSpin = function () {
1421
1595
  var spins = (workshop.ideas && workshop.ideas.spins) || null
@@ -1428,14 +1602,6 @@ window.__ModuleLoader__.load({
1428
1602
  if (spin === null && workshop.status === 'ready') doSpin()
1429
1603
  }, [workshop.status])
1430
1604
 
1431
- var jump = function (step) {
1432
- if (typeof document === 'undefined') return
1433
- var target = document.getElementById('mh-step-' + step)
1434
- if (target && typeof target.scrollIntoView === 'function') {
1435
- target.scrollIntoView({ behavior: 'smooth', block: 'start' })
1436
- }
1437
- }
1438
-
1439
1605
  var tellAi = function (prompt) {
1440
1606
  var outcome = openChat(prompt)
1441
1607
  workshop.flash(outcome === 'opened' ? T('aiOpened') : outcome === 'copied' ? T('aiCopied') : T('aiFailed'))
@@ -1462,8 +1628,6 @@ window.__ModuleLoader__.load({
1462
1628
  workshop.flash(T('ideaSaved'))
1463
1629
  }
1464
1630
 
1465
- // Step 2 hands a size to step 3: it updates the project in progress, or
1466
- // starts one when the child went straight to the 3D view.
1467
1631
  var applySize = function (design) {
1468
1632
  var size = { shape: design.shape, w: design.w, d: design.d, h: design.h }
1469
1633
  var now = new Date().toISOString()
@@ -1541,31 +1705,188 @@ window.__ModuleLoader__.load({
1541
1705
  })
1542
1706
  }
1543
1707
 
1544
- var steps = [
1545
- { id: '1', label: T('flow1'), done: projects.length > 0 },
1546
- { id: '2', label: T('flow2'), done: Boolean(active && active.size) },
1547
- { id: '3', label: T('flow3'), done: Boolean(active) && checkedCount === CHECK_KEYS.length },
1548
- { id: '4', label: T('flow4'), done: printerLink === 'connected' },
1549
- { id: '5', label: T('flow5'), done: stars > 0 }
1550
- ]
1551
- var currentStep = '5'
1552
- for (var stepIndex = 0; stepIndex < steps.length; stepIndex += 1) {
1553
- if (!steps[stepIndex].done) { currentStep = steps[stepIndex].id; break }
1708
+ var done = {
1709
+ overview: false,
1710
+ ideas: projects.length > 0,
1711
+ design: Boolean(active && active.size),
1712
+ projects: Boolean(active) && checkedCount === CHECK_KEYS.length,
1713
+ printer: printerLink === 'connected'
1714
+ }
1715
+ var order = ['ideas', 'design', 'projects', 'printer']
1716
+ var nextPage = 'printer'
1717
+ for (var stepIndex = 0; stepIndex < order.length; stepIndex += 1) {
1718
+ if (!done[order[stepIndex]]) { nextPage = order[stepIndex]; break }
1719
+ }
1720
+ var nextHint = { ideas: 'flow1', design: 'flow2', projects: 'flow3', printer: 'flow4' }[nextPage]
1721
+
1722
+ var stat = function (label, value, accent) {
1723
+ return h('div', { className: 'mh-stat', 'data-accent': accent === true ? 'true' : undefined },
1724
+ h(Kicker, null, label),
1725
+ h('span', { className: 'mh-statValue' }, h('span', { className: 'mh-num' }, String(value))))
1726
+ }
1727
+
1728
+ var overviewPage = function () {
1729
+ return h('div', { className: 'mh-stack' },
1730
+ h('div', { className: 'mh-stats' },
1731
+ stat(T('overview.stars'), stars, true),
1732
+ stat(T('overview.projects'), projects.length),
1733
+ stat(T('overview.done'), doneProjects.length),
1734
+ stat(T('printer.layer'), livePrint && typeof livePrint.layer === 'number' ? livePrint.layer + '/' + (livePrint.layers || '–') : '—')),
1735
+ h('div', { className: 'mh-grid2' },
1736
+ h('section', { className: 'mh-hero' },
1737
+ h('div', { className: 'mh-heroHead' },
1738
+ h(Kicker, null, T('overview.nowHeading')),
1739
+ active ? h('span', { className: 'mh-pill', 'data-state': active.status }, T('stage.' + active.status)) : null),
1740
+ h('h2', { className: 'mh-heroTitle' }, active ? active.title : T('overview.noActive')),
1741
+ active
1742
+ ? h('p', { className: 'mh-heroMeta' },
1743
+ h(Kicker, null, T('overview.size')),
1744
+ h('span', null, sizeLabel(active.size) || T('overview.noSize')))
1745
+ : null,
1746
+ active && active.note ? h('p', { className: 'mh-heroNote' }, active.note) : null,
1747
+ h('div', { className: 'mh-cardActions' },
1748
+ h(Button, { variant: 'primary', onClick: function () { navigate('design') } }, T('overview.goDesign')),
1749
+ h(Button, { onClick: function () { navigate('projects') } }, T('overview.goQueue')))),
1750
+ h('section', { className: 'mh-console mh-deviceMini' },
1751
+ h('div', { className: 'mh-consoleHead' },
1752
+ h(Kicker, null, T('overview.device')),
1753
+ h('span', { className: 'mh-dot', 'data-on': printerLink === 'connected' ? 'true' : 'false' }),
1754
+ h('span', { className: 'mh-consoleState' }, T('link.' + printerLink))),
1755
+ livePrint && typeof livePrint.progress === 'number'
1756
+ ? h('div', { className: 'mh-deviceBody' },
1757
+ h(Ring, {
1758
+ value: livePrint.progress,
1759
+ label: T('printer.ring'),
1760
+ caption: T('state.' + (livePrint.state || 'unknown'))
1761
+ }),
1762
+ h('div', { className: 'mh-deviceInfo' },
1763
+ h('div', { className: 'mh-deviceJob' }, livePrint.job || T('printer.noJob')),
1764
+ h('div', { className: 'mh-hudRow' },
1765
+ h(Metric, { label: T('printerNozzle'), value: livePrint.nozzle === null ? '—' : String(Math.round(livePrint.nozzle)), unit: '℃' }),
1766
+ h(Metric, { label: T('printerBed'), value: livePrint.bed === null ? '—' : String(Math.round(livePrint.bed)), unit: '℃' }))))
1767
+ : h('div', { className: 'mh-deviceBody' },
1768
+ h('p', { className: 'mh-consoleHint' }, printerLink === 'connected' ? T('printerWaiting') : T('overview.noPrinter')),
1769
+ h(Button, { onClick: function () { navigate('printer') } }, T('overview.connect')))),
1770
+ h('section', { className: 'mh-card' },
1771
+ h('div', { className: 'mh-blockHead' },
1772
+ h(Kicker, null, T('overview.nextHeading')),
1773
+ h('span', { className: 'mh-hint' }, T('page.' + nextPage))),
1774
+ h('p', { className: 'mh-nextText' }, T(nextHint + '.hint')),
1775
+ h('div', { className: 'mh-cardActions' },
1776
+ h(Button, { variant: 'primary', onClick: function () { navigate(nextPage) } }, T('overview.next') + ' ' + T('page.' + nextPage)))),
1777
+ h('section', { className: 'mh-card' },
1778
+ h('div', { className: 'mh-blockHead' }, h(Kicker, null, T('overview.recent'))),
1779
+ doneProjects.length === 0
1780
+ ? h('p', { className: 'mh-hint' }, T('overview.recentEmpty'))
1781
+ : h('ul', { className: 'mh-doneList' }, doneProjects.slice(-3).reverse().map(function (project) {
1782
+ return h('li', { key: project.id, className: 'mh-doneRow' },
1783
+ h('span', { className: 'mh-emoji', 'aria-hidden': true }, project.emoji || '🧩'),
1784
+ h('span', { className: 'mh-doneTitle' }, project.title),
1785
+ h('span', { className: 'mh-hint mh-num' }, project.doneAt ? String(project.doneAt).slice(0, 10) : ''))
1786
+ })))))
1787
+ }
1788
+
1789
+ var ideasPage = function () {
1790
+ var filtered = level === 0 ? cards : cards.filter(function (card) { return card.level === level })
1791
+ return h('div', { className: 'mh-stack' },
1792
+ h(SpinCard, {
1793
+ spin: spin,
1794
+ onSpin: doSpin,
1795
+ onAsk: function () { if (spin) tellAi(spinPrompt(spin)) }
1796
+ }),
1797
+ h('div', { className: 'mh-blockHead' },
1798
+ h('h2', { className: 'mh-h2' }, T('ideasHeading')),
1799
+ h('span', { className: 'mh-hint' }, T('ideasHint'))),
1800
+ h('div', { className: 'mh-chips' }, h(Kicker, null, T('ideas.filter')), [0, 1, 2, 3].map(function (value) {
1801
+ return h('button', {
1802
+ key: value,
1803
+ type: 'button',
1804
+ className: 'mh-filter',
1805
+ 'aria-pressed': level === value,
1806
+ onClick: function () { setLevel(value) }
1807
+ }, value === 0 ? T('ideas.all') : '●'.repeat(value))
1808
+ })),
1809
+ filtered.length === 0
1810
+ ? h('p', { className: 'mh-hint' }, T('emptyIdea'))
1811
+ : h('div', { className: 'mh-grid' }, filtered.map(function (card) {
1812
+ return h(IdeaCard, {
1813
+ key: card.id,
1814
+ card: card,
1815
+ onAdd: function (item) {
1816
+ var text = cardText(item)
1817
+ addProject({ title: text.title, emoji: item.emoji, note: text.tag })
1818
+ navigate('design')
1819
+ },
1820
+ onAsk: function (item) { tellAi(cardPrompt(item)) }
1821
+ })
1822
+ })))
1823
+ }
1824
+
1825
+ var designPage = function () {
1826
+ return h('div', { className: 'mh-stack' },
1827
+ h('div', { className: 'mh-context' },
1828
+ h(Kicker, null, T('overview.nowHeading')),
1829
+ active ? h('b', null, active.title) : h('span', { className: 'mh-hint' }, T('overview.noActive')),
1830
+ active ? h('span', { className: 'mh-pill', 'data-state': active.status }, T('stage.' + active.status)) : null),
1831
+ h(Model3DCard, {
1832
+ active: active,
1833
+ activeId: activeId,
1834
+ progress: livePrint && livePrint.state === 'running' && typeof livePrint.progress === 'number'
1835
+ ? livePrint.progress
1836
+ : null,
1837
+ onAdd: applySize,
1838
+ onAsk: function (design) { tellAi(designPrompt(design)) }
1839
+ }),
1840
+ h('div', { className: 'mh-cardActions' },
1841
+ h(Button, { onClick: function () { navigate('projects') } }, T('overview.goQueue'))))
1842
+ }
1843
+
1844
+ var projectsPage = function () {
1845
+ return h('div', { className: 'mh-stack' },
1846
+ h('div', { className: 'mh-blockHead' },
1847
+ h('h2', { className: 'mh-h2' }, T('boardHeading')),
1848
+ h('span', { className: 'mh-hint' }, T('boardHint'))),
1849
+ state === null
1850
+ ? h('p', { className: 'mh-hint' }, T('loading'))
1851
+ : h(BoardCard, {
1852
+ state: state,
1853
+ onAdd: addProject,
1854
+ onActivate: setActive,
1855
+ onStage: setStage,
1856
+ onRemove: removeProject
1857
+ }),
1858
+ h('div', { className: 'mh-blockHead' },
1859
+ h('h2', { className: 'mh-h2' }, T('checkHeading')),
1860
+ h('span', { className: 'mh-hint' }, T('checkHint'))),
1861
+ state === null ? null : h(ChecklistCard, { state: state, onToggle: toggleCheck, onReset: resetChecks }),
1862
+ h('div', { className: 'mh-card mh-tips' },
1863
+ h(Kicker, null, T('safetyHeading')),
1864
+ h('ul', { className: 'mh-safety' }, ['safety1', 'safety2', 'safety3', 'safety4'].map(function (key) {
1865
+ return h('li', { key: key }, T(key))
1866
+ }))))
1867
+ }
1868
+
1869
+ var printerPage = function () {
1870
+ return h('div', { className: 'mh-stack' }, h(PrinterCard, { printer: printer }))
1554
1871
  }
1555
1872
 
1873
+ var content = page === 'ideas' ? ideasPage()
1874
+ : page === 'design' ? designPage()
1875
+ : page === 'projects' ? projectsPage()
1876
+ : page === 'printer' ? printerPage()
1877
+ : overviewPage()
1878
+
1556
1879
  return h('div', { className: 'mh-root' },
1557
1880
  h('style', null, STYLE),
1558
1881
  h('header', { className: 'mh-head' },
1559
1882
  h('div', { className: 'mh-titleRow' },
1883
+ h('span', { className: 'mh-brandMark' }, h(PanelIcon, { size: 22 })),
1560
1884
  h('h1', null, T('title')),
1561
1885
  h('span', { className: 'mh-starBadge' }, T('star') + ' ' + stars + ' ' + T('stars')),
1562
1886
  h('span', { className: 'mh-spacer' }),
1563
1887
  h(Button, { onClick: workshop.load }, T('refresh'))),
1564
- h('p', { className: 'mh-sub' }, T('sub')),
1565
- h('div', { className: 'mh-active' },
1566
- h('span', { className: 'mh-activeLabel' }, T('nowDoing')),
1567
- active ? h('b', null, active.title) : h('span', { className: 'mh-hint' }, T('nothingActive')),
1568
- active ? h('span', { className: 'mh-pill', 'data-state': active.status }, T('stage.' + active.status)) : null)),
1888
+ h('p', { className: 'mh-sub' }, T('sub'))),
1889
+ h(Nav, { page: page, done: done, onNavigate: navigate }),
1569
1890
  h('div', { className: 'mh-scroll' },
1570
1891
  h('div', { className: 'mh-inner' },
1571
1892
  workshop.problem ? h('p', { className: 'mh-banner', role: 'alert' },
@@ -1575,57 +1896,7 @@ window.__ModuleLoader__.load({
1575
1896
  workshop.status === 'loading' && state === null
1576
1897
  ? h('p', { className: 'mh-hint' }, T('loading'))
1577
1898
  : null,
1578
- h(StepRail, { steps: steps, current: currentStep, onJump: jump }),
1579
- h(Section, { step: '1', id: 'mh-step-1', title: T('flow1'), hint: T('flow1.hint') },
1580
- h(SpinCard, {
1581
- spin: spin,
1582
- onSpin: doSpin,
1583
- onAsk: function () { if (spin) tellAi(spinPrompt(spin)) }
1584
- }),
1585
- h(Block, { title: T('ideasHeading'), hint: T('ideasHint') },
1586
- cards.length === 0
1587
- ? h('p', { className: 'mh-hint' }, T('emptyIdea'))
1588
- : h('div', { className: 'mh-grid' }, cards.map(function (card) {
1589
- return h(IdeaCard, {
1590
- key: card.id,
1591
- card: card,
1592
- onAdd: function (item) {
1593
- var text = cardText(item)
1594
- addProject({ title: text.title, emoji: item.emoji, note: text.tag })
1595
- },
1596
- onAsk: function (item) { tellAi(cardPrompt(item)) }
1597
- })
1598
- })))),
1599
- h(Section, { step: '2', id: 'mh-step-2', title: T('flow2'), hint: T('flow2.hint') },
1600
- h(Model3DCard, {
1601
- active: active,
1602
- activeId: activeId,
1603
- progress: livePrint && livePrint.state === 'running' && typeof livePrint.progress === 'number'
1604
- ? livePrint.progress
1605
- : null,
1606
- onAdd: applySize,
1607
- onAsk: function (design) { tellAi(designPrompt(design)) }
1608
- })),
1609
- h(Section, { step: '3', id: 'mh-step-3', title: T('flow3'), hint: T('flow3.hint') },
1610
- h(Block, { title: T('boardHeading'), hint: T('boardHint') },
1611
- state === null
1612
- ? h('p', { className: 'mh-hint' }, T('loading'))
1613
- : h(BoardCard, {
1614
- state: state,
1615
- onAdd: addProject,
1616
- onActivate: setActive,
1617
- onStage: setStage,
1618
- onRemove: removeProject
1619
- })),
1620
- h(Block, { title: T('checkHeading'), hint: T('checkHint') },
1621
- state === null
1622
- ? null
1623
- : h(ChecklistCard, { state: state, onToggle: toggleCheck, onReset: resetChecks })),
1624
- h(Block, { title: T('safetyHeading') }, h(SafetyCard, null))),
1625
- h(Section, { step: '4', id: 'mh-step-4', title: T('flow4'), hint: T('flow4.hint') },
1626
- h(PrinterCard, { printer: printer })),
1627
- h(Section, { step: '5', id: 'mh-step-5', title: T('flow5'), hint: T('flow5.hint') },
1628
- h(DoneCard, { projects: projects, stars: stars, onJump: jump })),
1899
+ content,
1629
1900
  h('p', { className: 'mh-foot' }, T('foot')))))
1630
1901
  }
1631
1902
 
@@ -1653,119 +1924,195 @@ window.__ModuleLoader__.load({
1653
1924
  }
1654
1925
 
1655
1926
  var STYLE = [
1656
- '.mh-root{--mh-base:var(--dsw-alias-bg-base,Canvas);--mh-surface:var(--dsw-alias-bg-layer-1,Canvas);--mh-surface2:var(--dsw-alias-bg-layer-2,Canvas);--mh-ink:var(--dsw-alias-label-primary,CanvasText);--mh-muted:var(--dsw-alias-label-secondary,GrayText);--mh-line:var(--dsw-alias-border-l1,light-dark(#e4e6ea,#3a3b40));--mh-line2:var(--dsw-alias-border-l2,light-dark(#d3d6db,#4a4b52));--mh-brand:var(--dsw-alias-brand-primary,Highlight);--mh-ok:var(--dsw-alias-state-success-primary,light-dark(#1a7f37,#4ac26b));--mh-warn:var(--dsw-alias-state-warn-primary,light-dark(#9a6700,#d4a72c));height:100%;min-height:0;display:flex;flex-direction:column;background:var(--mh-base);color:var(--mh-ink);font-family:inherit;font-size:14px;line-height:1.6;box-sizing:border-box;padding-top:min(var(--dsh-frame-top-clearance,0px),28px)}',
1657
- '.mh-head{flex:none;padding:28px clamp(24px,4vw,48px) 0}',
1658
- '.mh-titleRow{display:flex;align-items:center;gap:12px;flex-wrap:wrap}',
1659
- '.mh-titleRow h1{margin:0;font-size:20px;line-height:28px;font-weight:500}',
1660
- '.mh-sub{margin:4px 0 0;color:var(--mh-muted);font-size:13px}',
1927
+ '.mh-root{--mh-base:var(--dsw-alias-bg-base,Canvas);--mh-surface:var(--dsw-alias-bg-layer-1,Canvas);--mh-surface2:var(--dsw-alias-bg-layer-2,Canvas);--mh-ink:var(--dsw-alias-label-primary,CanvasText);--mh-muted:var(--dsw-alias-label-secondary,GrayText);--mh-line:var(--dsw-alias-border-l1,light-dark(#e4e6ea,#3a3b40));--mh-line2:var(--dsw-alias-border-l2,light-dark(#d3d6db,#4a4b52));--mh-brand:var(--dsw-alias-brand-primary,Highlight);--mh-ok:var(--dsw-alias-state-success-primary,light-dark(#1a7f37,#4ac26b));--mh-warn:var(--dsw-alias-state-warn-primary,light-dark(#9a6700,#d4a72c));--mh-accent:#2f9e8f;--mh-gold:#d99a2b;--mh-console-bg:#0b1017;--mh-console-line:#1f2a38;--mh-console-line2:#26343f;--mh-console-ink:#dbe4ef;--mh-console-muted:#8395a8;--mh-console-accent:#3ddbc4;--mh-mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;position:relative;height:100%;min-height:0;display:flex;flex-direction:column;background:var(--mh-base);color:var(--mh-ink);font-family:inherit;font-size:14px;line-height:1.6;box-sizing:border-box;padding-top:min(var(--dsh-frame-top-clearance,0px),28px)}',
1928
+ '.mh-root::before{content:\'\';position:absolute;inset:0;pointer-events:none;background-image:linear-gradient(rgba(122,132,148,.08) 1px,transparent 1px),linear-gradient(90deg,rgba(122,132,148,.08) 1px,transparent 1px);background-size:34px 34px;-webkit-mask-image:radial-gradient(ellipse 90% 60% at 50% 0%,#000 25%,transparent 80%);mask-image:radial-gradient(ellipse 90% 60% at 50% 0%,#000 25%,transparent 80%)}',
1929
+ '.mh-root>*{position:relative;z-index:1}',
1930
+ '.mh-head{flex:none;padding:24px clamp(20px,4vw,44px) 0}',
1931
+ '.mh-titleRow{display:flex;align-items:center;gap:10px;flex-wrap:wrap}',
1932
+ '.mh-brandMark{display:inline-flex;color:var(--mh-brand)}',
1933
+ '.mh-titleRow h1{margin:0;font-size:20px;line-height:28px;font-weight:500;letter-spacing:.01em}',
1934
+ '.mh-sub{margin:4px 0 0;color:var(--mh-muted);font-size:12px;font-family:var(--mh-mono);letter-spacing:.02em}',
1661
1935
  '.mh-spacer{flex:1 1 auto}',
1662
- '.mh-starBadge{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--mh-line);border-radius:999px;padding:2px 12px;font-size:13px}',
1936
+ '.mh-starBadge{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--mh-line);border-radius:999px;padding:2px 12px;font-size:12px;font-family:var(--mh-mono);font-variant-numeric:tabular-nums}',
1937
+ '.mh-nav{flex:none;display:flex;gap:2px;padding:10px clamp(20px,4vw,44px) 0;border-bottom:1px solid var(--mh-line);overflow-x:auto;scrollbar-width:none}',
1938
+ '.mh-nav::-webkit-scrollbar{display:none}',
1939
+ '.mh-tab{appearance:none;background:transparent;border:0;border-bottom:2px solid transparent;color:var(--mh-muted);display:inline-flex;align-items:center;gap:6px;padding:8px 12px;margin-bottom:-1px;font:inherit;font-size:13px;white-space:nowrap;cursor:pointer}',
1940
+ '.mh-tab:hover{color:var(--mh-ink)}',
1941
+ '.mh-tab[data-state=active]{color:var(--mh-ink);border-bottom-color:var(--mh-brand)}',
1942
+ '.mh-tab[data-state=active] .mh-navIcon{color:var(--mh-brand)}',
1943
+ '.mh-tabNo{font-family:var(--mh-mono);font-size:10px;opacity:.55}',
1944
+ '.mh-tabLabel{font-weight:500}',
1945
+ '.mh-tabTick{font-size:10px;color:var(--mh-ok)}',
1946
+ '.mh-navIcon{flex:none;opacity:.9}',
1663
1947
  '.mh-scroll{flex:1 1 auto;min-height:0;overflow:auto;scrollbar-gutter:stable}',
1664
- '.mh-inner{max-width:960px;margin:0 auto;padding:20px clamp(24px,4vw,48px) 56px;display:flex;flex-direction:column;gap:26px}',
1665
- '@media(max-width:767px){.mh-head{padding-inline:20px}.mh-inner{padding-inline:20px}}',
1666
- '.mh-section{display:flex;flex-direction:column;gap:10px}',
1667
- '.mh-sectionHead{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap;justify-content:space-between}',
1668
- '.mh-h2{margin:0;font-size:15px;line-height:22px;font-weight:500}',
1948
+ '.mh-inner{max-width:1040px;margin:0 auto;padding:20px clamp(20px,4vw,44px) 56px;display:flex;flex-direction:column;gap:16px}',
1949
+ '.mh-stack{display:flex;flex-direction:column;gap:18px}',
1950
+ '.mh-grid2{display:grid;gap:14px;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr)}',
1951
+ '@media(max-width:920px){.mh-grid2{grid-template-columns:minmax(0,1fr)}}',
1952
+ '.mh-kicker{font-family:var(--mh-mono);font-size:10px;line-height:14px;letter-spacing:.16em;text-transform:uppercase;color:var(--mh-muted)}',
1953
+ '.mh-num{font-family:var(--mh-mono);font-variant-numeric:tabular-nums;letter-spacing:-.01em}',
1669
1954
  '.mh-hint{margin:0;color:var(--mh-muted);font-size:12px}',
1670
- '.mh-card{border:1px solid var(--mh-line);border-radius:12px;padding:14px 16px;background:var(--mh-surface)}',
1671
- '.mh-spin{display:flex;flex-direction:column;gap:8px;background:var(--mh-surface2)}',
1672
- '.mh-spinTop{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}',
1673
- '.mh-spinActions{display:flex;gap:8px;flex-wrap:wrap}',
1674
- '.mh-chips{display:flex;gap:8px;flex-wrap:wrap}',
1675
- '.mh-chip{border:1px solid var(--mh-line);border-radius:999px;background:var(--mh-surface);padding:4px 12px;font-size:13px}',
1676
- '.mh-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:12px}',
1677
- '.mh-idea{display:flex;flex-direction:column;gap:4px}',
1678
- '.mh-ideaTitle{display:flex;align-items:center;gap:8px;font-weight:500;overflow-wrap:anywhere}',
1679
- '.mh-emoji{font-size:18px;line-height:1.2}',
1680
- '.mh-tag{margin:2px 0 0;color:var(--mh-muted);font-size:13px}',
1681
- '.mh-meta{display:flex;gap:12px;flex-wrap:wrap;color:var(--mh-muted);font-size:12px}',
1682
- '.mh-level{color:var(--mh-brand);letter-spacing:1px}',
1683
- '.mh-cardActions{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}',
1684
- '.mh-steps{margin:10px 0 0;padding-inline-start:20px;font-size:13px;display:flex;flex-direction:column;gap:4px}',
1955
+ '.mh-h2{margin:0;font-size:16px;line-height:22px;font-weight:500}',
1956
+ '.mh-h3{margin:0;font-size:14px;line-height:20px;font-weight:500}',
1957
+ '.mh-foot{margin:4px 0 0;color:var(--mh-muted);font-size:11px;font-family:var(--mh-mono)}',
1958
+ '.mh-card{position:relative;border:1px solid var(--mh-line);border-radius:12px;padding:14px 16px;background:var(--mh-surface)}',
1959
+ '.mh-card::before,.mh-card::after{content:\'\';position:absolute;width:9px;height:9px;border:0 solid var(--mh-line2);pointer-events:none;opacity:.9}',
1960
+ '.mh-card::before{top:5px;left:5px;border-top-width:1px;border-left-width:1px}',
1961
+ '.mh-card::after{bottom:5px;right:5px;border-bottom-width:1px;border-right-width:1px}',
1962
+ '.mh-hero{position:relative}',
1963
+ '.mh-hero::before,.mh-hero::after{content:\'\';position:absolute;width:12px;height:12px;border:0 solid var(--mh-brand);opacity:.5;pointer-events:none}',
1964
+ '.mh-hero::before{top:6px;left:6px;border-top-width:1px;border-left-width:1px}',
1965
+ '.mh-hero::after{bottom:6px;right:6px;border-bottom-width:1px;border-right-width:1px}',
1966
+ '.mh-blockHead{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap;justify-content:space-between}',
1967
+ '.mh-nextText{margin:6px 0 10px;font-size:13px}',
1968
+ '.mh-context{display:flex;align-items:center;gap:10px;flex-wrap:wrap;font-size:13px}',
1969
+ '.mh-tips{display:flex;flex-direction:column;gap:10px}',
1685
1970
  '.mh-btn{appearance:none;border:1px solid var(--mh-line2);border-radius:8px;background:var(--mh-surface);color:var(--mh-ink);padding:5px 11px;font:inherit;font-size:13px;line-height:20px;cursor:pointer}',
1686
1971
  '.mh-btn:hover:enabled{background:var(--mh-surface2)}',
1687
1972
  '.mh-btn:disabled{opacity:.45;cursor:default}',
1688
1973
  '.mh-btn[data-variant=primary]{background:var(--mh-brand);border-color:transparent;color:var(--dsw-alias-label-primary-foreground,#fff)}',
1689
1974
  '.mh-btn[data-variant=primary]:hover:enabled{filter:brightness(1.06)}',
1690
- '.mh-btn:focus-visible,.mh-stage:focus-visible,.mh-iconBtn:focus-visible,.mh-input:focus-visible{outline:2px solid var(--mh-brand);outline-offset:2px}',
1975
+ '.mh-btn:focus-visible,.mh-stage:focus-visible,.mh-iconBtn:focus-visible,.mh-input:focus-visible,.mh-tab:focus-visible,.mh-filter:focus-visible{outline:2px solid var(--mh-brand);outline-offset:2px}',
1691
1976
  '.mh-addRow{display:flex;gap:8px;margin-bottom:10px;flex-wrap:wrap}',
1692
1977
  '.mh-input{flex:1 1 220px;min-width:0;border:1px solid var(--mh-line2);border-radius:8px;background:var(--mh-base);color:var(--mh-ink);padding:5px 10px;font:inherit;font-size:13px;line-height:20px}',
1978
+ '.mh-field{display:flex;flex-direction:column;gap:4px;min-width:0}',
1979
+ '.mh-fieldInline{flex-direction:row;align-items:center;gap:6px}',
1980
+ '.mh-number{width:76px;border:1px solid var(--mh-line2);border-radius:8px;background:var(--mh-base);color:var(--mh-ink);padding:4px 8px;font:inherit;font-size:13px;font-family:var(--mh-mono)}',
1981
+ '.mh-unit{color:var(--mh-muted);font-size:11px;font-family:var(--mh-mono)}',
1982
+ '.mh-form{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:10px;align-items:end}',
1983
+ '.mh-pill{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--mh-line2);border-radius:999px;padding:1px 10px;font-size:11px;font-family:var(--mh-mono);letter-spacing:.04em}',
1984
+ '.mh-pill[data-state=connected],.mh-pill[data-state=done]{border-color:var(--mh-ok);color:var(--mh-ok)}',
1985
+ '.mh-pill[data-state=printing]{border-color:var(--mh-brand);color:var(--mh-brand)}',
1986
+ '.mh-pill[data-state=retrying],.mh-pill[data-state=failed]{border-color:var(--mh-warn);color:var(--mh-warn)}',
1987
+ '.mh-chips{display:flex;gap:8px;flex-wrap:wrap;align-items:center}',
1988
+ '.mh-chip{border:1px solid var(--mh-line);border-radius:999px;background:var(--mh-surface);padding:4px 12px;font-size:13px}',
1989
+ '.mh-filter{appearance:none;border:1px solid var(--mh-line2);background:var(--mh-surface);color:var(--mh-muted);border-radius:999px;padding:3px 12px;font:inherit;font-size:12px;line-height:18px;letter-spacing:.06em;cursor:pointer}',
1990
+ '.mh-filter[aria-pressed=true]{color:var(--mh-ink);border-color:var(--mh-brand);box-shadow:inset 0 0 0 1px var(--mh-brand)}',
1991
+ '.mh-level{color:var(--mh-brand);letter-spacing:1px}',
1992
+ '.mh-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:10px}',
1993
+ '.mh-stat{position:relative;border:1px solid var(--mh-line);border-radius:12px;padding:10px 12px;background:var(--mh-surface);display:flex;flex-direction:column;gap:2px;overflow:hidden}',
1994
+ '.mh-stat::after{content:\'\';position:absolute;left:0;top:0;bottom:0;width:2px;background:var(--mh-line2)}',
1995
+ '.mh-stat[data-accent=true]::after{background:var(--mh-gold)}',
1996
+ '.mh-statValue{font-size:22px;line-height:1.2;font-weight:600}',
1997
+ '.mh-hero{border:1px solid var(--mh-line);border-radius:14px;padding:16px;background:linear-gradient(180deg,var(--mh-surface2),var(--mh-surface));display:flex;flex-direction:column;gap:8px}',
1998
+ '.mh-heroHead{display:flex;align-items:center;gap:10px;justify-content:space-between;flex-wrap:wrap}',
1999
+ '.mh-heroTitle{margin:0;font-size:17px;line-height:25px;font-weight:600;overflow-wrap:anywhere}',
2000
+ '.mh-heroMeta{display:flex;gap:8px;align-items:baseline;margin:0;font-size:13px;color:var(--mh-muted)}',
2001
+ '.mh-heroNote{margin:0;font-size:12px;color:var(--mh-muted);overflow-wrap:anywhere}',
2002
+ '.mh-cardActions{display:flex;gap:8px;flex-wrap:wrap;margin-top:6px}',
2003
+ '.mh-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:12px}',
2004
+ '.mh-idea{display:flex;flex-direction:column;gap:4px;height:100%}',
2005
+ '.mh-idea .mh-cardActions{margin-top:auto;display:grid;grid-template-columns:1fr 1fr;gap:8px}',
2006
+ '.mh-idea .mh-cardActions>.mh-btn:nth-child(3){grid-column:1 / -1}',
2007
+ '.mh-ideaTitle{display:flex;align-items:center;gap:8px;font-weight:500;overflow-wrap:anywhere}',
2008
+ '.mh-emoji{font-size:18px;line-height:1.2}',
2009
+ '.mh-tag{margin:2px 0 0;color:var(--mh-muted);font-size:13px}',
2010
+ '.mh-meta{display:flex;gap:12px;flex-wrap:wrap;color:var(--mh-muted);font-size:11px;font-family:var(--mh-mono)}',
2011
+ '.mh-steps{margin:8px 0 0;padding-inline-start:18px;font-size:13px;display:flex;flex-direction:column;gap:4px}',
2012
+ '.mh-spin{display:flex;flex-direction:column;gap:8px}',
2013
+ '.mh-spinTop{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}',
2014
+ '.mh-spinActions{display:flex;gap:8px;flex-wrap:wrap}',
1693
2015
  '.mh-empty{margin:0}',
1694
2016
  '.mh-rows{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}',
1695
2017
  '.mh-row{display:flex;align-items:center;gap:10px;padding:8px 0;border-top:1px solid var(--mh-line);flex-wrap:wrap}',
1696
2018
  '.mh-row:first-child{border-top:0}',
1697
- '.mh-rowMain{flex:1 1 160px;min-width:0;display:flex;flex-direction:column;gap:0}',
2019
+ '.mh-rowActive{background:var(--mh-surface2);border-radius:8px;padding-inline:8px}',
2020
+ '.mh-rowMain{flex:1 1 160px;min-width:0;display:flex;flex-direction:column}',
1698
2021
  '.mh-rowTitle{overflow-wrap:anywhere}',
1699
- '.mh-rowNote{color:var(--mh-muted);font-size:12px;overflow-wrap:anywhere}',
2022
+ '.mh-rowNote{color:var(--mh-muted);font-size:11px;font-family:var(--mh-mono);overflow-wrap:anywhere}',
1700
2023
  '.mh-stages{display:flex;gap:2px;flex-wrap:wrap}',
1701
2024
  '.mh-stage{appearance:none;border:1px solid transparent;background:transparent;color:var(--mh-muted);border-radius:6px;padding:2px 8px;font:inherit;font-size:12px;line-height:18px;cursor:pointer}',
1702
- '.mh-stage[aria-pressed=true]{border-color:var(--mh-line2);background:var(--mh-surface2);color:var(--mh-ink)}',
2025
+ '.mh-stage[aria-pressed=true]{border-color:transparent;background:var(--mh-brand);color:var(--dsw-alias-label-primary-foreground,#fff)}',
2026
+ '.mh-stage:hover:not([aria-pressed=true]){color:var(--mh-ink)}',
1703
2027
  '.mh-iconBtn{appearance:none;border:1px solid transparent;background:transparent;color:var(--mh-muted);border-radius:6px;padding:2px 8px;font:inherit;font-size:13px;line-height:18px;cursor:pointer}',
1704
2028
  '.mh-iconBtn:hover{color:var(--mh-ink);background:var(--mh-surface2)}',
2029
+ '.mh-badge{margin-inline-start:8px;padding:0 8px;border-radius:999px;border:1px solid var(--mh-brand);color:var(--mh-brand);font-size:10px;line-height:16px;font-family:var(--mh-mono);white-space:nowrap}',
1705
2030
  '.mh-checkHead{display:flex;align-items:center;gap:12px;margin-bottom:8px}',
1706
2031
  '.mh-bar{flex:1 1 auto;height:6px;border-radius:999px;background:var(--mh-line);overflow:hidden}',
1707
- '.mh-barFill{height:100%;background:var(--mh-ok);transition:width .2s ease}',
1708
- '@media(prefers-reduced-motion:reduce){.mh-barFill{transition:none}}',
2032
+ '.mh-barFill{height:100%;background:linear-gradient(90deg,var(--mh-accent),var(--mh-brand));transition:width .2s ease}',
1709
2033
  '.mh-checks{display:flex;flex-direction:column;gap:4px}',
1710
2034
  '.mh-check{display:flex;align-items:flex-start;gap:10px;padding:4px 0;font-size:13px;cursor:pointer}',
1711
2035
  '.mh-check input{margin:4px 0 0;width:15px;height:15px;flex:none;accent-color:var(--mh-brand)}',
1712
2036
  '.mh-safety{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px;font-size:13px}',
1713
2037
  '.mh-safety li{display:flex;gap:8px}',
1714
- '.mh-safety li::before{content:"·";color:var(--mh-warn);font-weight:700}',
1715
- '.mh-banner{margin:0;padding:8px 12px;border:1px solid var(--mh-line2);border-radius:8px;font-size:13px;color:var(--mh-muted)}',
2038
+ '.mh-safety li::before{content:\'·\';color:var(--mh-warn);font-weight:700}',
2039
+ '.mh-doneList{list-style:none;margin:8px 0 0;padding:0;display:flex;flex-direction:column;gap:6px}',
2040
+ '.mh-doneRow{display:flex;align-items:center;gap:8px;flex-wrap:wrap;border-top:1px solid var(--mh-line);padding-top:6px}',
2041
+ '.mh-doneRow:first-child{border-top:0;padding-top:0}',
2042
+ '.mh-doneTitle{flex:1 1 auto;min-width:0;overflow-wrap:anywhere}',
2043
+ '.mh-banner{margin:0;padding:8px 12px;border:1px solid var(--mh-line2);border-radius:8px;font-size:12px;color:var(--mh-muted);font-family:var(--mh-mono)}',
1716
2044
  '.mh-bannerOk{color:var(--mh-ink);border-color:var(--mh-ok)}',
1717
- '.mh-link{appearance:none;border:0;background:none;color:var(--mh-brand);font:inherit;font-size:13px;cursor:pointer;text-decoration:underline;padding:0}',
1718
- '.mh-foot{margin:0;color:var(--mh-muted);font-size:12px}',
1719
- '.mh-3d{display:flex;flex-direction:column;gap:10px}',
1720
- '.mh-canvasWrap{border:1px solid var(--mh-line);border-radius:10px;overflow:hidden;background:var(--mh-surface2)}',
1721
- '.mh-canvas{display:block;width:100%;height:380px;touch-action:none;cursor:grab}',
1722
- '.mh-canvas[data-dragging=true]{cursor:grabbing}',
2045
+ '.mh-link{appearance:none;border:0;background:none;color:var(--mh-brand);font:inherit;font-size:12px;cursor:pointer;text-decoration:underline;padding:0}',
2046
+ '.mh-3d{display:flex;flex-direction:column;gap:12px}',
2047
+ '.mh-canvasWrap{position:relative;border:1px solid var(--mh-console-line);border-radius:14px;overflow:hidden}',
2048
+ '.mh-viewport{background:radial-gradient(120% 90% at 50% 0%,#141c26 0%,#0a0e14 72%);color:var(--mh-console-ink);--mh-accent:var(--mh-console-accent)}',
2049
+ '.mh-canvas{display:block;width:100%;height:420px;touch-action:none;cursor:grab;background:transparent}',
1723
2050
  '@media(max-width:767px){.mh-canvas{height:300px}}',
2051
+ '.mh-canvas[data-dragging=true]{cursor:grabbing}',
2052
+ '.mh-hudTop{position:absolute;top:10px;left:14px;right:14px;display:flex;justify-content:space-between;align-items:center;pointer-events:none;z-index:2}',
2053
+ '.mh-hudBottom{position:absolute;bottom:10px;left:14px;right:14px;display:flex;justify-content:space-between;align-items:center;pointer-events:none;z-index:2}',
2054
+ '.mh-hudTop .mh-kicker{color:var(--mh-console-muted)}',
2055
+ '.mh-hudTag{font-family:var(--mh-mono);font-size:10px;letter-spacing:.12em;color:var(--mh-console-muted)}',
2056
+ '.mh-corner{position:absolute;width:14px;height:14px;border:0 solid var(--mh-console-accent);opacity:.65;pointer-events:none;z-index:2}',
2057
+ '.mh-cornerTL{top:8px;left:8px;border-top-width:1px;border-left-width:1px}',
2058
+ '.mh-cornerTR{top:8px;right:8px;border-top-width:1px;border-right-width:1px}',
2059
+ '.mh-cornerBL{bottom:8px;left:8px;border-bottom-width:1px;border-left-width:1px}',
2060
+ '.mh-cornerBR{bottom:8px;right:8px;border-bottom-width:1px;border-right-width:1px}',
2061
+ '.mh-scanline{position:absolute;left:0;right:0;top:-140px;height:140px;background:linear-gradient(180deg,transparent,rgba(61,219,196,.07),transparent);pointer-events:none;animation:mhScan 7s linear infinite;z-index:1}',
1724
2062
  '.mh-3dRow{display:flex;align-items:center;gap:8px;flex-wrap:wrap}',
1725
2063
  '.mh-seg{display:inline-flex;border:1px solid var(--mh-line2);border-radius:8px;overflow:hidden}',
1726
2064
  '.mh-seg button{appearance:none;border:0;background:transparent;color:var(--mh-ink);padding:4px 10px;font:inherit;font-size:12px;line-height:18px;cursor:pointer}',
1727
2065
  '.mh-seg button[aria-pressed=true]{background:var(--mh-brand);color:var(--dsw-alias-label-primary-foreground,#fff)}',
1728
- '.mh-field{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--mh-muted)}',
1729
- '.mh-fieldInline{flex-direction:row;align-items:center;gap:6px}',
1730
- '.mh-number{width:74px;border:1px solid var(--mh-line2);border-radius:8px;background:var(--mh-base);color:var(--mh-ink);padding:4px 8px;font:inherit;font-size:13px}',
1731
- '.mh-unit{color:var(--mh-muted);font-size:12px}',
1732
- '.mh-hud{display:flex;gap:10px;flex-wrap:wrap;font-size:12px;color:var(--mh-muted)}',
1733
- '.mh-hud b{color:var(--mh-ink);font-weight:500}',
1734
- '.mh-ok{color:var(--mh-ok)}',
1735
- '.mh-warn{color:var(--mh-warn)}',
1736
- '.mh-pill{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--mh-line2);border-radius:999px;padding:1px 10px;font-size:12px}',
1737
- '.mh-pill[data-state=connected]{border-color:var(--mh-ok);color:var(--mh-ok)}',
1738
- '.mh-pill[data-state=retrying],.mh-pill[data-state=failed]{border-color:var(--mh-warn);color:var(--mh-warn)}',
1739
- '.mh-printerRows{display:flex;flex-direction:column;gap:8px}',
1740
- '.mh-printerLive{display:flex;flex-direction:column;gap:8px}',
1741
- '.mh-meter{flex:1 1 160px;height:8px;border-radius:999px;background:var(--mh-line);overflow:hidden}',
1742
- '.mh-meterFill{height:100%;background:var(--mh-brand);transition:width .4s ease}',
1743
- '@media(prefers-reduced-motion:reduce){.mh-meterFill{transition:none}}',
1744
- '.mh-form{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:10px;align-items:end}',
1745
- '.mh-form .mh-input{width:100%}',
1746
- '.mh-section{scroll-margin-top:16px}',
1747
- '.mh-rail{display:flex;gap:6px;flex-wrap:wrap;padding:6px;border:1px solid var(--mh-line);border-radius:12px;background:var(--mh-surface)}',
1748
- '.mh-railStep{appearance:none;border:1px solid transparent;background:transparent;color:var(--mh-muted);border-radius:8px;padding:5px 10px;font:inherit;font-size:12px;line-height:18px;cursor:pointer;display:inline-flex;align-items:center;gap:6px}',
1749
- '.mh-railStep:hover{background:var(--mh-surface2)}',
1750
- '.mh-railStep[data-state=done]{color:var(--mh-ok)}',
1751
- '.mh-railStep[data-state=current]{border-color:var(--mh-brand);color:var(--mh-ink);background:var(--mh-surface2)}',
1752
- '.mh-railNo{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:999px;border:1px solid currentColor;font-size:11px}',
1753
- '.mh-stepNo{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:999px;background:var(--mh-brand);color:var(--dsw-alias-label-primary-foreground,#fff);font-size:12px;font-weight:600}',
1754
- '.mh-block{display:flex;flex-direction:column;gap:10px}',
1755
- '.mh-blockHead{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap;justify-content:space-between}',
1756
- '.mh-h3{margin:0;font-size:14px;line-height:20px;font-weight:500}',
1757
- '.mh-active{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:10px;font-size:13px}',
1758
- '.mh-activeLabel{color:var(--mh-muted);font-size:12px}',
1759
- '.mh-badge{margin-inline-start:8px;padding:0 8px;border-radius:999px;border:1px solid var(--mh-brand);color:var(--mh-brand);font-size:11px;line-height:16px;white-space:nowrap}',
1760
- '.mh-rowActive{background:var(--mh-surface2);border-radius:8px}',
1761
- '.mh-pill[data-state=printing]{border-color:var(--mh-brand);color:var(--mh-brand)}',
1762
- '.mh-pill[data-state=done]{border-color:var(--mh-ok);color:var(--mh-ok)}',
1763
- '.mh-starRow{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:10px}',
1764
- '.mh-starBig{font-size:16px;font-weight:500}',
1765
- '.mh-doneList{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}',
1766
- '.mh-doneRow{display:flex;align-items:center;gap:8px;flex-wrap:wrap;border-top:1px solid var(--mh-line);padding-top:6px}',
1767
- '.mh-doneRow:first-child{border-top:0;padding-top:0}',
1768
- '.mh-doneTitle{flex:1 1 auto;min-width:0;overflow-wrap:anywhere}'
2066
+ '.mh-hud{display:flex;gap:0;flex-wrap:wrap;font-size:12px;color:var(--mh-muted);border:1px solid var(--mh-line);border-radius:10px;background:var(--mh-surface2);overflow:hidden}',
2067
+ '.mh-hud>span{padding:7px 12px;border-left:1px solid var(--mh-line);display:inline-flex;align-items:baseline;gap:4px}',
2068
+ '.mh-hud>span:first-child{border-left:0}',
2069
+ '.mh-hud b{color:var(--mh-ink);font-weight:500;font-family:var(--mh-mono)}',
2070
+ '.mh-console{--mh-accent:var(--mh-console-accent);position:relative;border:1px solid var(--mh-console-line);border-radius:14px;padding:14px 16px;background:linear-gradient(180deg,#10161f,#0b1017);color:var(--mh-console-ink);display:flex;flex-direction:column;gap:12px;overflow:hidden;box-shadow:inset 0 1px 0 rgba(61,219,196,.16)}',
2071
+ '.mh-console::before{content:\'\';position:absolute;inset:0;pointer-events:none;background-image:repeating-linear-gradient(0deg,rgba(255,255,255,.022) 0 1px,transparent 1px 3px)}',
2072
+ '.mh-console>*{position:relative;z-index:1}',
2073
+ '.mh-console .mh-kicker{color:var(--mh-console-muted)}',
2074
+ '.mh-consoleHead{display:flex;align-items:center;gap:8px;flex-wrap:wrap}',
2075
+ '.mh-consoleState{font-size:12px;color:var(--mh-console-ink);font-family:var(--mh-mono)}',
2076
+ '.mh-consoleHost{font-size:11px;color:var(--mh-console-muted)}',
2077
+ '.mh-consoleHint{margin:0;font-size:12px;color:var(--mh-console-muted);line-height:1.6}',
2078
+ '.mh-consoleWarn{color:#f0b46a}',
2079
+ '.mh-consoleFoot{display:flex;align-items:center;gap:8px;flex-wrap:wrap;border-top:1px solid var(--mh-console-line);padding-top:10px}',
2080
+ '.mh-consoleFootNote{font-size:10px;letter-spacing:.1em;text-transform:uppercase;color:var(--mh-console-muted);font-family:var(--mh-mono)}',
2081
+ '.mh-console .mh-btn{background:#141c26;border-color:var(--mh-console-line2);color:var(--mh-console-ink)}',
2082
+ '.mh-console .mh-btn:hover:enabled{background:#1a2431}',
2083
+ '.mh-console .mh-btn[data-variant=primary]{background:var(--mh-console-accent);border-color:transparent;color:#06251f}',
2084
+ '.mh-inputConsole{background:#0b1017;border-color:var(--mh-console-line2);color:var(--mh-console-ink)}',
2085
+ '.mh-inputConsole::placeholder{color:#5d6b7c}',
2086
+ '.mh-formConsole{grid-template-columns:repeat(auto-fit,minmax(170px,1fr))}',
2087
+ '.mh-deviceBody{display:grid;grid-template-columns:auto minmax(0,1fr) minmax(0,1.15fr);gap:20px;align-items:center}',
2088
+ '@media(max-width:860px){.mh-deviceBody{grid-template-columns:minmax(0,1fr);justify-items:start}}',
2089
+ '.mh-deviceMini .mh-deviceBody{display:flex;gap:14px;flex-wrap:wrap;align-items:center}',
2090
+ '.mh-deviceInfo{flex:1 1 200px;min-width:0;display:flex;flex-direction:column;gap:6px}',
2091
+ '.mh-deviceJob{font-size:14px;font-weight:500;overflow-wrap:anywhere}',
2092
+ '.mh-dot{width:8px;height:8px;border-radius:50%;background:#6b7686;flex:none}',
2093
+ '.mh-dot[data-on=false]{background:#6b7686;box-shadow:0 0 0 3px rgba(107,118,134,.16)}',
2094
+ '.mh-dot[data-on=true]{background:var(--mh-console-accent);box-shadow:0 0 0 3px rgba(61,219,196,.18),0 0 10px rgba(61,219,196,.55);animation:mhPulse 2.4s ease-in-out infinite}',
2095
+ '.mh-ring{width:132px;height:132px;border-radius:50%;flex:none;display:grid;place-items:center}',
2096
+ '.mh-ringInner{width:104px;height:104px;border-radius:50%;background:var(--mh-console-bg);box-shadow:inset 0 0 0 1px var(--mh-console-line);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px}',
2097
+ '.mh-ringValue{font-size:26px;line-height:1;font-weight:600;color:var(--mh-console-ink);display:inline-flex;align-items:baseline}',
2098
+ '.mh-ringPct{font-size:12px;color:var(--mh-console-muted);margin-left:2px;font-family:var(--mh-mono)}',
2099
+ '.mh-ringCaption{font-size:9px;letter-spacing:.14em;text-transform:uppercase;color:var(--mh-console-muted);font-family:var(--mh-mono)}',
2100
+ '.mh-hudRow{display:flex;gap:20px;flex-wrap:wrap}',
2101
+ '.mh-metric{display:flex;flex-direction:column;gap:2px;min-width:0}',
2102
+ '.mh-metricLabel{font-family:var(--mh-mono);font-size:9px;letter-spacing:.14em;text-transform:uppercase;color:var(--mh-console-muted)}',
2103
+ '.mh-metricValue{font-size:15px;color:var(--mh-console-ink);display:inline-flex;align-items:baseline;gap:3px}',
2104
+ '.mh-metricUnit{font-size:10px;color:var(--mh-console-muted);font-family:var(--mh-mono)}',
2105
+ '.mh-temps{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:14px;flex:1 1 240px;min-width:0}',
2106
+ '.mh-temp{display:flex;flex-direction:column;gap:6px;min-width:0}',
2107
+ '.mh-tempHead{display:flex;align-items:baseline;justify-content:space-between;gap:8px}',
2108
+ '.mh-tempValue{font-size:13px;color:var(--mh-console-ink);white-space:nowrap}',
2109
+ '.mh-tempUnit{font-size:10px;color:var(--mh-console-muted);margin-left:2px}',
2110
+ '.mh-tempTrack{position:relative;height:6px;border-radius:999px;background:rgba(122,132,148,.18)}',
2111
+ '.mh-tempFill{height:100%;border-radius:999px;background:linear-gradient(90deg,#2f9e8f,#3ddbc4);transition:width .3s ease}',
2112
+ '.mh-tempTarget{position:absolute;top:-3px;width:2px;height:12px;background:var(--mh-gold);border-radius:1px;transform:translateX(-1px)}',
2113
+ '@keyframes mhPulse{0%,100%{opacity:1}50%{opacity:.45}}',
2114
+ '@keyframes mhScan{0%{transform:translateY(0)}100%{transform:translateY(620px)}}',
2115
+ '@media(prefers-reduced-motion:reduce){.mh-dot[data-on=true]{animation:none}.mh-scanline{display:none}.mh-barFill,.mh-tempFill{transition:none}}'
1769
2116
  ].join('\n')
1770
2117
 
1771
2118
  // ── plugin ────────────────────────────────────────────────────────────