        body { margin: 0; padding: 0; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: #121212; color: #e0e0e0; display: flex; height: 100vh; overflow: hidden; }
        .sidebar { width: 400px; background-color: #1e1e1e; display: flex; flex-direction: column; border-right: 1px solid #333; box-sizing: border-box; z-index: 20; }
        .tabs { display: flex; border-bottom: 2px solid #333; flex-shrink: 0; }
        .tab { flex: 1; padding: 12px 2px; text-align: center; background: #252526; color: #888; cursor: pointer; font-weight: bold; font-size: 10px; border: none; text-transform: uppercase; transition: 0.2s; letter-spacing: 0.5px; }
        .tab.active { background: #1e1e1e; color: #ff9900; border-bottom: 2px solid #ff9900; }
        .sidebar-content { padding: 15px; overflow-y: auto; flex-grow: 1; }
        .main-panel { flex-grow: 1; display: flex; flex-direction: column; background-color: #f0f0f0; position: relative; }
        .viewer { flex-grow: 1; position: relative; width: 100%; height: 100%; overflow: hidden; }
        .console-panel { height: 230px; background-color: #0a0a0a; color: #00ff00; font-family: monospace; padding: 12px 15px; display: flex; flex-direction: column; border-top: 2px solid #333; box-sizing: border-box; z-index: 20; transition: height 0.2s cubic-bezier(0.4, 0, 0.2, 1); }
        .console-panel.collapsed { height: 32px !important; min-height: 32px !important; padding: 6px 15px !important; overflow: hidden !important; }
        .console-panel.collapsed #console-output,
        .console-panel.collapsed #download-links { display: none !important; }
        .console-panel.collapsed .console-header { margin-bottom: 0 !important; }
        #console-output { flex-grow: 1; overflow-y: auto; padding-right: 5px; margin-bottom: 10px; font-size: 11px; scroll-behavior: smooth; }
        .section { margin-bottom: 15px; background-color: #252526; padding: 12px; border-radius: 5px; border: 1px solid #333; }
        .section-title { font-size: 11px; color: #ff9900; margin-bottom: 10px; text-transform: uppercase; font-weight: bold; border-bottom: 1px solid #444; padding-bottom: 5px; }
        label { display: flex; align-items: center; font-size: 11px; margin-bottom: 4px; color: #ccc; font-weight: bold; }
        input[type="file"], input[type="number"], select, input[type="range"] { width: 100%; background-color: #333; color: #fff; border: 1px solid #555; padding: 6px; margin-bottom: 8px; border-radius: 3px; box-sizing: border-box; font-size: 11px; }
        input[type="number"] {
            color-scheme: dark !important;
            -moz-appearance: number-input;
            appearance: auto;
        }
        input[type="number"]::-webkit-inner-spin-button,
        input[type="number"]::-webkit-outer-spin-button {
            -webkit-appearance: inner-spin-button !important;
            opacity: 1 !important;
            height: 100% !important;
            cursor: pointer !important;
            display: inline-block !important;
        }

        /* High-Visibility Custom Stepper Buttons for Number Inputs */
        .num-stepper-wrap {
            position: relative;
            display: inline-flex;
            align-items: center;
            width: 100%;
            box-sizing: border-box;
            vertical-align: middle;
            margin-bottom: 4px;
        }
        .num-stepper-wrap input[type="number"] {
            width: 100% !important;
            padding-right: 20px !important;
            margin-bottom: 0 !important;
            -webkit-appearance: none !important;
            -moz-appearance: textfield !important;
            appearance: none !important;
        }
        .num-stepper-wrap input[type="number"]::-webkit-inner-spin-button,
        .num-stepper-wrap input[type="number"]::-webkit-outer-spin-button {
            -webkit-appearance: none !important;
            display: none !important;
            margin: 0 !important;
        }
        .stepper-btn-group {
            position: absolute;
            right: 1px;
            top: 1px;
            bottom: 1px;
            width: 18px;
            display: flex;
            flex-direction: column;
            z-index: 3;
            border-left: 1px solid #444;
            background: #1e222a;
            border-top-right-radius: 2px;
            border-bottom-right-radius: 2px;
            overflow: hidden;
        }
        .stepper-btn {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            background: #252b36;
            color: #00e5ff;
            border: none;
            padding: 0;
            margin: 0;
            font-size: 7.5px;
            font-weight: bold;
            line-height: 1;
            cursor: pointer;
            user-select: none;
            transition: background 0.1s, color 0.1s;
            border-radius: 0;
        }
        .stepper-btn:hover {
            background: #007acc;
            color: #ffffff;
        }
        .stepper-btn:active {
            background: #ff9900;
            color: #000000;
        }
        .stepper-btn.stepper-up {
            border-bottom: 1px solid #364152;
        }
        input[type="color"] { border: none; padding: 0; background: none; cursor: pointer; border-radius: 3px; height: 24px; }
        input[type="checkbox"] { margin-right: 8px; }
        .checkbox-group { display: flex; align-items: center; margin-bottom: 8px; font-size: 11px; color: #ddd; }
        .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
        button { width: 100%; padding: 10px; border: none; border-radius: 3px; font-weight: bold; cursor: pointer; margin-bottom: 8px; transition: 0.2s; text-transform: uppercase; font-size: 11px; display: flex; justify-content: center; align-items: center; letter-spacing: 0.5px; }
        .btn-blue { background-color: #007acc; color: white; } .btn-blue:hover { background-color: #005f9e; }
        .btn-orange { background-color: #ff9900; color: #111; } .btn-orange:hover { background-color: #e68a00; }
        .btn-red { background-color: #cc0000; color: white; } .btn-red:hover { background-color: #990000; }
        .btn-green { background-color: #27ae60; color: white; } .btn-green:hover { background-color: #1e8449; }
        .btn-purple { background-color: #8e44ad; color: white; } .btn-purple:hover { background-color: #732d91; }
        .btn-gray { background-color: #555; color: white; } .btn-gray:hover { background-color: #666; }
        button:disabled { opacity: 0.3; cursor: not-allowed; filter: grayscale(100%); pointer-events: none; }
        .downloads { display: flex; gap: 10px; flex-wrap: wrap; flex-shrink: 0; border-top: 1px dashed #333; padding-top: 10px; }
        .downloads a { background-color: #333; color: #ff9900; text-decoration: none; padding: 8px 12px; font-size: 11px; border-radius: 3px; border: 1px solid #555; transition: 0.2s; font-weight: bold; text-transform: uppercase; }
        .downloads a:hover { background-color: #444; border-color: #ff9900; }
        .hidden { display: none !important; }
        
        .viewer-controls, .viewer-info { position: absolute; top: 15px; background: rgba(25,25,25,0.9); padding: 15px; border-radius: 5px; border: 1px solid #444; z-index: 10; box-shadow: 0 4px 6px rgba(0,0,0,0.4); backdrop-filter: blur(4px); box-sizing: border-box; }
        .viewer-controls { left: 15px; min-width: 200px; max-height: calc(100vh - 280px); overflow-y: auto; }
        .viewer-info {
            right: 15px;
            width: 320px;
            min-width: 220px;
            min-height: 120px;
            max-width: none !important;
            max-height: none !important;
            resize: both !important;
            overflow: auto !important;
            direction: rtl;
            display: none;
            box-sizing: border-box;
        }

        .viewer-info > * {
            direction: ltr;
            text-align: left;
        }

        #live-gcode-terminal {
            background: #080a0e;
            border: 1px solid #222933;
            border-radius: 4px;
            padding: 6px;
            height: 165px;
            min-height: 80px;
            min-width: 180px;
            max-width: none !important;
            max-height: none !important;
            resize: both !important;
            overflow: auto !important;
            font-family: 'Consolas', 'Courier New', monospace;
            font-size: 11px;
            line-height: 1.5;
            color: #8899aa;
            box-shadow: inset 0 2px 8px rgba(0,0,0,0.85);
            user-select: text;
            box-sizing: border-box;
            direction: rtl;
        }

        #live-gcode-terminal > * {
            direction: ltr;
            text-align: left;
        }

        .live-gcode-line { padding: 1px 4px; border-radius: 2px; white-space: pre; font-size: inherit; font-family: 'Consolas', 'Courier New', monospace; cursor: pointer; transition: background 0.1s ease; }
        .live-gcode-line:hover { background: rgba(255,255,255,0.08); }
        .live-gcode-line.active { background: rgba(0, 229, 255, 0.22) !important; color: #00e5ff !important; font-weight: bold; border-left: 3px solid #00e5ff; }
        .live-gcode-line.rapid { color: #ff6b6b; }
        .live-gcode-line.feed { color: #69db7c; }
        .live-gcode-line.drill { color: #ffd43b; }
        .live-gcode-line.toolchange { color: #ff9900; font-weight: bold; background: rgba(255, 153, 0, 0.1); }
        .live-gcode-line.plunge { color: #fcc419; }
        .live-gcode-line.comment { color: #868e96; font-style: italic; }
        .viewer-controls h3, .viewer-info h3 { margin-top: 0; font-size: 12px; margin-bottom: 12px; text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid #555; padding-bottom: 5px; }
        .viewer-controls h3 { color: #ff9900; } .viewer-info h3 { color: #007acc; }

        /* 📟 WINDOW CONTROL BUTTONS (A+, A-, Maximize, Minimize) */
        .wc-win-btn, .wc-win-toggle-btn {
            background: #1c232d;
            color: #ff9900;
            border: 1px solid #455060;
            border-radius: 3px;
            padding: 1px 5px !important;
            margin: 0 !important;
            font-size: 11px !important;
            line-height: 18px !important;
            height: 20px !important;
            font-weight: bold;
            cursor: pointer;
            display: inline-flex !important;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            transition: all 0.15s ease;
            user-select: none;
        }
        .wc-win-btn:hover, .wc-win-toggle-btn:hover {
            background: #ff9900;
            color: #111;
            border-color: #ffaa22;
        }
        .wc-win-btn.btn-zoom {
            color: #00e5ff;
            font-family: 'Consolas', 'Courier New', monospace;
            font-size: 10.5px !important;
            min-width: 23px;
        }
        .wc-win-btn.btn-zoom:hover {
            background: #00e5ff;
            color: #0c0f14;
            border-color: #38bdf8;
        }
        .wc-win-btn.btn-max {
            font-size: 12px !important;
            width: 20px !important;
        }
        .wc-win-btn.btn-reset {
            color: #2ecc71;
            font-size: 12px !important;
            width: 20px !important;
        }
        .wc-win-btn.btn-reset:hover {
            background: #2ecc71;
            color: #0c0f14;
            border-color: #4ade80;
        }

        /* 📟 VIEW CONTROLS MAXIMIZED STATE (80% SCREEN) */
        .viewer-controls.wc-maximized {
            position: fixed !important;
            top: 10vh !important;
            left: 10vw !important;
            width: 80vw;
            height: 80vh;
            max-width: none !important;
            max-height: none !important;
            z-index: 100010 !important;
            display: flex !important;
            flex-direction: column !important;
            background: rgba(14, 18, 24, 0.98) !important;
            border: 2px solid #ff9900 !important;
            box-shadow: 0 16px 60px rgba(0, 0, 0, 0.9), 0 0 35px rgba(255, 153, 0, 0.25) !important;
            backdrop-filter: blur(12px) !important;
            border-radius: 8px !important;
            padding: 16px 20px !important;
            resize: both !important;
            overflow: auto !important;
        }

        #compare-controls:empty {
            display: none !important;
            height: 0 !important;
            margin: 0 !important;
            padding: 0 !important;
            border: none !important;
        }

        /* 📟 CNC CODE MONITOR EXPANDED / MAXIMIZED STATE (80% SCREEN) */
        .viewer-info.wc-maximized {
            position: fixed !important;
            top: 10vh !important;
            left: 10vw !important;
            width: 80vw;
            height: 80vh;
            max-width: none !important;
            max-height: none !important;
            z-index: 100010 !important;
            display: flex !important;
            flex-direction: column !important;
            background: rgba(14, 18, 24, 0.98) !important;
            border: 2px solid #00e5ff !important;
            box-shadow: 0 16px 60px rgba(0, 0, 0, 0.9), 0 0 35px rgba(0, 229, 255, 0.25) !important;
            backdrop-filter: blur(12px) !important;
            border-radius: 8px !important;
            padding: 16px 20px !important;
            resize: both !important;
            overflow: auto !important;
        }

        .viewer-info.wc-maximized #viewer-gcode-content {
            flex: 1 1 auto;
            min-height: 0;
            display: flex;
            flex-direction: column;
        }

        .viewer-info.wc-maximized #viewer-gcode-content[style*="display: none"] {
            display: none !important;
        }

        .viewer-info.wc-maximized #live-gcode-terminal {
            flex: 1 1 auto !important;
            height: auto !important;
            min-height: 250px !important;
            max-height: none !important;
        }

        .viewer-info.wc-maximized #viewer-report-content {
            flex: 1 1 auto;
            display: flex;
            flex-direction: column;
            min-height: 0;
        }

        .viewer-info.wc-maximized #viewer-report-content[style*="display: none"] {
            display: none !important;
        }

        .viewer-info.wc-maximized #viewer-report-body {
            flex: 1 1 auto !important;
            max-height: none !important;
            overflow-y: auto !important;
        }

        /* 📟 MINIMIZED STATE */
        .viewer-controls.wc-minimized, .viewer-info.wc-minimized {
            padding: 8px 12px !important;
            min-width: 190px !important;
            width: auto !important;
            max-height: 42px !important;
            overflow: hidden !important;
            resize: none !important;
        }
        .control-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 11px; color: #ddd; font-weight: bold; }
        .control-row input[type="range"] { width: 90px; margin: 0; }
        .stat-row { display: flex; justify-content: space-between; margin-bottom: 6px; border-bottom: 1px dotted #444; padding-bottom: 4px; align-items: center; font-size: 11px; }
        .stat-val { color: #fff; font-weight: bold; text-align: right; }
        #stat-measure { font-size: 12px; color: #ff4444; text-align: right; line-height: 1.4; max-height: 80px; overflow-y: auto; }
        
        .help-icon { display: inline-flex; justify-content: center; align-items: center; background: #262c35; color: #58a6ff; border: 1px solid #3d4754; width: 15px; height: 15px; border-radius: 50%; font-size: 10px; font-weight: bold; cursor: pointer; margin-left: 5px; flex-shrink: 0; transition: all 0.15s ease; vertical-align: middle; user-select: none; }
        .help-icon:hover { background: #ff9900; color: #000; border-color: #ffaa22; transform: scale(1.18); box-shadow: 0 0 8px rgba(255,153,0,0.7); }
        .info-tooltip { position: fixed; background: rgba(18, 22, 28, 0.98); color: #eee; padding: 10px 14px; border: 1px solid #ff9900; border-radius: 5px; font-size: 11px; max-width: 290px; z-index: 2000000 !important; pointer-events: none; box-shadow: 0 6px 16px rgba(0,0,0,0.65); line-height: 1.45; }
        .tooltip-title { color: #ff9900; font-weight: bold; margin-bottom: 4px; font-size: 11.5px; display: flex; align-items: center; gap: 5px; }
        .tooltip-hint { margin-top: 6px; padding-top: 5px; border-top: 1px dashed #3e4854; font-size: 10px; color: #58a6ff; font-weight: bold; display: flex; align-items: center; gap: 4px; }
        
        /* FEATURE KNOWLEDGE HUD MODAL */
        #feature-hud-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(8, 10, 14, 0.82); backdrop-filter: blur(6px); z-index: 100010 !important; display: flex; justify-content: center; align-items: center; padding: 20px; pointer-events: auto; }
        #feature-hud-modal.hidden { display: none !important; }
        .fhud-dialog { background: #16191f; border: 1px solid #ff9900; border-radius: 6px; width: 780px; max-width: 95vw; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 15px 50px rgba(0,0,0,0.9); overflow: hidden; animation: slide-in 0.25s ease-out; }
        .fhud-header { background: #1c212a; padding: 12px 18px; border-bottom: 1px solid #2d3542; display: flex; justify-content: space-between; align-items: center; }
        .fhud-body { padding: 18px; overflow-y: auto; flex: 1; line-height: 1.5; color: #d1d5db; }
        .fhud-footer { background: #191d24; padding: 12px 18px; border-top: 1px solid #2d3542; display: flex; justify-content: space-between; align-items: center; }
        .feature-pulse-glow { animation: pulseGlow 0.75s ease-in-out 3; outline: 2px solid #ff9900 !important; box-shadow: 0 0 15px #ff9900 !important; }
        @keyframes pulseGlow { 0% { transform: scale(1); } 50% { transform: scale(1.03); } 100% { transform: scale(1); } }

        /* 🪵 SPOILBOARD FULL BLUEPRINT & G-CODE STUDIO MODAL */
        #spoilboard-generator-modal {
            position: fixed !important;
            top: 0 !important;
            left: 0 !important;
            right: 0 !important;
            bottom: 0 !important;
            width: 100vw !important;
            height: 100vh !important;
            max-width: 100vw !important;
            max-height: 100vh !important;
            background: rgba(4, 7, 12, 0.94) !important;
            backdrop-filter: blur(8px) !important;
            z-index: 100000 !important;
            display: flex !important;
            justify-content: center !important;
            align-items: center !important;
            padding: 16px !important;
            box-sizing: border-box !important;
            pointer-events: auto !important;
        }
        #spoilboard-generator-modal.hidden {
            display: none !important;
        }
        #spoilboard-generator-modal .modal-content {
            width: 1140px !important;
            max-width: 96vw !important;
            height: calc(100vh - 32px) !important;
            max-height: calc(100vh - 32px) !important;
            display: flex !important;
            flex-direction: column !important;
            border: 2px solid #ff9900 !important;
            background: #12161f !important;
            box-shadow: 0 20px 60px rgba(0,0,0,0.95) !important;
            border-radius: 6px !important;
            overflow: hidden !important;
            position: relative !important;
            margin: 0 !important;
        }
        #spoilboard-generator-modal .modal-header {
            flex-shrink: 0 !important;
            background: #181d26 !important;
            padding: 10px 16px !important;
            border-bottom: 1px solid #ff9900 !important;
            display: flex !important;
            justify-content: space-between !important;
            align-items: center !important;
            height: 48px !important;
            box-sizing: border-box !important;
        }
        #spoilboard-generator-modal .modal-body {
            flex: 1 1 auto !important;
            min-height: 0 !important;
            overflow-y: auto !important;
            padding: 12px 14px !important;
            box-sizing: border-box !important;
        }
        #spoilboard-generator-modal .modal-footer {
            flex-shrink: 0 !important;
            background: #181d26 !important;
            padding: 8px 16px !important;
            border-top: 1px solid #2d3642 !important;
            display: flex !important;
            justify-content: space-between !important;
            align-items: center !important;
            height: 48px !important;
            box-sizing: border-box !important;
        }
        .spoil-floating-close-btn {
            position: fixed !important;
            top: 12px !important;
            right: 18px !important;
            z-index: 100005 !important;
            background: #e74c3c !important;
            color: #fff !important;
            width: 38px !important;
            height: 38px !important;
            border-radius: 50% !important;
            border: 2px solid #fff !important;
            font-size: 20px !important;
            font-weight: bold !important;
            cursor: pointer !important;
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
            box-shadow: 0 4px 18px rgba(0,0,0,0.85) !important;
            transition: transform 0.15s ease, background 0.15s ease !important;
        }
        .spoil-floating-close-btn:hover {
            background: #ff3333 !important;
            transform: scale(1.12) !important;
        }

        @keyframes stripe-slide { 0% { background-position: 0 0; } 100% { background-position: 40px 0; } }
        .progress-overlay { display: none; align-items: center; justify-content: center; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(15,15,15,0.85); z-index: 100; backdrop-filter: blur(3px); flex-direction: column; }
        .progress-bar-container { width: 50%; height: 14px; background: #222; border-radius: 7px; border: 1px solid #555; overflow: hidden; margin-top: 15px; box-shadow: inset 0 2px 4px rgba(0,0,0,0.5); }
        .progress-bar-fill { width: 100%; height: 100%; background: repeating-linear-gradient(45deg, #ff9900, #ff9900 20px, #cc7a00 20px, #cc7a00 40px); background-size: 40px 40px; animation: stripe-slide 1s linear infinite; }
        .progress-text { color: #ff9900; font-size: 16px; font-weight: bold; text-transform: uppercase; letter-spacing: 1.5px; }
        .progress-subtext { color: #aaa; font-size: 12px; margin-top: 10px; font-style: italic; }

        .modal-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; z-index: 9999; display: flex; justify-content: flex-end; align-items: flex-end; padding: 15px; }
        .modal-content { pointer-events: auto; background: rgba(25, 25, 25, 0.95); border: 1px solid #ff9900; border-radius: 5px; width: 380px; max-width: 90%; box-shadow: 0 10px 25px rgba(0,0,0,0.8); overflow: hidden; backdrop-filter: blur(5px); animation: slide-in 0.3s ease-out; }
        @keyframes slide-in { from { transform: translateY(50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
        .modal-header { background: #252526; padding: 12px 15px; font-weight: bold; font-size: 12px; border-bottom: 1px solid #444; color: #ff9900; text-transform: uppercase; letter-spacing: 1px; }
        .modal-body { padding: 15px; font-size: 11px; color: #ddd; line-height: 1.4; }
        .report-stats { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
        .stat-box { flex: 1 1 calc(50% - 8px); min-width: 80px; padding: 10px; text-align: center; border-radius: 4px; background: #111; border: 1px solid #333; box-sizing: border-box; }
        .stat-box.green { border-bottom: 3px solid #27ae60; } .stat-box.yellow { border-bottom: 3px solid #f1c40f; } .stat-box.red { border-bottom: 3px solid #e74c3c; } .stat-box.blue { border-bottom: 3px solid #007acc; } .stat-box.purple { border-bottom: 3px solid #8e44ad; }
        .stat-box b { font-size: 16px; color: #fff; display: block; margin-bottom: 3px; }
        .rep-conclusion { padding: 10px; border-radius: 4px; font-weight: bold; margin-bottom: 12px; font-size: 11px; }
        .rep-good { background: rgba(39, 174, 96, 0.1); border: 1px solid #27ae60; color: #27ae60; } .rep-warn { background: rgba(241, 196, 15, 0.1); border: 1px solid #f1c40f; color: #f1c40f; } .rep-bad { background: rgba(231, 76, 60, 0.1); border: 1px solid #e74c3c; color: #e74c3c; } .rep-info { background: rgba(142, 68, 173, 0.1); border: 1px solid #8e44ad; color: #c39bd3; }
        .color-key-list { list-style: none; padding: 0; margin: 0; } .color-key-list li { margin-bottom: 6px; }
        .modal-footer { padding: 10px 15px; border-top: 1px solid #333; background: #252526; display: flex; justify-content: flex-end; } .modal-footer button { width: auto; margin: 0; padding: 6px 15px; font-size: 10px; }

        .mold-card-container { display: flex; gap: 8px; margin-bottom: 15px; }
        .mold-card { flex: 1; border: 1px solid #444; background: #1e1e1e; text-align: center; padding: 10px 5px; cursor: pointer; border-radius: 4px; transition: 0.2s; user-select: none; }
        .mold-card:hover { border-color: #ff9900; background: #2a2a2a; }
        .mold-card.selected { border-color: #ff9900; background: rgba(255, 153, 0, 0.1); }
        .mold-card-icon { font-size: 24px; margin-bottom: 5px; display: block; }
        .mold-card-title { font-size: 10px; font-weight: bold; text-transform: uppercase; color: #ddd; display: block; line-height: 1.2; }

        /* Fusion 360 Inspect / Measure Palette */
        .measure-palette { position: absolute; top: 15px; right: 15px; width: 330px; background: rgba(22, 22, 24, 0.96); border: 1px solid #ff9900; border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,0.7); z-index: 25; backdrop-filter: blur(6px); font-family: 'Segoe UI', Tahoma, sans-serif; overflow: hidden; animation: slide-in 0.2s ease-out; }
        .measure-palette-header { background: #2a2a2c; padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #444; }
        .measure-palette-title { font-weight: bold; color: #ff9900; letter-spacing: 0.5px; font-size: 11px; text-transform: uppercase; display: flex; align-items: center; gap: 6px; }
        .btn-close-palette { background: none; border: none; color: #888; font-size: 14px; cursor: pointer; padding: 2px 6px; border-radius: 3px; line-height: 1; }
        .btn-close-palette:hover { color: #ff4444; background: rgba(255,255,255,0.1); }
        .measure-palette-body { padding: 12px 14px; max-height: calc(100vh - 280px); overflow-y: auto; }
        .snap-btn-group { display: flex; gap: 4px; margin-bottom: 8px; }
        .btn-snap { flex: 1; padding: 6px 2px; font-size: 10px; background: #2c2c2e; color: #bbb; border: 1px solid #444; border-radius: 3px; cursor: pointer; transition: 0.15s; font-weight: bold; text-align: center; }
        .btn-snap:hover { background: #3a3a3c; color: #fff; }
        .btn-snap.active { background: #007acc; color: #fff; border-color: #0099ff; box-shadow: 0 0 6px rgba(0,122,204,0.5); }
        .measure-toggle-row { display: flex; gap: 12px; margin-bottom: 10px; font-size: 10px; color: #aaa; align-items: center; }
        .measure-toggle-label { display: flex; align-items: center; gap: 4px; cursor: pointer; margin: 0; font-weight: normal; }
        .measure-selection-box { background: #161618; border: 1px solid #333; border-radius: 4px; padding: 7px 9px; margin-bottom: 6px; transition: 0.2s; }
        .measure-selection-box.active { border-color: #007acc; background: rgba(0,122,204,0.06); }
        .selection-badge { display: inline-block; padding: 2px 6px; border-radius: 3px; font-size: 9px; font-weight: bold; text-transform: uppercase; margin-bottom: 3px; letter-spacing: 0.5px; }
        .selection-badge.sel-1 { background: #27ae60; color: #fff; }
        .selection-badge.sel-2 { background: #e67e22; color: #fff; }
        .selection-coords { font-size: 11px; font-family: monospace; color: #eee; font-weight: bold; }
        .selection-meta { font-size: 10px; color: #888; margin-top: 2px; line-height: 1.3; }
        .measure-hero-result { background: linear-gradient(135deg, #16242c, #0e171c); border: 1px solid #00a8ff; border-radius: 5px; padding: 10px; text-align: center; margin-bottom: 8px; }
        .hero-label { display: block; font-size: 9px; color: #00a8ff; letter-spacing: 1px; font-weight: bold; text-transform: uppercase; margin-bottom: 2px; }
        .hero-val { font-size: 22px; font-weight: bold; color: #fff; font-family: monospace; text-shadow: 0 0 10px rgba(0,168,255,0.4); }
        .measure-grid-deltas { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin-bottom: 8px; }
        .delta-card { padding: 6px 4px; text-align: center; border-radius: 4px; background: #161618; border: 1px solid #333; }
        .delta-card.delta-x { border-bottom: 3px solid #ff4444; }
        .delta-card.delta-y { border-bottom: 3px solid #00e676; }
        .delta-card.delta-z { border-bottom: 3px solid #2979ff; }
        .delta-label { font-size: 9px; font-weight: bold; display: block; color: #aaa; margin-bottom: 2px; }
        .delta-val { font-size: 11px; font-weight: bold; color: #fff; font-family: monospace; }
        .measure-detail-list { background: #161618; border: 1px solid #333; border-radius: 4px; padding: 6px 9px; margin-bottom: 8px; }
        .detail-row { display: flex; justify-content: space-between; font-size: 10px; padding: 3px 0; border-bottom: 1px dotted #262628; align-items: center; }
        .detail-row:last-child { border-bottom: none; }
        .detail-row span { color: #888; }
        .detail-row b { color: #ddd; font-family: monospace; }

        /* Grid HUD & Controls */
        .grid-hud-indicator {
            position: absolute;
            bottom: 12px;
            left: 15px;
            background: rgba(20, 20, 24, 0.9);
            border: 1px solid #444;
            border-radius: 5px;
            padding: 5px 11px;
            font-size: 11px;
            font-family: 'Segoe UI', Tahoma, monospace;
            color: #ff9900;
            z-index: 10;
            pointer-events: none;
            display: flex;
            align-items: center;
            gap: 8px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.5);
            backdrop-filter: blur(4px);
            transition: opacity 0.2s;
        }
        .grid-controls-box {
            margin-top: 10px;
            margin-bottom: 8px;
            padding: 10px;
            background: #252528;
            border: 1px solid #3c3c40;
            border-radius: 4px;
        }

        /* Pre-flight & CAM Prep Styles */
        .prep-badge { display: inline-flex; align-items: center; justify-content: center; padding: 2px 7px; border-radius: 3px; font-weight: bold; font-size: 10px; font-family: monospace; }
        .prep-badge.pass { background: #1e8449; color: #fff; }
        .prep-badge.warn { background: #d35400; color: #fff; }
        .prep-badge.fail { background: #c0392b; color: #fff; }
        .prep-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
        .prep-stat-box { background: #1a1a1c; border: 1px solid #333; border-radius: 4px; padding: 6px 8px; font-size: 10px; }
        .prep-stat-box b { display: block; font-size: 12px; color: #ff9900; font-family: monospace; }
        .btn-mini { padding: 4px 6px; font-size: 9px; border-radius: 3px; font-weight: bold; cursor: pointer; text-transform: uppercase; border: none; }
        .btn-mini:hover { opacity: 0.9; }

        /* Aspire & Fusion 360 Unified CAM Studio Styles */
        .aspire-op-card {
            position: relative;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 6px 2px;
            background: linear-gradient(180deg, #272c36, #171b22);
            border: 1px solid #364050;
            border-radius: 4px;
            color: #e0e0e0;
            cursor: pointer;
            transition: all 0.15s ease;
            user-select: none;
            box-shadow: 0 1px 3px rgba(0,0,0,0.3);
        }
        .aspire-op-card .help-icon {
            position: absolute;
            top: 2px;
            right: 2px;
            width: 13px;
            height: 13px;
            font-size: 8px;
            line-height: 11px;
            margin: 0;
            z-index: 5;
            background: rgba(22, 27, 34, 0.92);
            border: 1px solid #00e5ff;
            color: #00e5ff;
        }
        .aspire-op-card .help-icon:hover {
            background: #00e5ff;
            color: #121212;
            transform: scale(1.2);
            box-shadow: 0 0 6px rgba(0, 229, 255, 0.8);
        }
        .aspire-op-card:hover {
            background: linear-gradient(180deg, #323b4a, #1d232e);
            border-color: #00e5ff;
            color: #fff;
            transform: translateY(-1px);
        }
        .aspire-op-card.active {
            background: linear-gradient(180deg, #16364a, #0b1f2b);
            border-color: #00e5ff;
            box-shadow: 0 0 8px rgba(0,229,255,0.45);
            color: #00e5ff;
        }
        .aspire-op-card .op-icon {
            font-size: 17px;
            margin-bottom: 2px;
            line-height: 1;
        }
        .aspire-op-card .op-label {
            font-size: 8.5px;
            font-weight: bold;
            letter-spacing: 0.3px;
            text-transform: uppercase;
            text-align: center;
        }
        .cam-setup-tree {
            background: #10141a;
            border: 1px solid #007acc;
            border-radius: 4px;
            padding: 6px;
            margin-bottom: 8px;
        }
        .cam-setup-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 4px 6px;
            background: #182230;
            border: 1px solid #007acc;
            border-radius: 3px;
            font-size: 10px;
            font-weight: bold;
            color: #4fc3f7;
            margin-bottom: 6px;
        }
        .cam-op-item {
            background: #181d24;
            border: 1px solid #2d3642;
            border-radius: 3px;
            padding: 5px 6px;
            margin-bottom: 4px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            transition: all 0.2s ease;
        }
        .cam-op-item:hover {
            border-color: #00e5ff;
        }   
        /* Photo to 3D Relief Generator */
        .sidebar-section {
            margin-bottom: 15px;
            background-color: #252526;
            padding: 12px;
            border-radius: 5px;
            border: 1px solid #333;
        }
        .sidebar-section h4 {
            margin: 0 0 10px 0;
            color: #ff9900;
            font-size: 11px;
            text-transform: uppercase;
            font-weight: bold;
            border-bottom: 1px solid #444;
            padding-bottom: 5px;
            letter-spacing: 0.5px;
        }
        .relief-generator-box .input-row,
        .text-to-svg-box .input-row,
        .svg-extrusion-box .input-row {
            display: flex;
            gap: 10px;
            margin-bottom: 8px;
        }
        .relief-generator-box .input-row label,
        .text-to-svg-box .input-row label,
        .svg-extrusion-box .input-row label {
            flex: 1;
            display: flex;
            flex-direction: column;
            font-size: 11px;
            color: #ccc;
            font-weight: bold;
            margin-bottom: 0;
        }
        .relief-generator-box .input-row input.num-input,
        .text-to-svg-box .input-row input.num-input,
        .svg-extrusion-box .input-row input.num-input {
            margin-top: 4px;
            margin-bottom: 0;
            width: 100%;
        }
        .action-button {
            background-color: #ff9900;
            color: #111;
            font-weight: bold;
            cursor: pointer;
            border: none;
            border-radius: 3px;
            padding: 10px;
            width: 100%;
            text-transform: uppercase;
            font-size: 11px;
            display: flex;
            justify-content: center;
            align-items: center;
            letter-spacing: 0.5px;
            transition: 0.2s;
        }
        .action-button:hover {
            background-color: #e68a00;
        }
        .action-button:disabled {
            opacity: 0.3;
            cursor: not-allowed;
            filter: grayscale(100%);
            pointer-events: none;
        }

        /* 📷 RELIEF & LASER PRE-CARVE INSPECTOR MODAL */
        #relief-preview-modal {
            position: fixed !important;
            top: 0 !important;
            left: 0 !important;
            right: 0 !important;
            bottom: 0 !important;
            display: flex !important;
            justify-content: center !important;
            align-items: center !important;
            padding: 16px !important;
            box-sizing: border-box !important;
            pointer-events: auto !important;
            background: rgba(0, 0, 0, 0.82) !important;
            backdrop-filter: blur(5px) !important;
            z-index: 10000 !important;
        }
        #relief-preview-modal.hidden {
            display: none !important;
        }
        #relief-preview-modal .modal-content {
            width: 1120px !important;
            max-width: 95vw !important;
            max-height: 94vh !important;
            display: flex !important;
            flex-direction: column !important;
            border: 2px solid #00e5ff !important;
            background: #12161f !important;
            box-shadow: 0 20px 60px rgba(0,0,0,0.95) !important;
            border-radius: 8px !important;
            overflow: hidden !important;
            position: relative !important;
            margin: 0 !important;
            transition: width 0.2s ease, height 0.2s ease, max-height 0.2s ease;
        }
        #relief-preview-modal.maximized .modal-content {
            width: 98vw !important;
            max-width: 98vw !important;
            height: 96vh !important;
            max-height: 96vh !important;
        }
        #relief-preview-modal #relief-canvas-container {
            width: 100% !important;
            height: 540px !important;
            background: #090b0e !important;
            border: 1px solid #2d3642 !important;
            border-radius: 6px !important;
            position: relative !important;
            overflow: hidden !important;
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
            cursor: grab;
            user-select: none;
        }
        #relief-preview-modal #relief-canvas-container:active {
            cursor: grabbing;
        }
        #relief-preview-modal.maximized #relief-canvas-container {
            height: calc(96vh - 210px) !important;
            min-height: 480px !important;
        }

        /* V3 Smart CAM Wizard Styles */
        .wizard-intent-card {
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            user-select: none;
        }
        .wizard-intent-card:hover {
            border-color: #00e5ff !important;
            background: rgba(0, 229, 255, 0.08) !important;
        }
        .wizard-intent-card.active {
            border-color: #00e5ff !important;
            background: rgba(0, 229, 255, 0.15) !important;
            box-shadow: 0 0 10px rgba(0, 229, 255, 0.25);
        }
