.mte-wrapper {
    border: 1px solid #e0e0e0;
    padding: 16px;
    border-radius: 8px;
    background: #fafafa;
    max-width: 1200px;
    margin: 0 auto 32px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.mte-title {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 1.5rem;
}

.mte-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.mte-label {
    font-size: 0.9rem;
}

.mte-btn {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s ease;
}

.mte-btn:hover {
    background: #005c87;
}

.mte-btn-secondary {
    background: #555;
}

.mte-btn-secondary:hover {
    background: #333;
}

.mte-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 16px;
}

.mte-canvas2d-container,
.mte-canvas3d-container {
    background: #fff;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

#mte-canvas2d {
    width: 100%;
    border: 1px solid #ddd;
    background: #fdfdfd;
}

#mte-3d-container {
    width: 100%;
    height: 400px;
    border: 1px solid #ddd;
    background: #111;
}

.mte-subtitle {
    margin-top: 0;
}

.mte-help {
    font-size: 0.8rem;
    color: #666;
    margin-top: 8px;
}

@media (max-width: 900px) {
    .mte-layout {
        grid-template-columns: 1fr;
    }
}

.mte-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 4px;
}
.mte-tab-btn {
    background: #0073aa;
    border: 1px solid #ccc;
    border-radius: 4px 4px 0 0;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.9rem;
}
.mte-tab-btn.mte-tab-active {
    background: #004b6f;
    border-bottom-color: #fff;
    font-weight: 600;
}
.mte-tab-panel {
    display: none;
}
.mte-tab-panel.mte-tab-panel-active {
    display: block;
}

/* Modal galería */
.mte-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.mte-modal[open],
.mte-modal.mte-open {
    display: flex;
}
.mte-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
}
.mte-modal-content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    max-width: 900px;
    width: 90%;
    max-height: 80vh;
    overflow: auto;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    z-index: 1;
}
.mte-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.mte-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}
.mte-gallery-item {
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    background: #fafafa;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.mte-gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.mte-gallery-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}