@bitbybit-dev/create-app 1.4.0 → 1.5.0-rc.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.
Files changed (63) hide show
  1. package/README.md +1 -0
  2. package/dist/index.js +31 -21
  3. package/dist/index.js.map +1 -1
  4. package/dist/scaffold.d.ts.map +1 -1
  5. package/dist/scaffold.js +16 -8
  6. package/dist/scaffold.js.map +1 -1
  7. package/package.json +1 -1
  8. package/src/index.test.ts +290 -10
  9. package/src/index.ts +42 -25
  10. package/src/scaffold.ts +23 -8
  11. package/templates/apps/drone-assembly/package.json +3 -3
  12. package/templates/apps/drone-assembly/scripts/smoke.ts +3 -3
  13. package/templates/apps/drone-assembly/src/parts.ts +3 -3
  14. package/templates/apps/ifc-house/AGENTS.section.md +19 -0
  15. package/templates/apps/ifc-house/README.md +36 -0
  16. package/templates/apps/ifc-house/eslint.config.js +47 -0
  17. package/templates/apps/ifc-house/index.html +22 -0
  18. package/templates/apps/ifc-house/package.json +36 -0
  19. package/templates/apps/ifc-house/public/favicon.ico +0 -0
  20. package/templates/apps/ifc-house/public/logo.png +0 -0
  21. package/templates/apps/ifc-house/scripts/smoke.ts +118 -0
  22. package/templates/apps/ifc-house/src/export/step-export.ts +29 -0
  23. package/templates/apps/ifc-house/src/house/build-house.ts +194 -0
  24. package/templates/apps/ifc-house/src/house/details.ts +393 -0
  25. package/templates/apps/ifc-house/src/house/house-plan.ts +400 -0
  26. package/templates/apps/ifc-house/src/house/house-types.ts +192 -0
  27. package/templates/apps/ifc-house/src/main.ts +138 -0
  28. package/templates/apps/ifc-house/src/scene/draw-house.ts +92 -0
  29. package/templates/apps/ifc-house/src/scene/scene-types.ts +30 -0
  30. package/templates/apps/ifc-house/src/scene/stage.ts +64 -0
  31. package/templates/apps/ifc-house/src/style.css +347 -0
  32. package/templates/apps/ifc-house/src/ui/panel.ts +144 -0
  33. package/templates/apps/ifc-house/src/ui/room-labels.ts +75 -0
  34. package/templates/apps/ifc-house/src/ui/ui-types.ts +14 -0
  35. package/templates/apps/ifc-house/src/vite-env.d.ts +1 -0
  36. package/templates/apps/ifc-house/src/workers/ifc.worker.ts +7 -0
  37. package/templates/apps/ifc-house/src/workers/manifold.worker.ts +16 -0
  38. package/templates/apps/ifc-house/src/workers/occt.worker.ts +17 -0
  39. package/templates/apps/ifc-house/tsconfig.json +29 -0
  40. package/templates/apps/laser-cut-box/package.json +2 -2
  41. package/templates/apps/laser-cut-box/scripts/smoke.ts +2 -1
  42. package/templates/apps/laser-cut-box/src/panels.ts +2 -0
  43. package/templates/apps/product-configurator/package.json +2 -2
  44. package/templates/apps/product-configurator/scripts/smoke.ts +4 -3
  45. package/templates/apps/sheet-metal-unfold/backend/package.json +1 -1
  46. package/templates/apps/sheet-metal-unfold/frontend/package.json +2 -2
  47. package/templates/apps/sheet-metal-unfold/frontend/scripts/smoke.ts +4 -3
  48. package/templates/apps/step-to-gltf-cli/package.json +2 -2
  49. package/templates/apps/step-to-gltf-cli/src/convert.ts +7 -2
  50. package/templates/cloud/backends/hono-rest/package.json +1 -1
  51. package/templates/cloud/backends/hono-sdk/package.json +2 -2
  52. package/templates/cloud/backends/nodejs-rest/package.json +1 -1
  53. package/templates/cloud/backends/nodejs-sdk/package.json +2 -2
  54. package/templates/cloud/frontend/package.json +1 -1
  55. package/templates/vite/babylonjs/typescript/AGENTS.section.md +1 -1
  56. package/templates/vite/babylonjs/typescript/package.json +2 -2
  57. package/templates/vite/babylonjs/typescript/scripts/smoke.ts +4 -3
  58. package/templates/vite/playcanvas/typescript/AGENTS.section.md +1 -1
  59. package/templates/vite/playcanvas/typescript/package.json +2 -2
  60. package/templates/vite/playcanvas/typescript/scripts/smoke.ts +4 -3
  61. package/templates/vite/threejs/typescript/AGENTS.section.md +1 -1
  62. package/templates/vite/threejs/typescript/package.json +2 -2
  63. package/templates/vite/threejs/typescript/scripts/smoke.ts +4 -3
@@ -0,0 +1,138 @@
1
+ import "./style.css";
2
+ import * as THREE from "three";
3
+ import { BitByBitBase, initBitByBit } from "@bitbybit-dev/threejs";
4
+ import { houseStep } from "./export/step-export";
5
+ import { HouseAuthor } from "./house/build-house";
6
+ import type { Layer, StoreyKey } from "./house/house-types";
7
+ import { drawHouse } from "./scene/draw-house";
8
+ import type { DrawnElement, ElementInfo, Stage } from "./scene/scene-types";
9
+ import { createStage } from "./scene/stage";
10
+ import { HousePanel, showStatus } from "./ui/panel";
11
+ import { RoomLabels } from "./ui/room-labels";
12
+
13
+ const DOWNLOAD_URL_LIFETIME_MS = 10000;
14
+ const CLICK_TOLERANCE_PX = 4;
15
+ const HIGHLIGHT = new THREE.MeshStandardMaterial({ color: "#e9b44c", emissive: "#3d2700", roughness: 0.5 });
16
+
17
+ const status = document.getElementById("status") as HTMLElement;
18
+ start().catch((error: unknown) => {
19
+ showStatus(status, `The house could not be built: ${error instanceof Error ? error.message : String(error)}`);
20
+ });
21
+
22
+ async function start(): Promise<void> {
23
+ const stage = createStage("three-canvas");
24
+ const bitbybit = new BitByBitBase();
25
+ showStatus(status, "Starting the IFC and Manifold workers");
26
+ await initBitByBit(stage.scene, bitbybit, {
27
+ enableManifold: true,
28
+ enableIFC: true,
29
+ workers: {
30
+ manifoldWorker: new Worker(new URL("./workers/manifold.worker.ts", import.meta.url), { name: "MANIFOLD_WORKER", type: "module" }),
31
+ ifcWorker: new Worker(new URL("./workers/ifc.worker.ts", import.meta.url), { name: "IFC_WORKER", type: "module" }),
32
+ },
33
+ });
34
+
35
+ const started = performance.now();
36
+ const house = await new HouseAuthor(bitbybit.ifc, (message) => {
37
+ showStatus(status, message);
38
+ }).build();
39
+ showStatus(status, "Building the geometry with Manifold");
40
+ const drawn = await drawHouse(bitbybit, house);
41
+ const seconds = (performance.now() - started) / 1000;
42
+
43
+ const spaces = await bitbybit.ifc.spaces.list({ model: house.model });
44
+ const areas = new Map(spaces.map((space) => [space.name, space.area]));
45
+ const summary = await bitbybit.ifc.model.summary({ model: house.model });
46
+ const openings = (summary.elementCounts["IfcWindow"] ?? 0) + (summary.elementCounts["IfcDoor"] ?? 0);
47
+ const netArea = spaces.reduce((sum, space) => sum + space.area, 0);
48
+
49
+ const labels = new RoomLabels(stage, house.rooms, areas, document.getElementById("labels") as HTMLElement);
50
+ const panel: HousePanel = new HousePanel(document.getElementById("ui") as HTMLElement, { netArea, rooms: spaces.length, openings, seconds }, house.rooms, areas, {
51
+ onToggle: (key, on) => {
52
+ if (key === "labels" && on) {
53
+ panel.turn("roof", false);
54
+ }
55
+ if (key !== "labels") {
56
+ drawn.filter((item) => item.info.layer === key).forEach((item) => {
57
+ item.object.visible = on;
58
+ });
59
+ }
60
+ labels.show(labelledStorey(panel));
61
+ },
62
+ onDownload: async () => {
63
+ saveFile(await bitbybit.ifc.model.write({ model: house.model, fileName: "house.ifc" }), "house.ifc", "application/x-step");
64
+ },
65
+ onDownloadStep: async () => {
66
+ showStatus(status, "Starting OpenCascade and writing house.step");
67
+ try {
68
+ saveFile((await houseStep(bitbybit, house.model)).slice(), "house.step", "model/step");
69
+ showStatus(status, undefined);
70
+ } catch (error) {
71
+ showStatus(status, `The STEP file could not be written: ${error instanceof Error ? error.message : String(error)}`);
72
+ }
73
+ },
74
+ });
75
+ enablePicking(stage, drawn, (info) => {
76
+ panel.select(info);
77
+ });
78
+ showStatus(status, undefined);
79
+ }
80
+
81
+ function labelledStorey(panel: HousePanel): StoreyKey | undefined {
82
+ if (!panel.isOn("labels")) {
83
+ return undefined;
84
+ }
85
+ const order: [Layer, StoreyKey][] = [["first", "first"], ["ground", "ground"]];
86
+ return order.find(([layer]) => panel.isOn(layer))?.[1];
87
+ }
88
+
89
+ function enablePicking(stage: Stage, drawn: DrawnElement[], onPick: (info: ElementInfo | undefined) => void): void {
90
+ const canvas = stage.renderer.domElement;
91
+ const raycaster = new THREE.Raycaster();
92
+ const pointer = new THREE.Vector2();
93
+ const restore = new Map<THREE.Mesh, THREE.Material | THREE.Material[]>();
94
+ let down: [number, number] = [0, 0];
95
+ canvas.addEventListener("pointerdown", (event) => {
96
+ down = [event.clientX, event.clientY];
97
+ });
98
+ canvas.addEventListener("pointerup", (event) => {
99
+ if (Math.hypot(event.clientX - down[0], event.clientY - down[1]) > CLICK_TOLERANCE_PX) {
100
+ return;
101
+ }
102
+ const bounds = canvas.getBoundingClientRect();
103
+ pointer.set((event.clientX - bounds.left) / bounds.width * 2 - 1, -((event.clientY - bounds.top) / bounds.height) * 2 + 1);
104
+ raycaster.setFromCamera(pointer, stage.camera);
105
+ const visible = drawn.filter((item) => item.object.visible).map((item) => item.object);
106
+ const hit = raycaster.intersectObjects(visible, true).find((candidate) => candidate.object.userData["element"]);
107
+ restore.forEach((material, mesh) => {
108
+ mesh.material = material;
109
+ });
110
+ restore.clear();
111
+ const info = hit?.object.userData["element"] as ElementInfo | undefined;
112
+ if (hit && info) {
113
+ const owner = drawn.find((item) => item.info === info);
114
+ owner?.object.traverse((part) => {
115
+ if (isMesh(part)) {
116
+ restore.set(part, part.material);
117
+ part.material = HIGHLIGHT;
118
+ }
119
+ });
120
+ }
121
+ onPick(info);
122
+ });
123
+ }
124
+
125
+ function isMesh(object: THREE.Object3D): object is THREE.Mesh {
126
+ return object instanceof THREE.Mesh;
127
+ }
128
+
129
+ function saveFile(data: BlobPart, fileName: string, type: string): void {
130
+ const url = URL.createObjectURL(new Blob([data], { type }));
131
+ const link = document.createElement("a");
132
+ link.href = url;
133
+ link.download = fileName;
134
+ link.click();
135
+ setTimeout(() => {
136
+ URL.revokeObjectURL(url);
137
+ }, DOWNLOAD_URL_LIFETIME_MS);
138
+ }
@@ -0,0 +1,92 @@
1
+ import * as THREE from "three";
2
+ import { Inputs, type BitByBitBase } from "@bitbybit-dev/threejs";
3
+ import { ROOF } from "../house/house-plan";
4
+ import type { HouseModel, Layer } from "../house/house-types";
5
+ import type { DrawnElement, ElementInfo, Look } from "./scene-types";
6
+
7
+ const SHARP_ANGLE = 40;
8
+ const FALLBACK_COLOUR = "#d6d3cc";
9
+ const MATTE: Look = { roughness: 0.88, metalness: 0 };
10
+ const FOLIAGE: Look = { roughness: 0.95, metalness: 0, faceted: true };
11
+ const LOOKS: Record<string, Look> = {
12
+ "#3b342e": { roughness: 0.86, metalness: 0 },
13
+ "#161514": { roughness: 0.7, metalness: 0 },
14
+ "#b2865a": { roughness: 0.55, metalness: 0 },
15
+ "#5c4433": { roughness: 0.5, metalness: 0 },
16
+ "#8b6b52": { roughness: 0.7, metalness: 0 },
17
+ "#2b2f33": { roughness: 0.32, metalness: 0.55 },
18
+ "#2f3236": { roughness: 0.42, metalness: 0.6 },
19
+ "#b4b8bc": { roughness: 0.24, metalness: 0.9 },
20
+ "#1c2530": { roughness: 0.12, metalness: 0.35 },
21
+ "#9fb184": { roughness: 1, metalness: 0 },
22
+ "#9db277": FOLIAGE,
23
+ "#6f8f58": FOLIAGE,
24
+ "#50684b": FOLIAGE,
25
+ };
26
+ const LAYERS_BY_NAME: Record<string, Layer> = { [ROOF.name]: "roof", "Carport roof": "garden" };
27
+
28
+ function hexOf(rgba: readonly number[]): string {
29
+ return `#${rgba.slice(0, 3).map((channel) => Math.round(channel * 255).toString(16).padStart(2, "0")).join("")}`;
30
+ }
31
+
32
+ class Materials {
33
+ private readonly made = new Map<string, THREE.Material>();
34
+
35
+ of(rgba: readonly number[] | undefined): THREE.Material {
36
+ const colour = rgba ? hexOf(rgba) : FALLBACK_COLOUR;
37
+ const alpha = rgba?.[3] ?? 1;
38
+ const key = `${colour}/${alpha}`;
39
+ let material = this.made.get(key);
40
+ if (!material) {
41
+ material = alpha < 1 ? this.glass(colour, alpha) : this.solid(colour, LOOKS[colour] ?? MATTE);
42
+ this.made.set(key, material);
43
+ }
44
+ return material;
45
+ }
46
+
47
+ private solid(colour: string, look: Look): THREE.Material {
48
+ return new THREE.MeshStandardMaterial({ color: colour, roughness: look.roughness, metalness: look.metalness, flatShading: look.faceted ?? false });
49
+ }
50
+
51
+ private glass(colour: string, alpha: number): THREE.Material {
52
+ return new THREE.MeshPhysicalMaterial({
53
+ color: colour, transparent: true, opacity: Math.max(0.18, alpha), roughness: 0.04, metalness: 0,
54
+ envMapIntensity: 1.8, depthWrite: false, side: THREE.DoubleSide,
55
+ });
56
+ }
57
+ }
58
+
59
+ export async function drawHouse(bitbybit: BitByBitBase, house: HouseModel): Promise<DrawnElement[]> {
60
+ const recipe = await bitbybit.ifc.geometry.recipe({ model: house.model });
61
+ const solids = await bitbybit.manifold.recipes.build({ recipe, adjustZtoY: true, emptyWhenFailed: true });
62
+ const meshes = await bitbybit.manifold.decomposeManifoldsOrCrossSections({ manifoldsOrCrossSections: solids, minSharpAngle: SHARP_ANGLE });
63
+ const materials = new Materials();
64
+ const drawn: DrawnElement[] = [];
65
+ for (const [index, root] of recipe.roots.entries()) {
66
+ const mesh = meshes[index];
67
+ if (!mesh) {
68
+ continue;
69
+ }
70
+ const tag = root.tag;
71
+ const rgba = Array.isArray(tag["rgba"]) ? tag["rgba"] : undefined;
72
+ const options = new Inputs.Draw.DrawManifoldOrCrossSectionOptions();
73
+ options.faceMaterial = materials.of(rgba);
74
+ options.drawTwoSided = false;
75
+ options.minSharpAngle = SHARP_ANGLE;
76
+ const object = await bitbybit.draw.drawAnyAsync({ entity: mesh as Inputs.Manifold.DecomposedManifoldMeshDto, options });
77
+ const info: ElementInfo = {
78
+ globalId: String(tag["globalId"]),
79
+ type: String(tag["type"]),
80
+ name: String(tag["name"] ?? ""),
81
+ layer: house.layers.get(String(tag["globalId"])) ?? LAYERS_BY_NAME[String(tag["name"])] ?? "ground",
82
+ };
83
+ const seeThrough = rgba !== undefined && (rgba[3] ?? 1) < 1;
84
+ object.traverse((part) => {
85
+ part.userData = { ...part.userData, element: info };
86
+ part.castShadow = !seeThrough;
87
+ part.receiveShadow = true;
88
+ });
89
+ drawn.push({ info, object });
90
+ }
91
+ return drawn;
92
+ }
@@ -0,0 +1,30 @@
1
+ import type * as THREE from "three";
2
+ import type { initThreeJS } from "@bitbybit-dev/threejs";
3
+ import type { Layer } from "../house/house-types";
4
+
5
+ export type OrbitCamera = NonNullable<ReturnType<typeof initThreeJS>["orbitCamera"]>;
6
+
7
+ export interface Stage {
8
+ scene: THREE.Scene;
9
+ renderer: THREE.WebGLRenderer;
10
+ camera: THREE.PerspectiveCamera;
11
+ orbit: OrbitCamera;
12
+ }
13
+
14
+ export interface ElementInfo {
15
+ globalId: string;
16
+ type: string;
17
+ name: string;
18
+ layer: Layer;
19
+ }
20
+
21
+ export interface DrawnElement {
22
+ info: ElementInfo;
23
+ object: THREE.Object3D;
24
+ }
25
+
26
+ export interface Look {
27
+ roughness: number;
28
+ metalness: number;
29
+ faceted?: boolean;
30
+ }
@@ -0,0 +1,64 @@
1
+ import * as THREE from "three";
2
+ import { RoomEnvironment } from "three/examples/jsm/environments/RoomEnvironment.js";
3
+ import { Inputs, initThreeJS } from "@bitbybit-dev/threejs";
4
+ import type { Stage } from "./scene-types";
5
+
6
+ const SKY = "#e7ebec";
7
+ const NARROW_SCREEN = 720;
8
+ const WIDE_PIVOT: Inputs.Base.Point3 = [8.4, 2.6, -4.6];
9
+ const NARROW_PIVOT: Inputs.Base.Point3 = [6.0, -3.0, -3.0];
10
+ const SUN_OFFSET = new THREE.Vector3(24, 30, 22);
11
+ const SHADOW_REACH = 26;
12
+
13
+ export function createStage(canvasId: string): Stage {
14
+ const narrow = window.innerWidth < NARROW_SCREEN;
15
+ const PIVOT = narrow ? NARROW_PIVOT : WIDE_PIVOT;
16
+ const options = new Inputs.ThreeJSScene.InitThreeJSDto();
17
+ options.canvasId = canvasId;
18
+ options.sceneSize = 40;
19
+ options.backgroundColor = SKY;
20
+ options.enableGround = false;
21
+ options.hemisphereLightSkyColor = "#f4f6f8";
22
+ options.hemisphereLightGroundColor = "#a49c8c";
23
+ options.hemisphereLightIntensity = 0.38;
24
+ options.directionalLightColor = "#fff4e6";
25
+ options.directionalLightIntensity = 3.1;
26
+ options.shadowMapSize = 4096;
27
+ const camera = new Inputs.ThreeJSCamera.OrbitCameraDto();
28
+ camera.pivotPoint = PIVOT;
29
+ camera.distance = narrow ? 52 : 26;
30
+ camera.pitch = 14;
31
+ camera.yaw = 32;
32
+ camera.distanceMin = 4;
33
+ camera.distanceMax = 120;
34
+ camera.pitchAngleMin = 2;
35
+ camera.pitchAngleMax = 88;
36
+ options.orbitCameraOptions = camera;
37
+ const { scene, renderer, directionalLight, orbitCamera, startAnimationLoop } = initThreeJS(options);
38
+ if (!orbitCamera) {
39
+ throw new Error("The scene was set up without its orbit camera");
40
+ }
41
+
42
+ renderer.toneMapping = THREE.ACESFilmicToneMapping;
43
+ renderer.toneMappingExposure = 1.0;
44
+ scene.environment = new THREE.PMREMGenerator(renderer).fromScene(new RoomEnvironment(), 0.04).texture;
45
+ scene.environmentIntensity = 0.45;
46
+ scene.fog = new THREE.Fog(SKY, 70, 190);
47
+
48
+ const target = new THREE.Vector3(...PIVOT);
49
+ directionalLight.position.copy(target).add(SUN_OFFSET);
50
+ directionalLight.target.position.copy(target);
51
+ const shadow = directionalLight.shadow.camera;
52
+ shadow.left = -SHADOW_REACH;
53
+ shadow.right = SHADOW_REACH;
54
+ shadow.top = SHADOW_REACH;
55
+ shadow.bottom = -SHADOW_REACH;
56
+ shadow.far = 140;
57
+ shadow.updateProjectionMatrix();
58
+ directionalLight.shadow.bias = -0.0004;
59
+ directionalLight.shadow.normalBias = 0.02;
60
+ directionalLight.shadow.radius = 3;
61
+
62
+ startAnimationLoop();
63
+ return { scene, renderer, camera: orbitCamera.camera, orbit: orbitCamera };
64
+ }
@@ -0,0 +1,347 @@
1
+ :root {
2
+ --ink: #1e2226;
3
+ --muted: #6c7277;
4
+ --line: rgba(30, 34, 38, 0.1);
5
+ --panel: rgba(250, 250, 248, 0.86);
6
+ --accent: #2b2f33;
7
+ --gold: #c9973a;
8
+ font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
9
+ color: var(--ink);
10
+ }
11
+
12
+ body {
13
+ margin: 0;
14
+ overflow: hidden;
15
+ background: #e7ebec;
16
+ }
17
+
18
+ #three-canvas {
19
+ display: block;
20
+ }
21
+
22
+ .labels {
23
+ position: fixed;
24
+ inset: 0;
25
+ pointer-events: none;
26
+ overflow: hidden;
27
+ }
28
+
29
+ .room-label {
30
+ position: absolute;
31
+ left: 0;
32
+ top: 0;
33
+ flex-direction: column;
34
+ align-items: center;
35
+ padding: 5px 9px;
36
+ border-radius: 8px;
37
+ background: rgba(255, 255, 255, 0.9);
38
+ box-shadow: 0 2px 10px rgba(20, 24, 28, 0.12);
39
+ font-size: 11px;
40
+ line-height: 1.3;
41
+ white-space: nowrap;
42
+ }
43
+
44
+ .room-number {
45
+ color: var(--gold);
46
+ font-weight: 600;
47
+ letter-spacing: 0.04em;
48
+ }
49
+
50
+ .room-name {
51
+ font-weight: 600;
52
+ }
53
+
54
+ .room-area {
55
+ color: var(--muted);
56
+ }
57
+
58
+ .panel {
59
+ position: fixed;
60
+ top: 20px;
61
+ right: 20px;
62
+ width: 330px;
63
+ max-height: calc(100vh - 40px);
64
+ overflow-y: auto;
65
+ box-sizing: border-box;
66
+ padding: 22px 22px 20px;
67
+ border-radius: 16px;
68
+ background: var(--panel);
69
+ backdrop-filter: blur(14px);
70
+ box-shadow: 0 10px 40px rgba(20, 24, 28, 0.14);
71
+ }
72
+
73
+ .eyebrow {
74
+ color: var(--gold);
75
+ font-size: 11px;
76
+ font-weight: 600;
77
+ letter-spacing: 0.08em;
78
+ text-transform: uppercase;
79
+ }
80
+
81
+ .title {
82
+ margin: 6px 0 8px;
83
+ font-size: 26px;
84
+ font-weight: 650;
85
+ letter-spacing: -0.02em;
86
+ }
87
+
88
+ .lede {
89
+ margin: 0;
90
+ color: var(--muted);
91
+ font-size: 13px;
92
+ line-height: 1.5;
93
+ }
94
+
95
+ .facts {
96
+ display: grid;
97
+ grid-template-columns: 1fr 1fr;
98
+ gap: 1px;
99
+ margin: 18px 0;
100
+ overflow: hidden;
101
+ border-radius: 12px;
102
+ background: var(--line);
103
+ }
104
+
105
+ .fact {
106
+ padding: 10px 12px;
107
+ background: rgba(255, 255, 255, 0.75);
108
+ }
109
+
110
+ .fact-value {
111
+ font-size: 18px;
112
+ font-weight: 650;
113
+ }
114
+
115
+ .fact-label {
116
+ margin: 2px 0 0;
117
+ color: var(--muted);
118
+ font-size: 11px;
119
+ }
120
+
121
+ .section-title {
122
+ margin: 0 0 10px;
123
+ color: var(--muted);
124
+ font-size: 11px;
125
+ font-weight: 600;
126
+ letter-spacing: 0.08em;
127
+ text-transform: uppercase;
128
+ }
129
+
130
+ .toggles {
131
+ padding-bottom: 14px;
132
+ border-bottom: 1px solid var(--line);
133
+ }
134
+
135
+ .switch {
136
+ display: flex;
137
+ align-items: center;
138
+ gap: 10px;
139
+ padding: 5px 0;
140
+ font-size: 14px;
141
+ cursor: pointer;
142
+ }
143
+
144
+ .switch-input {
145
+ position: absolute;
146
+ opacity: 0;
147
+ pointer-events: none;
148
+ }
149
+
150
+ .switch-track {
151
+ position: relative;
152
+ flex: none;
153
+ width: 32px;
154
+ height: 18px;
155
+ border-radius: 9px;
156
+ background: #c9ccce;
157
+ transition: background 0.15s;
158
+ }
159
+
160
+ .switch-track::after {
161
+ content: "";
162
+ position: absolute;
163
+ top: 2px;
164
+ left: 2px;
165
+ width: 14px;
166
+ height: 14px;
167
+ border-radius: 50%;
168
+ background: #fff;
169
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
170
+ transition: transform 0.15s;
171
+ }
172
+
173
+ .switch-input:checked + .switch-track {
174
+ background: var(--accent);
175
+ }
176
+
177
+ .switch-input:checked + .switch-track::after {
178
+ transform: translateX(14px);
179
+ }
180
+
181
+ .switch-input:focus-visible + .switch-track {
182
+ outline: 2px solid var(--gold);
183
+ outline-offset: 2px;
184
+ }
185
+
186
+ .schedule {
187
+ padding: 14px 0;
188
+ border-bottom: 1px solid var(--line);
189
+ }
190
+
191
+ .schedule summary {
192
+ margin: 0;
193
+ cursor: pointer;
194
+ list-style: none;
195
+ }
196
+
197
+ .schedule summary::after {
198
+ content: " +";
199
+ }
200
+
201
+ .schedule[open] summary::after {
202
+ content: " -";
203
+ }
204
+
205
+ .rooms {
206
+ width: 100%;
207
+ margin-top: 10px;
208
+ border-collapse: collapse;
209
+ font-size: 12px;
210
+ }
211
+
212
+ .rooms td {
213
+ padding: 4px 0;
214
+ border-top: 1px solid var(--line);
215
+ }
216
+
217
+ .room-cell-number {
218
+ width: 38px;
219
+ color: var(--gold);
220
+ font-weight: 600;
221
+ }
222
+
223
+ .room-cell-area {
224
+ color: var(--muted);
225
+ text-align: right;
226
+ white-space: nowrap;
227
+ }
228
+
229
+ .selection {
230
+ padding: 14px 0 16px;
231
+ min-height: 58px;
232
+ }
233
+
234
+ .hint {
235
+ margin: 0;
236
+ color: var(--muted);
237
+ font-size: 13px;
238
+ line-height: 1.5;
239
+ }
240
+
241
+ .selection-type {
242
+ color: var(--gold);
243
+ font-size: 11px;
244
+ font-weight: 600;
245
+ letter-spacing: 0.08em;
246
+ text-transform: uppercase;
247
+ }
248
+
249
+ .selection-name {
250
+ margin: 3px 0 4px;
251
+ font-size: 16px;
252
+ font-weight: 600;
253
+ }
254
+
255
+ .selection-id {
256
+ color: var(--muted);
257
+ font-size: 11px;
258
+ }
259
+
260
+ .panel-logo {
261
+ display: block;
262
+ width: 28px;
263
+ height: 28px;
264
+ margin-bottom: 10px;
265
+ }
266
+
267
+ .downloads {
268
+ display: grid;
269
+ gap: 8px;
270
+ }
271
+
272
+ .download {
273
+ width: 100%;
274
+ padding: 12px 16px;
275
+ border: 0;
276
+ border-radius: 10px;
277
+ background: var(--accent);
278
+ color: #fff;
279
+ font: inherit;
280
+ font-size: 14px;
281
+ font-weight: 600;
282
+ cursor: pointer;
283
+ }
284
+
285
+ .download:hover {
286
+ background: #111416;
287
+ }
288
+
289
+ .download:disabled {
290
+ opacity: 0.6;
291
+ cursor: wait;
292
+ }
293
+
294
+ .status {
295
+ position: fixed;
296
+ left: 50%;
297
+ bottom: 28px;
298
+ transform: translateX(-50%);
299
+ padding: 10px 18px;
300
+ border-radius: 999px;
301
+ background: rgba(30, 34, 38, 0.86);
302
+ color: #fff;
303
+ font-size: 13px;
304
+ transition: opacity 0.4s;
305
+ }
306
+
307
+ .status-hidden {
308
+ opacity: 0;
309
+ pointer-events: none;
310
+ }
311
+
312
+ a.logo {
313
+ position: fixed;
314
+ left: 20px;
315
+ bottom: 18px;
316
+ color: var(--ink);
317
+ font-family: "Courier New", Courier, monospace;
318
+ font-size: 12px;
319
+ text-align: center;
320
+ text-decoration: none;
321
+ }
322
+
323
+ .logo img {
324
+ width: 42px;
325
+ height: 42px;
326
+ }
327
+
328
+ @media (max-width: 720px) {
329
+ .panel {
330
+ top: auto;
331
+ right: 12px;
332
+ bottom: 12px;
333
+ left: 12px;
334
+ width: auto;
335
+ max-height: 46vh;
336
+ padding: 16px;
337
+ }
338
+
339
+ .lede,
340
+ a.logo {
341
+ display: none;
342
+ }
343
+
344
+ .status {
345
+ bottom: calc(46vh + 24px);
346
+ }
347
+ }