/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-feature-settings: 'tnum' 1;
    background: #f5f5f5;
    color: #333;
    overflow: hidden;
    height: 100vh;
    overscroll-behavior: none;
    -webkit-touch-callout: none;
}

#app {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Toolbar */
#toolbar {
    background: #2c3e50;
    color: white;
    padding: 8px 16px;
    display: flex;
    gap: 24px;
    border-bottom: 1px solid #34495e;
    user-select: none;
}

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

.tool-btn {
    background: transparent;
    border: 1px solid #34495e;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-btn:hover {
    background: rgba(52, 73, 94, 0.5);
}

.tool-btn.active {
    background: #3498db;
    border-color: #2980b9;
}

.tool-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.toolbar-separator {
    width: 1px;
    height: 24px;
    background: #34495e;
    margin: 0 4px;
}

.toolbar-spacer {
    flex: 1;
}

/* Project name in toolbar */
#project-name-wrapper {
    display: flex;
    align-items: center;
    max-width: 300px;
}

#project-name {
    color: #bdc3c7;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
    outline: none;
    transition: background 0.15s, color 0.15s;
}

#project-name:hover {
    background: rgba(52, 73, 94, 0.5);
    color: #ecf0f1;
}

#project-name[contenteditable="true"] {
    background: #34495e;
    color: white;
    border: 1px solid #3498db;
    cursor: text;
}

#project-name.has-changes::after {
    content: ' *';
}

/* Main layout */
#main-layout {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Panels */
#left-panel, #right-panel {
    background: #2c3e50;
    color: white;
    width: 280px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #34495e;
}

#right-panel {
    border-right: none;
    border-left: 1px solid #34495e;
}

.panel-header {
    background: #34495e;
    padding: 12px 16px;
    font-weight: 600;
    border-bottom: 1px solid #2c3e50;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.panel-header-text {
    flex: 1;
}
.panel-header-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.25);
    color: #ecf0f1;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: background 0.15s, border-color 0.15s;
}
.panel-header-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.4);
}

.panel-header-toggle:hover {
    background: #3d566e;
}

#object-list-arrow {
    font-size: 10px;
    display: inline-block;
    margin-right: 4px;
}

/* Object Library */
#object-library {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.category {
    margin-bottom: 4px;
}

.category-header {
    padding: 8px 14px;
    background: rgba(52, 73, 94, 0.4);
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #ecf0f1;
    transition: background 0.2s;
}

.category-header:hover {
    background: rgba(52, 73, 94, 0.65);
}

.category-header .arrow {
    font-size: 10px;
    opacity: 0.6;
    transition: transform 0.2s;
}

.category.collapsed .arrow {
    transform: rotate(-90deg);
}

.category-objects {
    display: block;
}

.category.collapsed .category-objects {
    display: none;
}

.object-item {
    padding: 4px 14px 4px 28px;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.15s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12.5px;
    color: #b0bec5;
}

.object-item:hover {
    background: rgba(52, 152, 219, 0.15);
    border-left-color: #3498db;
    color: #ecf0f1;
}

.object-dimensions {
    font-size: 11px;
    color: #7f8c8d;
}

.object-delete-btn {
    display: none;
    margin-left: 4px;
    padding: 0 5px;
    font-size: 14px;
    font-weight: bold;
    color: #e74c3c;
    opacity: 0.5;
    cursor: pointer;
    border-radius: 3px;
    line-height: 1;
    flex-shrink: 0;
}

.object-item:hover .object-delete-btn {
    display: inline-block;
}

.object-delete-btn:hover {
    opacity: 1;
    background: rgba(231, 76, 60, 0.15);
}

.object-item-confirming {
    background: rgba(231, 76, 60, 0.1);
    border-left-color: #e74c3c;
}

.object-delete-question {
    font-size: 12px;
    color: #e74c3c;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.object-delete-yes,
.object-delete-no {
    cursor: pointer;
    padding: 2px 8px;
    font-size: 14px;
    font-weight: bold;
    border-radius: 3px;
    margin-left: 4px;
    flex-shrink: 0;
}

.object-delete-yes {
    color: #e74c3c;
}

.object-delete-yes:hover {
    background: rgba(231, 76, 60, 0.2);
}

.object-delete-no {
    color: #7f8c8d;
}

.object-delete-no:hover {
    background: rgba(127, 140, 141, 0.2);
}

/* Property Panel */
#property-panel {
    padding: 16px;
    flex: 1;
    overflow-y: auto;
}

.property-empty {
    color: #7f8c8d;
    font-style: italic;
    text-align: center;
    margin-top: 32px;
}

.property-group {
    margin-bottom: 16px;
}

.property-label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #ecf0f1;
}

.property-field {
    margin-bottom: 8px;
}

.property-field label {
    display: block;
    font-size: 12px;
    color: #bdc3c7;
    margin-bottom: 4px;
}

.property-field .property-value {
    display: block;
    padding: 6px 8px;
    font-size: 13px;
    color: #ecf0f1;
}

.property-field input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #34495e;
    border-radius: 3px;
    background: #34495e;
    color: white;
    font-size: 13px;
}

.property-field input:focus {
    outline: none;
    border-color: #3498db;
    background: #2c3e50;
}

.color-field-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.color-field-wrap input[type="color"] {
    flex: 1;
    height: 30px;
    padding: 2px;
    cursor: pointer;
}

.color-field-wrap input[type="color"]:disabled {
    opacity: 0.35;
    cursor: default;
}

.color-field-wrap input[type="checkbox"] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
}

.prop-button {
    padding: 5px 10px;
    border: 1px solid #34495e;
    border-radius: 3px;
    background: #34495e;
    color: white;
    font-size: 12px;
    cursor: pointer;
    flex: 1;
}
.prop-button:hover {
    background: #3d566e;
    border-color: #3498db;
}
.prop-button.active {
    background: #2980b9;
    border-color: #3498db;
    color: #fff;
}

.property-row {
    display: flex;
    gap: 8px;
}

.property-row .property-field {
    flex: 1;
}

/* Object List */
#object-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.object-list-item {
    padding: 8px 16px;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.object-list-item:hover {
    background: rgba(52, 152, 219, 0.2);
}

.object-list-item.selected {
    background: rgba(52, 152, 219, 0.3);
    border-left-color: #3498db;
}

.object-list-name {
    font-weight: 500;
}

.object-list-type {
    font-size: 11px;
    opacity: 0.7;
}

/* Center Canvas */
#center-panel {
    flex: 1;
    background: #ecf0f1;
    display: flex;
    flex-direction: column;
    position: relative;
}

#canvas-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #ffffff;
}

#main-canvas {
    cursor: crosshair;
    position: absolute;
    top: 0;
    left: 0;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

/* Floor Tabs */
#floor-tabs {
    height: 30px;
    flex-shrink: 0;
    background: #34495e;
    border-top: 1px solid #2c3e50;
    display: flex;
    align-items: stretch;
    user-select: none;
    overflow-x: auto;
    overflow-y: hidden;
}

.floor-tabs-wrapper {
    display: flex;
    align-items: stretch;
}

.floor-tab {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 12px;
    color: #bdc3c7;
    font-size: 12px;
    cursor: pointer;
    border-right: 1px solid #2c3e50;
    white-space: nowrap;
    transition: background 0.15s;
}

.floor-tab:hover {
    background: rgba(52, 152, 219, 0.15);
    color: #ecf0f1;
}

.floor-tab.active {
    background: #2c3e50;
    color: #ecf0f1;
    font-weight: 600;
    border-bottom: 2px solid #3498db;
}

.floor-tab-label {
    outline: none;
    min-width: 20px;
}

.floor-tab-label[contenteditable="true"] {
    background: #2c3e50;
    padding: 1px 4px;
    border-radius: 2px;
    border: 1px solid #3498db;
}

.floor-tab-close {
    font-size: 14px;
    line-height: 1;
    opacity: 0.4;
    cursor: pointer;
    padding: 0 2px;
}

.floor-tab-close:hover {
    opacity: 1;
    color: #e74c3c;
}

.floor-tab.dragging {
    opacity: 0.3;
}

.floor-tab.drop-before {
    box-shadow: inset 2px 0 0 #3498db;
}

.floor-tab.drop-after {
    box-shadow: inset -2px 0 0 #3498db;
}

.floor-tab.drag-ghost {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.85;
    background: #2c3e50;
    border: 1px solid #3498db;
    border-radius: 3px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.floor-tab-add {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    color: #7f8c8d;
    font-size: 18px;
    cursor: pointer;
    transition: color 0.15s;
}

.floor-tab-add:hover {
    color: #ecf0f1;
    background: rgba(52, 152, 219, 0.15);
}

/* Status Bar */
#status-bar {
    background: #34495e;
    color: white;
    padding: 6px 16px;
    display: flex;
    gap: 24px;
    align-items: center;
    font-size: 12px;
    border-top: 1px solid #2c3e50;
}

#status-position,
#status-zoom,
#status-grid {
    min-width: 140px;
    font-variant-numeric: tabular-nums;
}

#status-info {
    margin-left: auto;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-overlay.hidden {
    display: none;
}

.modal {
    background: #2c3e50;
    color: #ecf0f1;
    border-radius: 8px;
    min-width: 360px;
    max-width: 480px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #34495e;
    font-weight: 600;
    font-size: 15px;
}

.modal-close {
    background: none;
    border: none;
    color: #7f8c8d;
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.modal-close:hover {
    color: #ecf0f1;
}

.modal-body {
    padding: 20px;
}

/* Confirm dialog buttons */
.confirm-btn {
    padding: 7px 16px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, opacity 0.15s;
}

.confirm-btn:hover {
    opacity: 0.85;
}

.confirm-btn-cancel {
    background: #3d4f5f;
    color: #bdc3c7;
}

.confirm-btn-discard {
    background: #c0392b;
    color: #fff;
}

.confirm-btn-save {
    background: #27ae60;
    color: #fff;
}

.confirm-btn-primary {
    background: #3498db;
    color: #fff;
}

.confirm-btn-danger {
    background: #c0392b;
    color: #fff;
}

.setting-row {
    margin-bottom: 16px;
}

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

.setting-row label {
    display: block;
    font-size: 12px;
    color: #95a5a6;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.setting-options {
    display: flex;
    gap: 8px;
}

.setting-options.language-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    max-height: 280px;
    overflow-y: auto;
}

.setting-option {
    flex: 1;
    padding: 8px 12px;
    background: #34495e;
    border: 2px solid transparent;
    border-radius: 6px;
    color: #bdc3c7;
    font-size: 13px;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
}

.language-grid .setting-option {
    flex: none;
    padding: 6px 8px;
    font-size: 12px;
}

.setting-option:hover {
    background: #3d566e;
    color: #ecf0f1;
}

.setting-option.active {
    border-color: #3498db;
    color: #ecf0f1;
    background: rgba(52, 152, 219, 0.15);
}

/* About Modal */
.about-modal {
    min-width: 380px;
    max-width: 420px;
    overflow: hidden;
}

.about-body {
    text-align: center;
    padding: 32px 28px 24px !important;
}

.about-hero {
    margin-bottom: 20px;
}

.about-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.15), rgba(52, 152, 219, 0.05));
    margin-bottom: 14px;
}

.about-app-name {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: #ecf0f1;
    margin-bottom: 4px;
}

.about-tagline {
    font-size: 13px;
    color: #7f8c8d;
    font-weight: 400;
}

.about-description {
    font-size: 13.5px;
    line-height: 1.65;
    color: #bdc3c7;
    text-align: left;
    background: rgba(52, 73, 94, 0.35);
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 20px;
}

.about-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #34495e, transparent);
    margin-bottom: 20px;
}

.about-author {
    margin-bottom: 20px;
}

.about-author-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #7f8c8d;
    margin-bottom: 6px;
}

.about-author-name {
    font-size: 16px;
    font-weight: 600;
    color: #ecf0f1;
    margin-bottom: 4px;
}

.about-email {
    display: inline-block;
    font-size: 13px;
    color: #3498db;
    text-decoration: none;
    padding: 4px 14px;
    border-radius: 20px;
    border: 1px solid rgba(52, 152, 219, 0.3);
    transition: all 0.2s;
    margin-top: 4px;
}

.about-email:hover {
    background: rgba(52, 152, 219, 0.1);
    border-color: #3498db;
}

.about-links {
    margin-top: 8px;
    font-size: 12px;
}

.about-links a {
    color: #888;
    text-decoration: none;
}

.about-links a:hover {
    color: #3498db;
    text-decoration: underline;
}

.about-links-sep {
    color: #555;
    margin: 0 6px;
}

.about-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    font-size: 11px;
    color: #5a6a7a;
}

/* Print Modal */
#print-preview-container {
    background: #1a252f;
    border-radius: 6px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    min-height: 200px;
}

#print-preview {
    max-width: 100%;
    max-height: 260px;
    background: #fff;
    border: 1px solid #34495e;
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

#print-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.print-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #34495e;
    border-radius: 6px;
    color: #bdc3c7;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}

.print-toggle:hover {
    background: #3d566e;
    color: #ecf0f1;
}

.print-toggle input[type="checkbox"] {
    accent-color: #3498db;
}

.print-btn-primary {
    display: block;
    width: 100%;
    padding: 10px;
    margin-top: 16px;
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.print-btn-primary:hover {
    background: #2980b9;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #2c3e50;
}

::-webkit-scrollbar-thumb {
    background: #7f8c8d;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}

/* Panel toggle buttons — hidden on desktop */
.mobile-panel-toggles {
    display: none;
}

/* Panel backdrop overlay */
.panel-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    transition: opacity 0.2s;
}

.panel-backdrop.hidden {
    display: none;
}

/* Responsive — tablets */
@media (max-width: 1024px) {
    #left-panel, #right-panel {
        width: 240px;
    }
}

/* Responsive — small tablets & phones */
@media (max-width: 768px) {
    .mobile-panel-toggles {
        display: flex;
    }

    #left-panel, #right-panel {
        position: fixed;
        top: 0;
        bottom: 0;
        width: 280px;
        z-index: 1000;
        transition: transform 0.25s ease;
        box-shadow: 4px 0 16px rgba(0, 0, 0, 0.3);
    }

    #left-panel {
        left: 0;
        transform: translateX(-100%);
    }

    #left-panel.panel-open {
        transform: translateX(0);
    }

    #right-panel {
        right: 0;
        left: auto;
        transform: translateX(100%);
        box-shadow: -4px 0 16px rgba(0, 0, 0, 0.3);
    }

    #right-panel.panel-open {
        transform: translateX(0);
    }

    /* Toolbar: wrap and compact */
    #toolbar {
        padding: 6px 8px;
        gap: 8px;
        flex-wrap: wrap;
    }

    .toolbar-group {
        gap: 4px;
    }

    .toolbar-separator {
        display: none;
    }
}

/* Responsive — phones */
@media (max-width: 480px) {
    #project-name-wrapper {
        display: none;
    }

    .toolbar-spacer {
        flex: 0;
        width: 0;
    }

    .tool-btn {
        min-width: 40px;
        height: 40px;
        padding: 8px;
    }

    #toolbar {
        padding: 4px 6px;
        gap: 4px;
    }

    .toolbar-group {
        gap: 2px;
    }

    /* Status bar compact */
    #status-bar {
        padding: 4px 8px;
        gap: 8px;
        font-size: 11px;
    }

    #status-position,
    #status-zoom,
    #status-grid {
        min-width: auto;
    }
}

/* Selection handles */
.selection-handle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #3498db;
    border: 1px solid white;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: none;
}

/* Dragging feedback */
body.dragging {
    cursor: move !important;
}

body.dragging * {
    cursor: move !important;
}

/* 3D Preview */
#preview3d-container {
    margin-top: 12px;
    border-top: 1px solid #34495e;
    padding-top: 8px;
}

#preview3d-container canvas {
    width: 100% !important;
    height: auto !important;
    border-radius: 6px;
    display: block;
}

#preview3d-container .preview3d-label {
    font-size: 12px;
    color: #bdc3c7;
    margin-bottom: 6px;
    font-weight: 600;
}

/* 3D Walkthrough Modal */
.view3d-modal {
    width: 95vw;
    height: 90vh;
    background: #1a252f;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.view3d-header {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    background: #2c3e50;
    border-bottom: 1px solid #34495e;
    color: #ecf0f1;
    font-weight: 600;
    font-size: 15px;
    gap: 16px;
    flex-shrink: 0;
}

.view3d-hint {
    font-size: 12px;
    color: #7f8c8d;
    font-weight: 400;
    flex: 1;
}

#view3d-canvas-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

#view3d-canvas-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* Viewpoint switcher buttons */
.view3d-viewpoints {
    display: flex;
    gap: 4px;
    margin: 0 12px;
}
.vp-btn {
    padding: 3px 10px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 12px;
    background: rgba(255,255,255,0.1);
    color: #ccc;
    font-size: 12px;
    cursor: pointer;
}
.vp-btn:hover { background: rgba(255,255,255,0.2); }
.vp-btn.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

/* Color propagation confirm bar */
.color-propagate-bar {
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #1a1a2e;
    border-top: 1px solid #333;
    font-size: 12px;
    color: #ccc;
    z-index: 10;
    animation: slideUp 0.2s ease-out;
}
.color-propagate-bar span {
    flex: 1;
}
.color-propagate-bar button {
    padding: 4px 12px;
    border: 1px solid #555;
    border-radius: 4px;
    background: #2a2a3e;
    color: #ddd;
    font-size: 12px;
    cursor: pointer;
}
.color-propagate-bar button:hover {
    background: #3a3a5e;
}
.color-propagate-bar .propagate-yes {
    background: #2d5a3d;
    border-color: #3a7a4d;
}
.color-propagate-bar .propagate-yes:hover {
    background: #3a7a4d;
}
@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Object Validator Modal */
.validator-modal {
    min-width: 480px;
    max-width: 1100px;
    width: 92vw;
    max-height: 90vh;
}

.validator-body {
    display: flex;
    gap: 16px;
}

.validator-col-left {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.validator-col-right {
    width: 340px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* On narrow screens, stack columns */
@media (max-width: 700px) {
    .validator-body {
        flex-direction: column;
    }
    .validator-col-right {
        width: 100%;
        flex-direction: row;
        gap: 12px;
    }
    .validator-col-right .validator-preview-box {
        flex: 1;
        min-width: 0;
    }
}

.validator-textarea-wrap {
    position: relative;
    margin-bottom: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.validator-textarea {
    width: 100%;
    flex: 1;
    min-height: 320px;
    background: #1a252f;
    color: #ecf0f1;
    border: 1px solid #34495e;
    border-radius: 6px;
    padding: 12px;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 12px;
    line-height: 1.5;
    resize: none;
    outline: none;
    tab-size: 2;
}

.validator-textarea:focus {
    border-color: #3498db;
}

.validator-textarea.drag-over {
    border-color: #2ecc71;
    background: rgba(46, 204, 113, 0.1);
}

.validator-drop-hint {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 11px;
    color: #7f8c8d;
    pointer-events: none;
}

.validator-gpt-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #10a37f 0%, #1a7f5a 100%);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: opacity 0.15s, transform 0.15s;
}
.validator-gpt-link:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}
.validator-gpt-icon {
    font-size: 16px;
}

.validator-btn-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.validator-btn-secondary {
    padding: 10px 16px;
    background: #34495e;
    color: #ecf0f1;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}
.validator-btn-secondary:hover {
    background: #3d566e;
}

.validator-btn-primary {
    display: block;
    flex: 1;
    padding: 10px 16px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 0;
    transition: background 0.15s;
}

.validator-btn-primary:hover {
    background: #2980b9;
}

.validator-btn-primary:disabled {
    background: #34495e;
    color: #7f8c8d;
    cursor: not-allowed;
}

.validator-btn-import {
    background: #27ae60;
    margin-bottom: 0;
    padding: 8px 16px;
    font-size: 13px;
    display: inline-block;
    flex: none;
    width: auto;
}

.validator-btn-import:hover:not(:disabled) {
    background: #219a52;
}

.validator-errors {
    margin-bottom: 12px;
}

.validator-error {
    color: #e74c3c;
    font-size: 13px;
    padding: 4px 0;
}

.validator-warning {
    color: #f39c12;
    font-size: 13px;
    padding: 4px 0;
}

.validator-success {
    color: #2ecc71;
    font-size: 13px;
    padding: 4px 0;
}

.validator-preview-box {
    min-width: 0;
}

.validator-preview-label {
    font-size: 11px;
    color: #95a5a6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.validator-canvas {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 6px;
    background: #1a252f;
    display: block;
}

.validator-3d-container {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 6px;
    overflow: hidden;
    background: #1a252f;
}

.validator-3d-container canvas {
    width: 100% !important;
    height: 100% !important;
    border-radius: 6px;
}

/* Loading states */
.loading {
    opacity: 0.5;
    pointer-events: none;
}