/* 3MF Drag & Drop Upload Styles */

body { 
    font-family: sans-serif; 
    padding: 2rem; 
    background: #f9f9f9; 
}

h1 { 
    font-size: 1.5rem; 
}

#dropZone {
    border: 2px dashed #ccc;
    padding: 2rem;
    text-align: center;
    margin-top: 1rem;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    color: #666;
}

#dropZone.hover {
    background: #eef;
    border-color: #339;
}

#output, .data-block { 
    padding: 20px;
    background: #fff; 
    border-radius: 8px; 
    border: 1px solid #ccc; 
    display: flex;
    gap: 20px;
    align-items: stretch;
    margin: 0px 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.swatch { 
    display: inline-block; 
    width: 16px; 
    height: 16px; 
    border-radius: 3px; 
    margin-right: 0.5rem; 
    vertical-align: middle; 
    border: 1px solid #999; 
}

img.thumb { 
    width: 256px; 
    height: 256px; 
    display: block; 
    object-fit: contain; 
    margin-bottom: 1rem; 
}

.modelName { 
    font-weight: bold; 
    margin-top: 1rem; 
}



.button-group {
    display: flex;
    gap: 1rem;
}

.button-group button {
    padding: 0.5rem 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
}

.button-group button:hover {
    background: #f0f0f0;
}

#resetBtn {
    background: #ff6b6b;
    color: white;
    border-color: #ff5252;
    width: 100%;
}

#resetBtn:hover {
    background: #ff5252;
}

#exportXmlBtn {
    background: #4caf50;
    color: white;
    border-color: #45a049;
}

#exportXmlBtn:hover {
    background: #45a049;
}

/* Curve Editor Styles */
.curve-editor-container {
    display: flex;
    gap: 20px;
    align-items: stretch;
}

.curve-editor-left {
    width: 50%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.curve-editor-left .curve-editor-container {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.curve-editor-right {
    width: 50%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.curve-editor-container h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.segment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.segment-header h3 {
    margin: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.individual-curves-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #666;
    font-weight: normal;
}

.curve-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.curve-presets {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 120px;
}
.auto-preset-btn,
.preset-btn {
    padding: 0.4rem 0.8rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    width: 100%;
    text-align: left;
}
.auto-preset-btn:hover,
.preset-btn:hover {
    background: #f0f0f0;
}

.auto-preset-btn.active,
.preset-btn.active {
    background: #007bff;
    color: white;
    border-color: #0056b3;
}


.curve-segment-controls label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 14px;
    color: #666;
}

.resolution-control {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.resolution-control label {
    font-size: 14px;
    color: #495057;
    font-weight: 500;
}

#resolutionSlider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #dee2e6;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

#resolutionSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

#resolutionSlider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

#resolutionValue {
    font-weight: 600;
    color: #007bff;
}



.segment-selector {
    margin-bottom: 1rem;
    pointer-events: none;
}

.segment-selector > * {
    pointer-events: auto;
}

.segment-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
    list-style: none;
    padding: 0;
    width: 100%;
}

.segment-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
    color: #666;
    position: relative;
}

.segment-item:hover {
    border-color: #007bff;
    background: #f8f9fa;
}

.segment-item.active {
    border-color: #007bff;
    background: #e3f2fd;
    color: #007bff;
    font-weight: 600;
}

.segment-thumbnail {
    width: 60px;
    height: 30px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background: linear-gradient(to right, #ccc, #ccc);
}

.segment-thumbnail.global-thumbnail {
    background: linear-gradient(to right, #ff0000, #00ff00, #0000ff);
}

.segment-resolution-slider {
    width: 100%;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.resolution-label {
    font-size: 11px;
    color: #495057;
    font-weight: 500;
    text-align: center;
    margin: 0;
}

.segment-resolution-slider input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #dee2e6;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.segment-resolution-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.segment-resolution-slider input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}



.curve-editor {
    position: relative;
    display: inline-block;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: white;
    width: 100%;
    max-width: 300px;
    height: auto;
    aspect-ratio: 1 / 1;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .curve-editor-left .curve-editor-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .curve-presets {
        flex-direction: row;
        flex-wrap: wrap;
        min-width: 100%;
    }
    
    .preset-btn {
        flex: 1;
        min-width: calc(50% - 4px);
        text-align: center;
    }
    
    .curve-editor {
        max-width: 250px;
    }
}

@media (max-width: 480px) {
    .curve-editor {
        max-width: 200px;
    }
    
    .preset-btn {
        min-width: calc(100% - 4px);
    }
}

#curveCanvas {
    display: block;
    cursor: crosshair;
    width: 100%;
    height: 100%;
}

.curve-points {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.curve-point {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #007bff;
    border: 2px solid white;
    border-radius: 50%;
    cursor: move;
    pointer-events: all;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transform: translate(-50%, -50%);
}

.curve-point:hover {
    background: #0056b3;
    transform: translate(-50%, -50%) scale(1.2);
}

.curve-point:active {
    background: #004085;
}

#gradientBar {
    position: relative;
    height: 100px;
    border-radius: 8px;
    background: linear-gradient(to right, #ffffff, #ffd00b);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    left: calc(0 - 8px);
}

.stop {
    position: absolute;
    top: 4px;
    width: 16px;
    height: 88px;
    border: 1px solid #003344;
    border-radius: 8px;
    background-color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateX(-50%);
}

.stop.fixed {
    cursor: default;
}

.stop.fixed-left {
    left: calc(0% + 14px) !important;
}

.stop.fixed-right {
    left: calc(100% - 14px) !important;
}

.stop.fixed { 
    cursor: default; 
}

.stop .remove {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #f00;
    color: white;
    font-size: 10px;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    text-align: center;
    line-height: 14px;
    display: none;
}

.stop:hover .remove { 
    display: block; 
}

.colorPickerRow {
    position: absolute;
    top: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translateX(-50%);
    z-index: 10;
}

.positionLabel {
    font-size: 12px;
    background: #fff;
    color: #111;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    pointer-events: none;
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
}

.colorThumbnails {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.colorThumbnail {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 1px #333;
    cursor: pointer;
}

/* Model Preview Container */
.model-preview-container {
    display: flex;
    gap: 20px;
    padding: 20px;
    align-items: stretch;
}

.model-thumbnail {
    width: 50%;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.model-info-sidebar {
    width: 50%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 200px;
}

/* Combined dropzone and output container */
.dropzone-output-container {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 20px;
    background: #f8f9fa;
    min-height: 200px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.dropzone-output-container.has-content {
    background: #ffffff;
    border-color: #007bff;
}

.dropzone-output-container .dropzone-text {
    text-align: center;
    color: #666;
    font-size: 16px;
}

.dropzone-output-container .thumbnail-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.dropzone-output-container .output-section {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    border-radius: 4px;
    color: #666;
    font-size: 14px;
}

.dropzone-output-container.hover {
    border-color: #007bff;
    background: #e3f2fd;
}

/* Gradient Layout Styles */
.gradient-main-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.gradient-sidebar {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Halftone Preview Section */
.halftone-preview-section {
    margin: 20px 20px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #ccc;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Gradient Bar Section */
.gradient-bar-section {
    margin: 0px 20px 20px 20px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #ccc;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Export Section */
.export-section {
    margin: 20px 20px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #ccc;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.export-section button {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.export-section button:hover {
    background: #45a049;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Halftone Preview Styles */
.halftonepreview {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100px;
}

#preview {
    width: 100%;
    height: 100px;
    border: 1px solid #ccc;
    display: flex;
    flex-direction: row;
    overflow: hidden;
}

.info-card,
.plate-info-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.plate-info{
    display: flex;
    flex-direction: column;
    height: 100%;
}

.info-card.layer-height-card {
    flex: 0 0 auto;
    height: 40px;
}

.info-card.dynamic-card,
.plate-info.dynamic-card {
    flex: 1 1 0;
}

.info-card h4, .plate-info-item h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}



.layer-info {
    font-size: 16px;
    font-weight: 500;
    color: #007bff;
    flex: 1;
    display: flex;
}

.palette-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    justify-content: center;
}

.palette-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.palette-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.palette-card-header h4 {
    margin-bottom: 0;
}

.palette-edit-btn {
    border: 1px solid #007bff;
    background: #fff;
    color: #007bff;
    border-radius: 6px;
    font-size: 11px;
    line-height: 1;
    padding: 6px 10px;
    cursor: pointer;
}

.palette-edit-btn:hover {
    background: #007bff;
    color: #fff;
}

.palette-btn-group {
    display: flex;
    gap: 6px;
}

.color-themer-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.color-themer-form .filament-field {
    flex: 1 1 calc(50% - 5px);
    min-width: 140px;
}

.color-themer-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    min-height: 60px;
}

.color-themer-swatch {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    border: 1px solid #ddd;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    position: relative;
}

.color-themer-swatch-label {
    font-size: 8px;
    color: #fff;
    text-shadow: 0 0 3px rgba(0,0,0,0.8);
    padding: 2px;
    text-align: center;
}

.color-themer-empty {
    color: #999;
    font-size: 12px;
    padding: 16px 0;
}

.palette-toggle {
    margin: 0;
    cursor: pointer;
}

.palette-toggle:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.palette-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid #ccc;
}

.material-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid #999;
    flex-shrink: 0;
}

.palette-material {
    font-size: 10px;
    color: #666;
    font-style: italic;
    margin-left: 4px;
}

.filament-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filament-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.filament-lightbox-dialog {
    position: relative;
    background: #fff;
    width: min(920px, 92vw);
    max-height: 86vh;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.filament-lightbox-header,
.filament-lightbox-footer {
    padding: 14px 18px;
    border-bottom: 1px solid #e5e5e5;
}

.filament-lightbox-footer {
    border-bottom: none;
    border-top: 1px solid #e5e5e5;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.filament-lightbox-header h3 {
    margin: 0;
    font-size: 18px;
}

.filament-lightbox-body {
    padding: 16px 18px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.filament-editor-status {
    border: 1px solid #f2d38b;
    background: #fff9e8;
    color: #7a5a00;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 12px;
}

.filament-editor-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filament-editor-row {
    display: grid;
    grid-template-columns: 32px 1fr 90px 70px;
    gap: 10px;
    align-items: center;
    border: 1px solid #e4e4e4;
    border-radius: 8px;
    padding: 8px 10px;
}

.filament-editor-swatch {
    width: 20px;
    height: 20px;
    border: 1px solid #bbb;
    border-radius: 50%;
}

.filament-editor-inline {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.filament-editor-inline select {
    min-width: 110px;
    border: 1px solid #d5d5d5;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 12px;
}

.filament-editor-inline input[type="color"] {
    width: 52px;
    height: 30px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    background: #fff;
    padding: 2px;
}

.filament-settings-preview {
    font-size: 11px;
    color: #666;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filament-material-pill {
    display: inline-block;
    border: 1px solid #cfcfcf;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 11px;
    color: #555;
    text-align: center;
}

.filament-delete-btn {
    border: 1px solid #dc3545;
    background: #fff;
    color: #dc3545;
    border-radius: 6px;
    font-size: 12px;
    padding: 6px 10px;
    cursor: pointer;
}

.filament-delete-btn:hover {
    background: #dc3545;
    color: #fff;
}

.filament-add-section {
    border: 1px solid #ececec;
    border-radius: 8px;
    padding: 12px;
    background: #fafafa;
}

.filament-add-section h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
}

.filament-add-grid {
    display: grid;
    grid-template-columns: 1fr 130px 180px 120px;
    gap: 10px;
    margin-bottom: 10px;
}

.filament-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
}

.filament-field input[type="text"],
.filament-field input[type="color"],
.filament-field select {
    border: 1px solid #d5d5d5;
    border-radius: 6px;
    padding: 7px 8px;
    font-size: 12px;
    background: #fff;
}

.filament-field input[type="color"] {
    height: 36px;
    padding: 2px;
}

.filament-settings-preview-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

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

.filament-add-btn,
.filament-save-btn,
.filament-cancel-btn {
    border: 1px solid #007bff;
    background: #007bff;
    color: #fff;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
}

.filament-cancel-btn {
    border-color: #6c757d;
    background: #fff;
    color: #6c757d;
}

.filament-cancel-btn:hover {
    background: #6c757d;
    color: #fff;
}

.filament-save-btn:disabled,
.filament-add-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.plates-content {
    font-size: 12px;
    line-height: 1.4;
    color: #666;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: 100%;
}

.cross-plate-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 12px;
    color: #333;
    cursor: pointer;
}

.cross-plate-toggle input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.cross-plate-source {
    margin-bottom: 10px;
    font-size: 11px;
    color: #555;
}

.cross-plate-source-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.cross-plate-source-row .cross-plate-source {
    margin-bottom: 0;
}

.cross-plate-source-btn,
.cross-plate-inline-btn {
    border: 1px solid #cfcfcf;
    border-radius: 6px;
    background: #fff;
    color: #333;
    font-size: 11px;
    line-height: 1.2;
    padding: 4px 8px;
    cursor: pointer;
}

.cross-plate-source-btn:hover:not(:disabled),
.cross-plate-inline-btn:hover {
    background: #f2f2f2;
}

.cross-plate-source-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cross-plate-inline-btn {
    margin-top: 6px;
}

.cross-plate-include-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 11px;
    color: #444;
    cursor: pointer;
}

.cross-plate-include-label input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.plates-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: 100%;
    height: 100%;
}

.plate-info-item {
    cursor: pointer;
    transition: all 0.2s ease;
}

.plate-info-item:hover {
    background: #f0f0f0;
    transform: translateY(-1px);
}

.plate-info-item.active {
    background: #007bff;
    color: white;
    border-color: #0056b3;
}

.plate-info-item.active h4 {
    color: white;
}

.plate-info-item div {
    margin-bottom: 2px;
}

.plate-info-item div:last-child {
    margin-bottom: 0;
}

.cross-plate-badge {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(0, 123, 255, 0.12);
    color: #0056b3;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.plate-info-item.active .cross-plate-badge {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.cross-plate-offsets {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    width: 100%;
}

.cross-plate-offsets .offset-field {
    flex: 1;
    min-width: 0;
}

.cross-plate-offsets .offset-field label {
    display: block;
    font-size: 9px;
    color: #888;
    margin-bottom: 2px;
    line-height: 1;
}

.plate-info-item.active .cross-plate-offsets .offset-field label {
    color: rgba(255, 255, 255, 0.7);
}

.cross-plate-offsets .offset-input-wrap {
    display: flex;
    align-items: center;
    gap: 2px;
}

.cross-plate-offsets input[type="number"] {
    width: 100%;
    padding: 2px 4px;
    font-size: 11px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    text-align: right;
    -moz-appearance: textfield;
}

.cross-plate-offsets input[type="number"]::-webkit-inner-spin-button,
.cross-plate-offsets input[type="number"]::-webkit-outer-spin-button {
    opacity: 1;
    height: 18px;
}

.plate-info-item.active .cross-plate-offsets input[type="number"] {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

.cross-plate-offsets .offset-unit {
    font-size: 9px;
    color: #999;
    flex-shrink: 0;
}

.plate-info-item.active .cross-plate-offsets .offset-unit {
    color: rgba(255, 255, 255, 0.6);
}

.cross-plate-net-height {
    font-size: 10px;
    color: #888;
    margin-top: 2px;
}

.plate-info-item.active .cross-plate-net-height {
    color: rgba(255, 255, 255, 0.7);
}

.cross-plate-summary {
    margin-top: 10px;
    padding: 8px 10px;
    background: #f5f5f5;
    border-radius: 6px;
    font-size: 11px;
    color: #555;
}

.bar {
    height: 100%;
    flex-shrink: 0;
}

/* Debug Section */
.debug-section {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.debug-section h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
}

#debugJsonOutput {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

#debugJsonBtn {
    margin-left: 10px;
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

#debugJsonBtn:hover:not(:disabled) {
    background: #5a6268;
    transform: translateY(-1px);
}

#debugJsonBtn:disabled {
    cursor: not-allowed;
    background: #6c757d;
    opacity: 0.5;
}

.debug-test-scenarios {
    margin-bottom: 12px;
}

.debug-test-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.debug-test-buttons button {
    border: 1px solid #cfcfcf;
    background: #fff;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 12px;
}

.debug-test-buttons button:hover {
    background: #f5f5f5;
}

/* Plugin Controls */
.plugin-controls {
    display: flex;
    gap: 16px;
    margin-top: 15px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    align-items: center;
    flex-wrap: wrap;
}

.plugin-dropdown-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.plugin-dropdown-group label {
    font-size: 12px;
    font-weight: 600;
    color: #444;
    white-space: nowrap;
}

.plugin-dropdown-group select {
    font-size: 12px;
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    color: #333;
    cursor: pointer;
    min-width: 140px;
}

.plugin-dropdown-group select:hover {
    border-color: #999;
}

.plugin-dropdown-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.15);
}

/* Perception Controls (legacy) */
.perception-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.perception-label,
.feathering-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #333;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 8px;
}

.perception-label input[type="checkbox"],
.feathering-label input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.perception-label:hover,
.feathering-label:hover {
    color: #007bff;
}

/* New Layer-Based Track UI */
.preview-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 0 20px 10px 20px;
}

.preview-modes {
    display: flex;
    gap: 8px;
}

.preview-mode-btn {
    border: 1px solid #ccc;
    background: #fff;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
}

.preview-mode-btn.active {
    background: #007bff;
    color: #fff;
    border-color: #0056b3;
}

.alpha-tracks-section {
    margin: 20px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 16px;
}

.alpha-track-card {
    border: 1px solid #e4e4e4;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    cursor: grab;
}

.alpha-track-card.dragging {
    opacity: 0.65;
}

.alpha-track-card.drag-over {
    border-color: #1e90ff;
    box-shadow: 0 0 0 2px rgba(30, 144, 255, 0.15);
}

.alpha-track-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.alpha-track-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}

.alpha-track-drag-handle {
    border: 1px solid #d8d8d8;
    background: #fff;
    border-radius: 6px;
    cursor: grab;
    padding: 4px 8px;
    font-size: 16px;
    line-height: 1;
}

.alpha-track-drag-handle:active {
    cursor: grabbing;
}

.alpha-track-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
}

.alpha-track-swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid #999;
}

.alpha-track-bar {
    position: relative;
    height: 30px;
    border: 1px solid #d7d7d7;
    border-radius: 8px;
    background-color: #f3f3f3;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    overflow: visible;
}

.alpha-stop-pin {
    position: absolute;
    top: -10px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.35);
    transform: translateX(-50%);
    cursor: grab;
}

.alpha-stop-pin:active {
    cursor: grabbing;
}

.alpha-stop-pin.active {
    outline: 2px solid #1e90ff;
    outline-offset: 1px;
}

.alpha-stop-list {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.alpha-stop-row {
    display: grid;
    grid-template-columns: 90px 150px 120px 70px;
    gap: 8px;
    align-items: center;
    border-radius: 8px;
    padding: 4px;
}

.alpha-stop-row.active {
    background: #eaf3ff;
}

.alpha-stop-row input {
    border: 1px solid #d8d8d8;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 13px;
}

.alpha-stop-layer {
    background: #f2f2f2;
    border-radius: 6px;
    padding: 7px 8px;
    font-size: 13px;
}

.alpha-stop-color {
    background: #f2f2f2;
    border-radius: 6px;
    padding: 7px 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alpha-stop-color-swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid #999;
}

.alpha-stop-delete {
    border: 1px solid #d8d8d8;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    padding: 6px 8px;
}

.alpha-stop-add {
    border: 1px solid #d8d8d8;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    padding: 5px 10px;
    font-size: 18px;
    line-height: 1;
}

.alpha-stop-add:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.alpha-track-note {
    font-size: 12px;
    color: #666;
}

 