        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: #fafafa;
            height: 100vh;
            overflow: hidden;
        }

        .app {
            display: flex;
            height: 100vh;
        }

        .sidebar {
            width: 280px;
            background: white;
            border-right: 1px solid #e0e0e0;
            display: flex;
            flex-direction: column;
        }

        .toolbar {
            padding: 16px;
            border-bottom: 1px solid #e0e0e0;
        }

        .toolbar h1 {
            font-size: 16px;
            font-weight: 600;
            color: #333;
            margin-bottom: 16px;
        }

        .file-upload-btn {
            width: 100%;
            padding: 10px;
            background: #2196f3;
            color: white;
            border: none;
            border-radius: 3px;
            cursor: pointer;
            font-size: 13px;
            font-weight: 500;
            transition: background 0.2s;
        }

        .file-upload-btn:hover {
            background: #1976d2;
        }

        input[type="file"] {
            display: none;
        }

        .tool-section {
            padding: 16px;
            border-bottom: 1px solid #e0e0e0;
        }

        .section-label {
            font-size: 11px;
            font-weight: 600;
            color: #999;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 12px;
        }

        .tool-grid {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            gap: 8px;
        }

        .tool-btn {
            aspect-ratio: 1;
            background: white;
            border: 2px solid #e0e0e0;
            border-radius: 3px;
            cursor: pointer;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 4px;
            transition: all 0.2s;
            padding: 8px;
        }

        .tool-btn:hover {
            border-color: #2196f3;
            background: #f5f5f5;
        }

        .tool-btn.active {
            background: #2196f3;
            border-color: #2196f3;
            color: white;
        }

        .tool-icon {
            font-size: 20px;
            line-height: 1;
        }

        .tool-label {
            font-size: 9px;
            font-weight: 500;
            text-align: center;
            line-height: 1.2;
        }

        .settings {
            padding: 16px;
            border-bottom: 1px solid #e0e0e0;
        }

        .setting-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 12px;
        }

        .setting-row:last-child {
            margin-bottom: 0;
        }

        .setting-label {
            font-size: 12px;
            color: #666;
        }

        .setting-input {
            width: 60px;
            padding: 4px 8px;
            border: 1px solid #e0e0e0;
            border-radius: 3px;
            font-size: 12px;
            text-align: center;
        }

        .measurements-panel {
            flex: 1;
            overflow-y: auto;
            padding: 16px;
        }

        .measurement-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px;
            margin-bottom: 6px;
            background: #f9f9f9;
            border-radius: 3px;
            font-size: 12px;
        }

        .measurement-item.base {
            background: #ffebee;
        }

        .measurement-value {
            font-weight: 600;
            font-family: 'Courier New', monospace;
            font-size: 13px;
        }

        .measurement-delete {
            padding: 2px 6px;
            background: none;
            border: none;
            color: #999;
            cursor: pointer;
            font-size: 16px;
            line-height: 1;
        }

        .measurement-delete:hover {
            color: #f44336;
        }

        .actions {
            padding: 16px;
            border-top: 1px solid #e0e0e0;
            display: flex;
            gap: 8px;
        }

        .action-btn {
            flex: 1;
            padding: 8px;
            border: none;
            border-radius: 3px;
            font-size: 12px;
            font-weight: 500;
            cursor: pointer;
            transition: background 0.2s;
        }

        .action-btn.undo {
            background: #f5f5f5;
            color: #666;
        }

        .action-btn.undo:hover:not(:disabled) {
            background: #e0e0e0;
        }

        .action-btn.clear {
            background: #f5f5f5;
            color: #f44336;
        }

        .action-btn.clear:hover:not(:disabled) {
            background: #ffebee;
        }

        .action-btn:disabled {
            opacity: 0.3;
            cursor: not-allowed;
        }

        .canvas-area {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .status-bar {
            padding: 8px 16px;
            background: white;
            border-bottom: 1px solid #e0e0e0;
            font-size: 12px;
            color: #666;
        }

        .canvas-container {
            flex: 1;
            overflow: auto;
            background: #f5f5f5;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        canvas {
            display: block;
            cursor: crosshair;
            max-width: 100%;
            max-height: 100%;
        }

        .empty-state {
            text-align: center;
            color: #999;
            font-size: 12px;
            padding: 20px;
        }
