@CHARSET "US-ASCII";

/* PropertiesManager-generated fields */
.pm-field {
    /*background-color: #dbeafe;
    border-radius: 4px;
    padding: 2px 6px;
    */
}

/* PropertiesManager radio-grid layout */
.pm-radio-grid { max-width: 150px; margin: 0 auto; }
.pm-radio-cell {
    aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
    border: 1px solid #dee2e6; background-color: #f8f9fa; border-radius: 4px;
    padding: 8px; min-height: 30px; cursor: pointer;
}
.pm-radio-cell:hover { background-color: #e9ecef; }
.pm-radio-cell:has(.form-check-input:checked) { background-color: #cfe2ff; border-color: #0d6efd; }
.pm-radio-cell .form-check-input { margin: 0; transform: scale(0.8); }

/* ============================================================================
   COLOR PALETTE - CSS Variables
   ============================================================================
   All colors used throughout the application's CSS styles
*/

:root {
    /* Bootstrap-like Grays */
    --color-gray-100d: #f8f9fa;      /* Lightest gray - backgrounds */
    --color-gray-100: #eee;      /* Lightest gray - backgrounds */
    --color-gray-200: #e9ecef;      /* Light gray - table headers, borders */
    --color-gray-300: #dee2e6;      /* Medium-light gray - borders */
    --color-gray-400: #ccc;         /* Medium gray - borders, inputs */
    --color-gray-500: #6c757d;      /* Medium-dark gray - text muted */
    --color-gray-600: #495057;      /* Dark gray - text */
    --color-gray-700: #e0e0e0;      /* Button hover */
    --color-gray-800: #f0f0f0;      /* Button background */

    /* Primary/Accent Colors */
    --color-primary: #0d6efd;       /* Bootstrap primary blue */
    --color-primary-light: #e3f2fd; /* Light blue - selected backgrounds */
    --color-primary-medium: #2196f3; /* Medium blue - selected borders */
    --color-primary-dark: #1976d2;  /* Dark blue - selected text */
    --color-icon-blue: #3D85C6;     /* Sidebar icon color */

    /* SVG Path Colors */
    --color-path-selected: #0080ff; /* Selected path stroke */
    --color-path-tool: #ff80ff;     /* Toolpath stroke */

    /* Focus/Input Colors */
    --color-focus-border: #86b7fe;  /* Input focus border */
    --color-focus-shadow: rgba(13, 110, 253, 0.25); /* Input focus shadow */
}

/* Bootstrap-style collapse chevron rotation */
[data-bs-toggle="collapse"] .collapse-chevron {
    transition: transform 0.2s ease-in-out;
    transform: rotate(-90deg);
}

[data-bs-toggle="collapse"][aria-expanded="true"] .collapse-chevron {
    transform: rotate(0deg);
}

html, body {
    height: 100%;
    
}

.bg-light{
    background-color: var(--color-gray-100) !important;
}
.navbar{
    background-color: var(--color-gray-300) !important;
}

#layout {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.canvas-overlay-controls {
    position: absolute;
    right: 16px;
    top: 16px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.canvas-minimap-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 10px 10px 12px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(0, 0, 0, 0.16);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(4px);
}

.floating-properties-popup {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1055;
}

.floating-properties-window {
    position: absolute;
    top: 96px;
    left: 300px;
    width: min(360px, calc(100vw - 24px));
    max-height: calc(100vh - 128px);
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 10px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.2);
    overflow: hidden;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(6px);
}

.floating-properties-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    background: linear-gradient(180deg, rgba(248, 249, 250, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
    cursor: move;
    user-select: none;
}

.floating-properties-header-main {
    min-width: 0;
    flex: 1 1 auto;
    max-width: calc(100% - 28px);
}

.floating-properties-popup-title {
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.1;
    margin: 0;
    color: var(--color-gray-600);
}

.floating-properties-popup-subtitle {
    display: block;
    margin-top: 1px;
    font-size: 10px;
    line-height: 1.1;
}

.floating-properties-body {
    overflow: auto;
    min-height: 0;
    font-size: 11px;
    padding: 0 12px 12px;
}

.floating-properties-footer {
    display: none;
    padding: 10px 12px 12px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 -8px 18px rgba(15, 23, 42, 0.06);
}

.floating-properties-footer.is-visible {
    display: block;
}

.floating-properties-footer .mb-3,
.floating-properties-footer .mb-3:last-child {
    margin-bottom: 0 !important;
}

.floating-properties-body .form-group,
.floating-properties-body .mb-3,
.floating-properties-body .mt-4,
.floating-properties-body .mb-2 {
    margin-bottom: 0.45rem !important;
}

.floating-properties-body .form-group:last-child,
.floating-properties-body .mb-3:last-child,
.floating-properties-body .mt-4:last-child,
.floating-properties-body .mb-2:last-child {
    margin-bottom: 0 !important;
}

.floating-properties-body label,
.floating-properties-body .form-label,
.floating-properties-body .control-label,
.floating-properties-body .input-group-text,
.floating-properties-body .btn,
.floating-properties-body .form-control,
.floating-properties-body .form-select,
.floating-properties-body select,
.floating-properties-body input,
.floating-properties-body textarea,
.floating-properties-body small,
.floating-properties-body .small,
.floating-properties-body .text-muted,
.floating-properties-body h6 {
    font-size: 11px;
}

.floating-properties-body .form-control,
.floating-properties-body .form-select,
.floating-properties-body select,
.floating-properties-body input,
.floating-properties-body textarea {
    min-height: 28px;
    padding: 3px 6px;
    border-radius: 5px;
}

.floating-properties-body input[type="checkbox"],
.floating-properties-body input[type="radio"] {
    min-height: auto;
    padding: 0;
}

.floating-properties-body .btn {
    padding: 3px 6px;
}

.floating-properties-body h6 {
    margin-bottom: 0.2rem !important;
    font-weight: 600;
    line-height: 1.1;
}

.floating-properties-body #tool-help-content,
.floating-properties-body #operation-help-content,
.floating-properties-body .small.text-muted {
    font-size: 10px !important;
    line-height: 1.2;
    margin-bottom: 0 !important;
}

.floating-properties-body .mt-4 {
    margin-top: 0.35rem !important;
}

.floating-properties-content {
    display: none;
    padding: 8px !important;
}

.floating-properties-content.is-active {
    display: block !important;
}

.floating-properties-dragging,
.floating-properties-dragging * {
    cursor: move !important;
    user-select: none !important;
}

.canvas-minimap {
    width: 180px;
    height: 120px;
    display: block;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    box-shadow: none;
    cursor: grab;
    touch-action: none;
}

.canvas-minimap.dragging {
    cursor: grabbing;
}

.canvas-unit-toggle {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px;
    background: rgba(248, 249, 250, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 999px;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.65);
}

.canvas-unit-toggle-button {
    border: 0;
    background: transparent;
    color: rgba(33, 37, 41, 0.72);
    border-radius: 999px;
    font-size: 11px;
    line-height: 1;
    padding: 5px 10px;
    min-width: 44px;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.canvas-unit-toggle-button:hover {
    color: rgba(33, 37, 41, 0.92);
}

.canvas-unit-toggle-button:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.2);
}

.canvas-unit-toggle-button.is-active,
.canvas-unit-toggle-button[aria-pressed="true"] {
    background: rgba(13, 110, 253, 0.12);
    color: #0d6efd;
    font-weight: 600;
}

.selectedPath {
    stroke: var(--color-path-selected) !important;
    fill: none !important;
}

.toolPath {
	fill: none !important;
    stroke: var(--color-path-tool) !important;
}


#status {
    font-size: 16px;
    color: var(--color-gray-500);
}


.sidebar-section {
    border-bottom: 1px solid var(--color-gray-300);
    margin-bottom: 10px;
}

.sidebar-section-header {
    background-color: var(--color-gray-200);
    padding: 8px 12px;
    font-weight: 600;
    font-size: 14px;
    color: var(--color-gray-600);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-item {
    padding: 6px 12px;
    cursor: pointer;
    font-size: 13px;
    color: var(--color-gray-600);
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    position: relative;
    gap: 8px;
}

.sidebar-item-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.sidebar-item-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(61, 133, 198, 0.25);
    border-top-color: var(--color-icon-blue);
    border-radius: 50%;
    flex: 0 0 16px;
    animation: sidebar-spin 0.8s linear infinite;
}

@keyframes sidebar-spin {
    to {
        transform: rotate(360deg);
    }
}

#sidebar.is-icon-only {
    min-width: 0 !important;
}

#sidebar.is-icon-only .nav-link,
#sidebar.is-icon-only .sidebar-item,
#sidebar.is-icon-only .sidebar-object-header,
#sidebar.is-tabs-icon-only .nav-link {
    padding-left: 10px;
    padding-right: 10px;
}

#sidebar.is-icon-only .nav-link,
#sidebar.is-tabs-icon-only .nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

#sidebar.is-icon-only .nav-link .lucide,
#sidebar.is-icon-only .sidebar-item .lucide,
#sidebar.is-icon-only .sidebar-object-header .lucide,
#sidebar.is-tabs-icon-only .nav-link .lucide {
    margin-right: 0;
}

#sidebar.is-icon-only .nav-link span,
#sidebar.is-icon-only .sidebar-item > span,
#sidebar.is-icon-only .sidebar-item-body,
#sidebar.is-icon-only .sidebar-item > :not(.lucide),
#sidebar.is-icon-only .sidebar-object-chevron,
#sidebar.is-icon-only .sidebar-visibility-toggle,
#sidebar.is-icon-only .sidebar-object-actions,
#sidebar.is-icon-only .sidebar-section-header .collapse-chevron,
#sidebar.is-icon-only [data-shape-tools-toggle],
#sidebar.is-icon-only [data-modify-tools-toggle],
#sidebar.is-icon-only [data-shape-tools-toggle] > span span,
#sidebar.is-icon-only [data-modify-tools-toggle] > span span,
#sidebar.is-tabs-icon-only #sidebar-tabs .nav-link span {
    display: none !important;
}

#sidebar.is-icon-only .sidebar-item,
#sidebar.is-icon-only .sidebar-object-header {
    justify-content: center;
    min-height: 40px;
    gap: 0;
}

#sidebar.is-icon-only .sidebar-item[data-shape-operation],
#sidebar.is-icon-only .sidebar-item[data-modify-operation] {
    margin-left: 0 !important;
}

#sidebar.is-icon-only [data-shape-tools-group],
#sidebar.is-icon-only [data-modify-tools-group] {
    position: relative;
    margin-bottom: 10px;
    padding-bottom: 10px;
}

#sidebar.is-icon-only [data-shape-tools-group]::after,
#sidebar.is-icon-only [data-modify-tools-group]::after {
    content: '';
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 0;
    border-bottom: 2px solid var(--color-gray-500);
    opacity: 0.9;
}

#sidebar.is-icon-only .sidebar-tab-content {
    overflow-x: hidden;
}

.sidebar-item-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.sidebar-item-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.sidebar-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 11px;
    color: var(--color-gray-500);
}

.sidebar-item-meta-tag,
.sidebar-item-meta-chip {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    border-radius: 999px;
    background-color: rgba(15, 23, 42, 0.06);
}

.sidebar-item-meta-index {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--color-gray-600);
    letter-spacing: 0.01em;
}

.sidebar-item-meta-tag {
    font-weight: 600;
    color: var(--color-gray-600);
}

.sidebar-item-meta-chip {
    background-color: rgba(13, 110, 253, 0.08);
    color: var(--color-primary-dark);
}

.sidebar-item.is-hidden {
    opacity: 0.6;
}

.sidebar-object-group {
    margin-bottom: 12px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.72);
    overflow: hidden;
}

.sidebar-object-header {
    padding-top: 0;
    padding-bottom: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(248, 249, 250, 0.94) 100%);
    border-left-width: 4px;
}

.sidebar-object-header-main {
    min-width: 0;
    flex: 1;
}

.sidebar-object-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    color: var(--color-gray-500);
    flex-shrink: 0;
}

.sidebar-object-chevron:hover {
    background-color: rgba(15, 23, 42, 0.06);
    color: var(--color-gray-600);
}

.sidebar-object-children {
    background-color: rgba(248, 249, 250, 0.55);
}

.sidebar-toolpath-item {
    padding-top: 0;
    padding-bottom: 0;
}

.sidebar-toolpath-item .lucide {
    color: var(--color-primary-medium);
}

.sidebar-tree-leaf {
    border-left-width: 2px;
}

.sidebar-orphan-header {
    background-color: rgba(255, 248, 235, 0.82);
}

/* Touch "more" button - only shown on touch devices */
@media (pointer: coarse) {
    .sidebar-item[data-path-id]::after,
    .sidebar-item[data-svg-group-header]::after,
    .sidebar-item[data-text-group-header]::after,
    .sidebar-item.fw-bold::after {
        content: '⋮';
        position: absolute;
        right: 8px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 18px;
        font-weight: bold;
        color: var(--color-gray-500);
        padding: 4px 8px;
        line-height: 1;
    }
}

.sidebar-item:hover {
    background-color: var(--color-gray-100);
    border-left-color: var(--color-gray-500);
}

.sidebar-item.selected {
    background-color: var(--color-primary-light);
    border-left-color: var(--color-primary-medium);
    color: var(--color-primary-dark);
}

.sidebar-item .lucide {
    margin-right: 8px;

    color: var(--color-icon-blue);
}


.tool-controls {
    margin-bottom: 20px;
}

#tool-panel,
#workpiece-panel {
    flex: 1;
    min-height: 0;
}

.workpiece-panel-content {
    max-width: 720px;
}

.tool-table {
    font-size: 12px;
}

.tool-table th {
    background-color: var(--color-gray-200);
    font-weight: 600;
    padding: 8px 6px;
    border: 1px solid var(--color-gray-300);
    font-size: 14px;
}

.tool-table th [data-lucide] {
    margin-right: 6px;
}

.tool-table td {
    padding: 6px;
    border: 1px solid var(--color-gray-300);
    vertical-align: middle;
}

.tool-table th [data-lucide="triangle"] {
    transform: rotate(180deg);
}

.tool-table .color-cell {
    width: 30px;
    height: 24px;
    border-radius: 3px;
    cursor: pointer;
}

.tool-table input[type="text"],
.tool-table input[type="number"],
.tool-table select {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 12px;
    padding: 2px 4px;
}

.tool-table input[type="text"]:focus,
.tool-table input[type="number"]:focus,
.tool-table select:focus {
    background-color: var(--color-gray-100);
    border: 1px solid var(--color-focus-border);
    outline: none;
    box-shadow: 0 0 0 0.25rem var(--color-focus-shadow);
}

.tool-table tr.selected {
    background-color: var(--color-primary-light);
}

.tool-angle-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tool-angle-actions input {
    flex: 1;
}

.tool-row-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 2px 6px;
}

.tool-row-delete .lucide {
    width: 14px;
    height: 14px;
}


.app-menu-bar {
    display: flex;
    align-items: stretch;
    min-height: 100%;
    padding: 0;
    gap: 0;
    background: linear-gradient(180deg, #f6f6f7 0%, #ececef 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    user-select: none;
}

.app-menu-group {
    display: flex;
    align-items: stretch;
}

.app-menu-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 64px;
    height: 100%;
    padding: 0 12px;
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--color-gray-600);
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    box-shadow: none !important;
}

.app-menu-trigger::after {
    display: none;
}

.app-menu-trigger:hover,
.app-menu-trigger:focus,
.app-menu-group.show .app-menu-trigger {
    background-color: rgba(255, 255, 255, 0.85);
    color: #1f2328;
}

.app-menu-trigger:focus-visible {
    outline: 2px solid rgba(13, 110, 253, 0.3);
    outline-offset: -2px;
}

.app-menu-dropdown {
    min-width: 220px;
    margin-top: 2px;
    padding: 6px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    background-color: rgba(252, 252, 253, 0.96);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(10px);
}

.app-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 34px;
    padding: 7px 10px;
    border-radius: 7px;
    color: var(--color-gray-600);
    font-size: 13px;
}

.app-menu-item:hover,
.app-menu-item:focus {
    background-color: var(--color-primary-light);
    color: var(--color-primary-dark);
}

.app-menu-item .lucide,
.app-menu-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.app-menu-shortcut {
    margin-left: auto;
    color: var(--color-gray-500);
    font-size: 11px;
    letter-spacing: 0.02em;
}

@media (max-width: 900px) {
    .app-menu-trigger {
        min-width: 0;
        padding: 0 10px;
        font-size: 12px;
    }

    .app-menu-dropdown {
        min-width: 200px;
    }
}

.lucide {
    width:30px;
    height: 30px;
}

.app-menu-item .lucide {
    width: 16px;
    height: 16px;
}


.modal-header {
    background-color: var(--color-gray-100);
    border-bottom: 1px solid var(--color-gray-300);
}


.options-table th {
    background-color: var(--color-gray-200);
    font-weight: 600;
    padding: 12px;
}

.options-table td {
    padding: 12px;
    vertical-align: middle;
}

.options-table input[type="checkbox"] {
    transform: scale(1.2);
}

.options-table input[type="number"] {
    width: 80px;
}


#textDialog input,
#textDialog select,
#textDialog button {
    font-family: Arial, sans-serif;
    padding: 5px;
    border: 1px solid var(--color-gray-400);
    border-radius: 3px;
}

#textDialog button {
    background: var(--color-gray-800);
    cursor: pointer;
    padding: 5px 15px;
}

#textDialog button:hover {
    background: var(--color-gray-700);
}

#textDialog label {
    font-family: Arial, sans-serif;
    font-size: 14px;
}


.text-muted-sm {
    color: var(--color-gray-500);
    font-size: 0.875rem;
}

/* Canvas Tab Styles (2D, 3D, Tools) - folder tab style */
.canvas-container {
    position: relative;
}

.canvas-tab-header {
    position: absolute !important;
    top: 10px;
    left: 10px;
    z-index: 35;
    gap: 6px;
    background: transparent;
    border-bottom: 0;
}

.canvas-tab-content {
    height: 100%;
}

#canvasTabs .nav-link {
    color: var(--color-gray-500);
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px !important;
}

#canvasTabs .nav-link:hover:not(.active) {
    color: var(--color-gray-700);
    background-color: rgba(255, 255, 255, 0.92);
    border-color: rgba(0, 0, 0, 0.08);
}

#canvasTabs .nav-link.active {
    color: var(--color-primary-dark) !important;
    background-color: rgba(255, 255, 255, 0.96) !important;
    font-weight: 700;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    border-color: rgba(0, 0, 0, 0.1);
}

#canvasTabs .nav-item {
    pointer-events: auto;
}

#canvasTabs .canvas-view-toggle {
    min-width: 0;
    font-size: 0.75rem;
    line-height: 1.1;
    letter-spacing: 0.02em;
}

.canvas-object-tree {
    position: absolute;
    top: 48px;
    left: 12px;
    z-index: 34;
    max-width: 210px;
    max-height: calc(100% - 72px);
    pointer-events: none;
}

.canvas-object-tree-panel {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    max-height: 100%;
    overflow: hidden;
}

.canvas-object-tree-content {
    overflow-y: auto;
    max-height: calc(100vh - 150px);
    padding: 6px 0;
}

.canvas-object-tree .sidebar-item {
    color: rgba(15, 23, 42, 0.78);
    font-size: 11px;
}

.canvas-object-tree .sidebar-item .lucide {
    margin-right: 6px;
}

.canvas-object-tree .sidebar-item-title,
.canvas-object-tree .sidebar-item-meta {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.canvas-object-tree .sidebar-item:hover {
    background-color: rgba(255, 255, 255, 0.18);
    border-left-color: rgba(59, 130, 246, 0.48);
}

.canvas-object-tree .sidebar-item.selected {
    background-color: rgba(59, 130, 246, 0.16);
    border-left-color: rgba(37, 99, 235, 0.76);
    color: rgba(15, 23, 42, 0.96);
}

.canvas-object-tree .sidebar-item-title-row {
    gap: 0;
}

.canvas-object-tree .sidebar-item-body {
    min-width: 0;
}

.canvas-object-tree .sidebar-object-actions {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: 8px;
    flex-shrink: 0;
}

.canvas-object-tree .sidebar-visibility-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: rgba(15, 23, 42, 0.34);
    opacity: 0.58;
    transition: opacity 120ms ease, color 120ms ease, background-color 120ms ease;
    flex-shrink: 0;
}

.canvas-object-tree .sidebar-visibility-toggle .lucide {
    width: 12px;
    height: 12px;
    margin-right: 0;
    stroke-width: 2.1;
    color: currentColor;
}

.canvas-object-tree .sidebar-item:hover .sidebar-visibility-toggle,
.canvas-object-tree .sidebar-item.selected .sidebar-visibility-toggle,
.canvas-object-tree .sidebar-item.is-hidden .sidebar-visibility-toggle {
    opacity: 0.86;
}

.canvas-object-tree .sidebar-visibility-toggle:hover {
    color: rgba(15, 23, 42, 0.62);
    background-color: rgba(255, 255, 255, 0.42);
}

.canvas-object-tree .sidebar-item.is-hidden .sidebar-visibility-toggle {
    color: rgba(15, 23, 42, 0.46);
}

.canvas-object-tree .sidebar-item-meta {
    color: rgba(71, 85, 105, 0.88);
    font-size: 10px;
    flex-wrap: nowrap;
}

.canvas-object-tree .sidebar-item-meta-tag,
.canvas-object-tree .sidebar-item-meta-chip,
.canvas-object-tree .sidebar-item-meta-index {
    border: none;
}

.canvas-object-tree .sidebar-item-meta-index {
    color: rgba(15, 23, 42, 0.86);
}

.canvas-object-tree .sidebar-item-meta-tag {
    background-color: transparent;
    color: rgba(15, 23, 42, 0.76);
}

.canvas-object-tree .sidebar-item-meta-chip {
    background-color: transparent;
    color: rgba(30, 41, 59, 0.80);
}

.canvas-object-tree .sidebar-object-group {
    margin-bottom: 10px;
    border: none;
    background-color: transparent;
    box-shadow: none;
}

.canvas-object-tree .sidebar-object-header {
    background: transparent;
}

.canvas-object-tree .sidebar-object-children {
    background-color: transparent;
}

.canvas-object-tree .sidebar-toolpath-item .lucide,
.canvas-object-tree .sidebar-object-header .lucide {
    color: rgba(37, 99, 235, 0.72);
}

.canvas-object-tree .sidebar-visibility-toggle .lucide,
.canvas-object-tree .sidebar-item.is-hidden .sidebar-visibility-toggle .lucide {
    color: currentColor;
}

@media (max-width: 900px) {
    .canvas-object-tree {
        top: 44px;
        max-width: 210px;
        max-height: calc(100% - 60px);
    }

    .canvas-object-tree-content {
        max-height: calc(100vh - 132px);
    }
}

.reorder-operations-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.reorder-operation-item {
    display: flex;
    align-items: stretch;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
    cursor: grab;
    user-select: none;
    transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.reorder-operation-item:hover {
    border-color: rgba(37, 99, 235, 0.28);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.reorder-operation-item.is-dragging {
    opacity: 0.6;
    transform: scale(0.99);
    cursor: grabbing;
}

.reorder-operation-item.is-drop-target {
    border-color: rgba(37, 99, 235, 0.54);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.reorder-operation-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    color: rgba(71, 85, 105, 0.72);
    flex-shrink: 0;
}

.reorder-operation-handle .lucide {
    width: 18px;
    height: 18px;
}

.reorder-operation-body {
    min-width: 0;
    flex: 1;
}

.reorder-operation-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.reorder-operation-position {
    font-size: 12px;
    font-weight: 700;
    color: rgba(15, 23, 42, 0.82);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.reorder-operation-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    color: rgba(15, 23, 42, 0.94);
}

.reorder-operation-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.reorder-operation-type,
.reorder-operation-chip {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 11px;
}

.reorder-operation-type {
    background-color: rgba(15, 23, 42, 0.08);
    color: rgba(15, 23, 42, 0.76);
    font-weight: 700;
}

.reorder-operation-chip {
    background-color: rgba(37, 99, 235, 0.10);
    color: rgba(29, 78, 216, 0.88);
}

/* Tabbed Sidebar Styles */
#sidebar-tabs {
    background-color: var(--color-gray-100);
    border-bottom: 1px solid var(--color-gray-300);
    padding: 0;
    display: flex;
}

#sidebar-tabs .nav-link {
    border: none;
    background: none;
    color: var(--color-gray-500);
    font-size: 13px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 0;
    flex: 1 1 50%;
    width: 50%;
}

#sidebar-tabs .nav-link:hover {
    background-color: var(--color-gray-200);
    color: var(--color-gray-600);
}

#sidebar-tabs .nav-link.active {
    background-color: var(--color-gray-100);
    color: var(--color-gray-600);
    border-bottom: 2px solid var(--color-primary);
}

#sidebar-tabs .nav-link i {
    width: 16px;
    height: 16px;
}

/* Properties Editor Styles - default to hidden */
#tool-properties-editor,
#operation-properties-editor {
    background-color: var(--color-gray-100);
}

#tool-properties-editor .bg-light,
#operation-properties-editor .bg-light {
    background-color: var(--color-gray-100) !important;
}

/* Help System Styles */
.help-step {
    background-color: var(--color-gray-100);
    border: 1px solid var(--color-gray-200);
    border-radius: 6px;
}

.help-text {
    color: var(--color-gray-600);
    line-height: 1.4;
}

.help-navigation {
    margin-top: 8px;
}

.help-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.help-navigation .help-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    min-height: 22px;
    padding: 0;
    font-size: 10px;
    border-radius: 4px;
    flex: 0 0 22px;
}

.help-navigation .help-nav-btn .lucide {
    width: 12px;
    height: 12px;
}

.help-navigation .help-navigation-text {
    flex: 1 1 auto;
    min-width: 0;
}

/* Step progress bar */
.progress {
    height: 4px !important;
    background-color: var(--color-gray-200);
}

.progress-bar {
    background-color: var(--color-primary);
}

/* Alert styles for properties */
.alert {
    padding: 8px 12px;
    margin-bottom: 12px;
    font-size: 13px;
}

.alert i {
    width: 14px;
    height: 14px;
    margin-right: 6px;
}

/* Form range customization */
.form-range {
    margin-bottom: 8px;
}

/* Tab content height management - ONLY for canvas tabs, not sidebar */
#canvasTabContent {
    overflow-y: auto;
    flex-grow: 1;
    min-height: 0;
}

/* Sidebar tab content styling */
.sidebar-tab-content {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* Canvas tab panes only - sidebar tab panes should NOT have flex layout */
#canvasTabContent .tab-pane {
    min-height: 0;
    height: 100%;
    display: none !important;
    flex-direction: column;
}

/* Canvas tab panes when active - show as flex */
#canvasTabContent .tab-pane.active {
    display: flex !important;
}

/* Canvas views should appear immediately so overlays/spinners stay visible. */
#canvasTabContent .tab-pane.fade {
    transition: none;
}

#canvasTabContent .tab-pane.fade:not(.show) {
    opacity: 1;
}

/* Generic fallback for other tab-panes */
.tab-pane {
    min-height: 0;
    display: none;
}

/* Only show active tab-pane (for sidebar tabs) */
.sidebar-tab-content .tab-pane.active {
    display: block;
}

#3d-view {
    padding-bottom: 0;
}

#3d-canvas-container {
    flex: 1;
    min-height: 0;
    width: 100%;
    height: 100%;
}

.three-loading-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(248, 249, 250, 0.88);
    backdrop-filter: blur(2px);
    z-index: 1100;
}

.three-loading-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--color-gray-300);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.three-loading-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(61, 133, 198, 0.2);
    border-top-color: var(--color-icon-blue);
    border-radius: 50%;
    animation: sidebar-spin 0.8s linear infinite;
    flex: 0 0 22px;
}

.three-loading-message {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-gray-700);
}

#simulation-overlay-3d:not(.d-none) ~ #3d-canvas-container,
#3d-view:has(#simulation-overlay-3d:not(.d-none)) #3d-canvas-container {
    height: calc(100% - var(--simulation-overlay-height, 0px));
}

.version{
    padding-right:10px;
}

/* Simulation Controls Floating Overlay */
.simulation-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 12px 15px;
    z-index: 1000;
    box-sizing: border-box;
    overflow: visible;
}

.simulation-overlay.d-none {
    display: none !important;
}

/* G-code Viewer Styles */
#gcode-viewer {
    background-color: white;
    border-left: 1px solid var(--color-gray-300);
}

#gcode-viewer-container {
    background-color: #f5f5f5;
    padding: 0;
    margin: 0;
}

.gcode-viewport { overflow-y: auto; height: 100%; position: relative; }
.gcode-content  { position: relative; }
.gcode-lines-container { position: absolute; left: 0; right: 0; }

.gcode-line {
    position: absolute; left: 0; right: 0;
    padding: 2px 8px;
    border-left: 3px solid transparent;
    user-select: text;
    overflow: hidden; white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.1s ease-in-out;
}

.gcode-line:hover {
    background-color: #e8f4f8;
    cursor: pointer;
    border-left-color: var(--color-gray-400);
}

.gcode-line-number {
    color: var(--color-gray-500);
    font-weight: 600;
    user-select: none;
}

.gcode-line-code {
    color: var(--color-gray-600);
    white-space: pre-wrap;
    word-break: break-all;
}

.gcode-line.active-gcode-line {
    background-color: #72abec;
}

.gcode-line.active-gcode-line .gcode-line-number {
    color: #000;
    font-weight: 700;
}

.gcode-line.active-gcode-line .gcode-line-code {
    color: #333;
    font-weight: 500;
}

#snap-toggle-btn:hover #snap-icon {
    stroke: white !important;
}
#snap-toggle-btn:hover  {
    color: white !important;
}
